So I have my webpage at: http://daera.net/dmoon/issuecmds.php
Since this is my own site, I can modify it in whatever manner I want. Right now it is meant to send a simple, static response with this single line:
<?php echo "Hello. This is a test to check the functioning of web based softwares"; ?>
This shows the expected one liner page whenever I open it in any web browser.
The problem arises when I try to reach my page using my VB.NET application. The said app simply reads the page and shows the result in a multi line textbox. This is the code I am using to read the webpage:
Async Function ReadPage() As Task(Of String)
Dim res As String
Using client As HttpClient = New HttpClient()
Using response As HttpResponseMessage = Await client.GetAsync(str_url)
Using content As HttpContent = response.Content
Dim result As String = Await content.ReadAsStringAsync()
res = result
If res.Length < 4 Then
res = "Err"
End If
End Using
End Using
End Using
Return res
End Function
Private Async Sub btnRead_Click(sender As Object, e As EventArgs) Handles btnRead.Click
Randomize()
Dim rnd As New Random
Dim rand As Integer = rnd.Next()
str_url = "http://daera.net/dmoon/issuecmds.php?&rand=" + rand.ToString()
txtResult.Text = Await ReadPage()
End Sub
Note that I am using a random number in the address to avoid getting a cached response. The code runs fine, but the problem is that sometimes (just randomly), sometimes this would show the code for a "Please Wait" page instead of the simple one liner response intended in the php code mentioned above.
Edit: After getting no "Please Wait..." page for more than 2 weeks, I was finally able to see it again. I copied all the response/HTML obtained by the ReadPage() function. Here it is:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow">
<title>One moment, please...</title>
<style>
body {
background: #F6F7F8;
color: #303131;
font-family: sans-serif;
margin-top: 45vh;
text-align: center;
}
</style>
</head>
<body>
<h1>Please wait while your request is being verified...</h1>
<form id="wsidchk-form" style="display:none;" action="/z0f76a1d14fd21a8fb5fd0d03e0fdc3d3cedae52f" method="GET">
<input type="hidden" id="wsidchk" name="wsidchk"/>
</form>
<script>
(function(){
var west=+((+!+[]+!![]+!![])+(+!+[]+[])+(+!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(+!+[]+!![]+!![]+[])+(+!+[]+!![]+!![]+!![]+!![]+!![]+!![])+(+!+[]+!![]+[])+(+!+[]+!![]+!![]+!![])),
east=+((+!+[]+!![]+!![]+!![])+(+!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(+!+[]+!![]+!![]+!![]+!![]+!![])+(+!+[]+[])+(+!+[]+!![]+!![]+!![])+(+!+[]+!![]+!![]+!![]+!![]+[])+(+!+[])),
x=function(){try{return !!window.addEventListener;}catch(e){return !!0;} },
y=function(y,z){x() ? document.addEventListener('DOMContentLoaded',y,z) : document.attachEvent('onreadystatechange',y);};
y(function(){
document.getElementById('wsidchk').value = west + east;
document.getElementById('wsidchk-form').submit();
}, false);
})();
</script>
</body>
</html>
I understand that this issue is occurring from the site host server and not the VB.NET code.
Is it some sort of auto defense mechanism against bots/spiders etc? Where can I disable this in the site settings. Here is (probably) the relevant section of site settings:

Randomize()thing, it has nothing to do with the Random class (which should be declared as a static (Shared) object, or you could use its static methods when targeting .NET 6+)await Task.Delay(100)between calls). The response was never the one you're reporting, which is not a standard response, BTW, it looks more like a HTML page with an embeddedrefreshof some sort. I can't say, I've never gotten it