2017-07-25, 01:34 PM
Hi. I have a vb.net application and I tried to login on mybbforum by a form that I created. I searched about it and tried by many ways.
* Mybblogin Dll
After added mybblogin.dll as reference in my project. The code:
Result: Even with the correct username and password, it can not possible to login. Always: "Login Failed. Try again"
* Testing by POST
Result: When I try with "community.mybb.com/ " everything works (richtextbox shows html page and webbrowser shows login successful) but with myforum url, i get this html:
As I don't know what is this problem, I checked if Javascript is activated in my browsers and it's ok.
If someone can give me another solution, I will be very grateful. Thanks in advance.
* Mybblogin Dll
After added mybblogin.dll as reference in my project. The code:
Imports myBBLogin
Public class form1
....
Public Const myweb As String = "myforumname.ml/mybb"
...
Public sub login()
Dim wrkr As New HTTPWorker()
Dim myBBForum As New myBB("http://" & myweb & "/member.php?action=login", txtUsername.Text, txtPassword.Text)
RichTextBox1.Visible = True
RichTextBox1.ForeColor = Color.Green
RichTextBox1.Text = "Loading..."
If txtUsername.Text = "" Or txtPassword.Text = "" Then
RichTextBox1.Text = ""
RichTextBox1.ForeColor = Color.Red
RichTextBox1.Text = "Fill all" & vbCrLf & "the blanks!"
Exit Sub
End If
If wrkr.login(myBBForum) Then
RichTextBox1.Text = ""
RichTextBox1.ForeColor = Color.Green
RichTextBox1.Text = "Logged!"
MessageBox.Show("Ok")
Else
RichTextBox1.ForeColor = Color.Red
RichTextBox1.Text = "Login Failed." & vbCrLf & "Try again!"
Process.Start("http://" & myweb & "/member.php?action=register")
End If
End Sub
End Class
Result: Even with the correct username and password, it can not possible to login. Always: "Login Failed. Try again"
* Testing by POST
Public Class Form1
Public Sub login()
Using SendTo As New Net.WebClient
Dim Param As New Specialized.NameValueCollection
Param.Add("username", txtUsername.Text)
Param.Add("password", txtPassword.Text)
Param.Add("remember", "yes")
Param.Add("action", "do_login")
Param.Add("url", "Valor")
Dim ResponseBytes As Byte() = SendTo.UploadValues("http://myforumname.ml/mybb/member.php", "POST", Param)
Dim ResponseHTML As String = (New System.Text.UTF8Encoding).GetString(ResponseBytes)
RichTextBox1.Text = ResponseHTML
End Using
End Sub
Public Sub btn_transformToHTML()
WebBrowser1.DocumentText = RichTextBox1.Text
End Sub
End Class
Result: When I try with "community.mybb.com/ " everything works (richtextbox shows html page and webbrowser shows login successful) but with myforum url, i get this html:
<html>
<body>
<script type="text/javascript" src="/aes.js" ></script>
<script>
function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});
return e}
function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);
return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("4aaacc631ef4d1d155793dd8a3ea66b1");
document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+";
expires=Thu, 31-Dec-37 23:55:55 GMT; path=/";
location.href="http://myforumname.ml/mybb/member.php?i=1";
</script><noscript>
This site requires Javascript to work, please enable Javascript in your browser
or use a browser with Javascript support</noscript></body></html>
As I don't know what is this problem, I checked if Javascript is activated in my browsers and it's ok.
If someone can give me another solution, I will be very grateful. Thanks in advance.