I am trying to make a program in .NET that goes to a list of provided faucet box faucets and collects the free Bitcoins provided. So far, when I try using the program with bibi faucet there is no evidence the program works. I only coded the bot to collect from faucets that only require the CAPTCHA be checked. Below is my source code
Form1.vb
Imports System.Net
Imports System.IO
Public Class Form1
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
' loop through faucet list
Dim faucetUrls() As String = Split(txtFaucetList.Text, vbCrLf)
For Each url As String In faucetUrls
' get faucet source code
Dim pageHtml As String = web.web("get", url)
' solve captcha
'get special name of btc address checkbox
Dim addInputNameEndPos As Integer = pageHtml.IndexOf("class=""form-control"" value="""" placeholder=""Your Address"" style=""width: 468px; border-radius: 3px; font-size: 12px;"">")
Dim addInputNameStartPos As Integer = addInputNameEndPos - 27
If addInputNameEndPos = -1 Then
addInputNameEndPos = pageHtml.IndexOf("class=""form-control"" value=""""")
End If
' check agian
If addInputNameStartPos = -1 Then
addInputNameStartPos = pageHtml.IndexOf("class=""form-control"" type=""text"" value="""" placeholder=""Your address"" name=""")
End If
Dim addInputName As String = pageHtml.Substring(addInputNameStartPos, addInputNameEndPos - addInputNameStartPos)
If pageHtml.IndexOf("<input name=name=""honeypot""") > 0 Then
' send web request/response
Dim address As String = txtAdd.Text
Dim resultHtml As String = web.web("post", url, "address=" & address & "&honeypot=checked&" & addInputName & "=" & address)
End If
Next
End Sub
End Class
web.vb
Imports System
Imports System.Net
Imports System.IO
Imports System.Text
Module web
Public Function web(ByVal mode As String, ByVal url As String, Optional ByVal data As String = Nothing)
If mode = "get" Then
' create new webrequest object
Dim request As WebRequest = WebRequest.Create(url)
Dim response As WebResponse = request.GetResponse()
Dim sr As StreamReader = New StreamReader(response.GetResponseStream()) ' create streamreader
' no data to enter
Return sr.ReadToEnd()
ElseIf mode = "post" Then
'ceate webrequest object
Dim request As WebRequest = WebRequest.Create(url)
' add post data to request
' set request property to post
request.Method = "POST"
' convert data to byte array
Dim byteArray() As Byte = Encoding.UTF8.GetBytes(data)
' set MIME
request.ContentType = "application/x-www-form-urlencoded"
request.ContentLength = byteArray.Length
'get request stream
Dim datastream As Stream = request.GetRequestStream()
' write data to stream
datastream.Write(byteArray, 0, byteArray.Length)
' close data stream
datastream.Close()
' now get response
Dim response As WebResponse = request.GetResponse()
' get stream cotaining response from server
datastream = response.GetResponseStream()
' return text
Dim reader As New StreamReader(datastream)
Return reader.ReadToEnd()
Else
Return False
End If
End Function
End Module