AutoIt Website Login

09/02/2019 14:30 R4pTix#1
I have a problem creating a Login with AutoIt for mylolsim.net.

I gathered the POST packet used for login and tried to use it in AutoIT, but no matter how I implement the stuff I get a response saying: <font color='red'>This username does not exist.</font>



I would really appreciate any given help!
Thanks in advance.
09/07/2019 01:24 elmarcia#2
Quote:
Originally Posted by R4pTix View Post
I have a problem creating a Login with AutoIt for mylolsim.net.

I gathered the POST packet used for login and tried to use it in AutoIT, but no matter how I implement the stuff I get a response saying: <font color='red'>This username does not exist.</font>



I would really appreciate any given help!
Thanks in advance.
Change
Code:
$login_packet = 'username: '& $Username
;...
$login.SetRequestHeader('Content-Type', 'text/html; charset=UTF-8')
To
Code:
$login_packet = 'username='&$Username&'&password='&$Password
;...
$login.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8')
Then on login response u will get something like this:
<script>window.location.href = 'index.php';</script>

So u need to make a http request with response cookie to that url
To get response headers use this
Code:
;...
$sourcecode = $login.ResponseText()
$headers = $login.getAllResponseHeaders()
MsgBox(0,"",$headers)
;Specific header
$cookie = $login.getResponseHeader("Set-Cookie")