rm4453

HttpPost returning javascript must be enabled

1 post in this topic

#1 ·  Posted (edited)

Hey guys, I am working on a program that will be interacting with a website to send SMS to my clients, I am currently running into a major issue. The HttpPost request is returning the following code:
 

<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("c08c4bd7bbf1f680c0e03a0159daee83");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; location.href="http://prodev.ezyro.com/Bulk-SMS-Messenger/SendSMS.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>

However the code for the website is only PHP / Mysqli queries to the DB, and should not need javascript to be enabled. The webpage is http://prodev.ezyro.com/Bulk-SMS-Messenger/SendSMS.php

(WinHttp.au3 is attached) I need to figure out why it is returning this issue.... here is the relevant autoit code:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
#include <GuiEdit.au3>
#include <WinHttp.au3>
#include <Crypt.au3>

;Begin Variables

$user = 0
$pass = 0
$exit = 0
$send = False
$url = "http://prodev.ezyro.com/Bulk-SMS-Messenger/SendSMS.php?"
$To = ""
$From = ""
$Body = ""
$data = ""

;End Variables

;Begin Gui Creation

$Twilio_Messenger = GUICreate("Twilio Messenger", 615, 437, 192, 124)
$LoginCreds = GUICtrlCreateGroup("LoginCredentials", 16, 16, 201, 129)
$Username = GUICtrlCreateInput("Username", 32, 40, 169, 21)
$Password = GUICtrlCreateInput("Password", 32, 72, 169, 21, 0x0020)
$Save = GUICtrlCreateButton("Save Settings", 64, 104, 97, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$MessageSettings = GUICtrlCreateGroup("MessageSettings", 232, 16, 369, 401)
$SendFrom = GUICtrlCreateInput("SendFrom", 248, 48, 337, 21)
$SendTo = GUICtrlCreateEdit("SendTo", 248, 88, 337, 103, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_VSCROLL))
$MessageTo = GUICtrlCreateEdit("", 248, 210, 337, 21, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN))
GUICtrlSetData(-1, "MessageTo")
$MessagesSent = GUICtrlCreateLabel("Messages This Session:", 280, 240, 115, 17)
$Sent = GUICtrlCreateLabel("0", 400, 240, 100, 17)
$SendProgress = GUICtrlCreateProgress(248, 269, 337, 81)
$SendMessages = GUICtrlCreateButton("SendMessages", 320, 368, 201, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$MessageResponses = GUICtrlCreateGroup("MessageResponses", 16, 160, 201, 257)
$ApiResponse = GUICtrlCreateEdit("", 32, 184, 169, 196, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_VSCROLL))
$ClearLog = GUICtrlCreateButton("Clear Log", 32, 387, 79, 21)
$SaveToLog = GUICtrlCreateButton("Save To Log", 123, 387, 79, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)

;End Gui Creation

;Begin UDF

Func QuickOutput($Filename, $Output, $Mode)
    Local $File = FileOpen($Filename, $Mode)
    FileWriteLine($File, $Output)
    FileClose($File)
EndFunc   ;==>QuickOutput

Func Save()
    IniWrite("IE_Interface.dll", "UserInfo", "User", _Crypt_EncryptData(GUICtrlRead($Username), "44534453", $CALG_AES_256))
    IniWrite("IE_Interface.dll", "UserInfo", "Pass", _Crypt_EncryptData(GUICtrlRead($Password), "44534453", $CALG_AES_256))
    IniWrite("IE_Interface.dll", "SendInfo", "SendFrom", GUICtrlRead($SendFrom))
    IniWrite("IE_Interface.dll", "SendInfo", "SendTo", StringReplace(GUICtrlRead($SendTo), @CRLF, ","))
    IniWrite("IE_Interface.dll", "SendInfo", "MessageTo", GUICtrlRead($MessageTo))
EndFunc   ;==>Save

Func Load()
    GUICtrlSetData($Username, BinaryToString(_Crypt_DecryptData(IniRead("IE_Interface.dll", "UserInfo", "User", ""), "44534453", $CALG_AES_256)))
    GUICtrlSetData($Password, BinaryToString(_Crypt_DecryptData(IniRead("IE_Interface.dll", "UserInfo", "Pass", ""), "44534453", $CALG_AES_256)))
    GUICtrlSetData($SendFrom, IniRead("IE_Interface.dll", "SendInfo", "SendFrom", ""))
    GUICtrlSetData($SendTo, StringReplace(IniRead("IE_Interface.dll", "SendInfo", "SendTo", ""), ",", @CRLF))
    GUICtrlSetData($MessageTo, IniRead("IE_Interface.dll", "SendInfo", "MessageTo", ""))
EndFunc   ;==>Load

Func Hash()
    $user = StringLower(Hex(_Crypt_HashData(StringToBinary(GUICtrlRead($Username), 1), $CALG_MD5)))
    $pass = StringLower(Hex(_Crypt_HashData(StringToBinary(GUICtrlRead($Password), 1), $CALG_MD5)))
EndFunc   ;==>Hash

;End UDF

;Begin Main Loop

If FileExists("IE_Interface.dll") Then
    Load()
EndIf

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Save()
            Exit

        Case $Save
            Save()

        Case $SendMessages
            Hash()
            $sText = GUICtrlRead($SendTo)
            $aText = StringSplit($sText, @CRLF, 1)
            GUICtrlSetData($SendProgress, 0)
            For $i = 1 To $aText[0]
                $data = "user=" & $user & "&pass=" & $pass & "&to=" & $aText[$i] & "&from=" & GUICtrlRead($SendFrom) & "&message=" & GUICtrlRead($MessageTo) & "&i=1"
                Global $recv = HttpPost($url, $data)
                If Not $recv = "Incorrect Login!" Then
                    MsgBox("", "Incorrect Login!", "Your Login Credentials Are Incorrect Please Try Again!")
                    GUICtrlSetData($SendProgress, 0)
                    $exit = 1
                EndIf
                If $exit = 0 Then
                    _GUICtrlEdit_AppendText($ApiResponse, $recv & @CRLF)
                    GUICtrlSetData($Sent, GUICtrlRead($Sent) + 1)
                    GUICtrlSetData($SendProgress, 100 / (UBound($aText) - 1) * $i)
                    Sleep(50)
                EndIf
            Next
            If $exit = 0 Then
                MsgBox("", "Messages Sent!", "Finished Attempting To Send Messages" & @CRLF & "View Log For Send Results!")
                InputBox("", "", $url & $data)
                QuickOutput("Received.html", $recv, 2)
            EndIf
                $exit = 0

        Case $ClearLog
            GUICtrlSetData($ApiResponse, "")

        Case $SaveToLog
            $lText = GUICtrlRead($ApiResponse)
            $lText = StringSplit($lText, @CRLF, 1)
            FileWrite("SMSLog.txt", "Logged On: " & _NowDate() & " @ " & _NowTime(3) & @CRLF)
            For $i = 1 To $lText[0]
                FileOpen("SMSLog.txt", 9)
                FileWriteLine("SMSLog.txt", $lText[$i])
            Next

    EndSwitch
WEnd
While 1



WEnd

;End Main Loop

 

 

 

*Edit:

  Cleared Private Info

WinHttp.au3

Edited by rm4453

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now