Guest User

Untitled

a guest
Oct 12th, 2016
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.74 KB | None | 0 0
  1. #include <WinHTTP.au3>
  2. $sLicenceUsername = InputBox("Licence System Login Data", "Please enter your Licence System Username")
  3. $sLicencePassword = InputBox("Licence System Login Data", "Please enter your Licence System Password", "", "*")
  4. $sCodeBotUsername = InputBox("Codebot.de Login Data", "Please enter your Codebot.de Username")
  5. $sCodeBotPassword = InputBox("Codebot.de Login Data", "Please enter your Codebot.de Password", "", "*")
  6. ;Create WinHTTP Connection to Licence Server
  7. $hLicenceSession = _WinHttpOpen()
  8. $hLicenceConnect = _WinHttpConnect($hLicenceSession, "127.0.0.1")
  9. ;Create WinHTTP Connection to CodeBot.de
  10. $hCodebotSession = _WinHttpOpen()
  11. $hCodebotConnect = _WinHttpConnect($hCodebotSession, "www.codebot.de")
  12. ;Requests the LoginPage of CodeBot.de
  13. $sRequest = _WinHttpSimpleRequest($hCodebotConnect, "GET", "/index.php/Login")
  14. ;Sends the SourceCode of the requested LoginPage to our Licence Server using the getT Action
  15. $t = _WinHttpSimpleRequest($hLicenceConnect, "POST", "/php Lizenz System/licence.php", Default, _
  16.                 'username=' & $sLicenceUsername & '&password=' & $sLicencePassword & '&action=getT&data=' & $sRequest)
  17. ;If $t does not tell u login incorrect or Not Licenced we got the correct Timestamp from the Licence Server and are ready to login.
  18. If ($t = 'Login incorrect' Or $t = 'Not Licenced') Then
  19.     MsgBox(0, "Error", $t)
  20. Else
  21.     $sCodebotBody = _WinHttpSimpleRequest($hCodebotConnect,  "POST", "/index.php/Login/", Default, _
  22.                 'username=' & $sCodeBotUsername & '&action=login' & '&password=' & $sCodeBotPassword  & '&useCookies=1&submitButton=Anmelden&url=http%3A%2F%2Fwww.codebot.de%2F&t='&$t)
  23.     If StringInStr($sCodebotBody, 'Sie wurden erfolgreich angemeldet.') > 0 Then
  24.         MsgBox(0, "Success", "Login successfull")
  25.     Else
Add Comment
Please, Sign In to add comment