|
You last visited: Today at 20:37
Advertisement
WinHTTP Problem
Discussion on WinHTTP Problem within the AutoIt forum part of the Coders Den category.
09/13/2013, 08:20
|
#1
|
elite*gold: 128
Join Date: Sep 2007
Posts: 1,495
Received Thanks: 109
|
WinHTTP Problem
Hi,
also ich spiele derzeit mit WinHttp rum undzwar möchte ich mir per WinHTTP Accounts erstellen, diese arbeiten mit einem Captcha (fülle ich selber aus).
Dieser ändert sich bei jedem Reload
Nun rufe ich die Seite auf, ziehe mir den Quellcode und lade dann das Bild herunter.
Nun Submit ich meine Informationen + Captcha text, jedoch wird hierbei die Seite neu geladen und ich müsste einen anderen Captcha angeben, hat jemand eine Idee wie ich das umgehen kann? Habe ich etwas falsch verstanden?
|
|
|
09/13/2013, 14:14
|
#2
|
elite*gold: 159
Join Date: Jun 2013
Posts: 1,776
Received Thanks: 2,004
|
Warum lädst du denn die Seite neue, wenn du das Captcha geholt hast?
|
|
|
09/13/2013, 14:19
|
#3
|
elite*gold: 128
Join Date: Sep 2007
Posts: 1,495
Received Thanks: 109
|
Er läd beim abschicken die Seite neu, code folgt gleich
Code:
region WINHTTP Auslesen
$hSession = _WinhttpOpen("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0")
$hConnect = _WinhttpConnect($hSession, "xxx-shop.com")
$sHtml = _WinhttpSimpleRequest($hConnect, "GET", "/create_account.php")
FileWrite($temppath&"Test.htm", $sHtml)
FileClose($temppath&"Test.htm")
#endregion WINHTTP Auslesen
#region LINK AUSLESEN
FileWriteLine($temppath&"HTML.txt", $sHtml)
$file = FileOpen($temppath&"HTML.txt")
While 1
$line = FileReadLine($file)
If @error = -1 Then ExitLoop
$result = StringInStr($line, 'name="Captcha"')
If $result >0 Then
$picresult = _StringBetween ($line,"validation_png.php?",'" alt="')
FileWriteLine ($temppath&"pic.txt",$picresult[0])
FileWriteLine ($path&"pic.txt",$picresult[0])
FileClose($temppath&"pic.txt")
EndIf
Wend
$caplink = "https://xxx-shop.com/validation_png.php?"&$picresult[0]
#endregion LINK AUSLESEN
#region GUI
InetGet( $caplink, $temppath&$counter&".png",1,0) ;Hinzugefügt
$uebergabe = "["&$counter&"]["&$temppath&"]["&$path&"]"
ShellExecuteWait($path&"convert.exe",$uebergabe)
GUICreate("PressCopyNator",300,220,500,260)
$guicaptcha = GUICtrlCreatePic ($temppath&$counter&".jpg",10,10,230,50)
GUISetState (@SW_SHOW)
$button1 = GUICtrlCreateButton("Refresh",245,10,50,50)
$button2 = GUICtrlCreateButton("Start",245,70,50,40)
$IPCaptcha = GUICtrlCreateInput ("",10,70,230,40)
GUICtrlSetFont($IPCaptcha, 20)
#endregion GUI
while 1
$guiaction = GUIGetMsg()
Select
;EXIT
Case $guiaction = -3
Run($path&"delete.dll")
Exit
;REFRESH BUTTON
Case $guiaction = $button1
InetGet ( $caplink, $temppath&$counter&".png",1,0)
$uebergabe = "["&$counter&"]["&$temppath&"]["&$path&"]"
ShellExecuteWait($path&"convert.exe",$uebergabe)
GUICtrlSetImage (3,$temppath&$counter&".jpg")
;ABSCHICKEN BUTTON
Case $guiaction = $button2
$GuiReadIPCaptcha = GUICtrlRead($IPCaptcha)
$Finalstring = StringReplace($GuiReadIPCaptcha, "!","%21")
$Finalstring = StringReplace($GuiReadIPCaptcha, '"',"%22")
$Finalstring = StringReplace($GuiReadIPCaptcha, "§","%23")
$Finalstring = StringReplace($GuiReadIPCaptcha, "$","%24")
$Finalstring = StringReplace($GuiReadIPCaptcha, "%","%25")
$Finalstring = StringReplace($GuiReadIPCaptcha, "&","%26")
$Finalstring = StringReplace($GuiReadIPCaptcha, "/","%27")
$Finalstring = StringReplace($GuiReadIPCaptcha, "(","%28")
$Finalstring = StringReplace($GuiReadIPCaptcha, ")","%21")
$Finalstring = StringReplace($GuiReadIPCaptcha, "=","%3D")
$Finalstring = StringReplace($GuiReadIPCaptcha, "?","%3F")
$Finalstring = StringReplace($GuiReadIPCaptcha, "+","%2B")
;~ MsgBox(0,"",$Finalstring)
$antirobotreg = $Finalstring
$createdata = "action=process&gender="&$gender&"&firstname="&$firstname&"&lastname="&$lastname&"&email_address="&$email_address&"&street_address="&$street_address&"&suburb=&postcode="&$postcode&"&city="&$city&"&country="&$country&"&password="&$password&"&confirmation="&$password&"&antirobotreg="&$antirobotreg&"&x="&$x&"&y="&$y
$sHTML = _WinhttpSimpleRequest($hConnect, "POST", "create_account_success.php", "www.xxxx-shop.com/create_account.php", $createdata)
FileWrite("test2.html", $sHtml)
|
|
|
09/13/2013, 14:32
|
#4
|
elite*gold: 3653
Join Date: Aug 2008
Posts: 30,854
Received Thanks: 529
|
Hab nur kurz rein geschaut, holst du captcha mit integet und Rest per winhttp? Falls ja liegt da schon ein Fehler captcha muss per winhttp Binary gesaugt werden da du sonst das captcha einer anderen Session kriegst
|
|
|
09/13/2013, 14:37
|
#5
|
elite*gold: 128
Join Date: Sep 2007
Posts: 1,495
Received Thanks: 109
|
ah ok danke  werd es dann mal so testen - doof gefragt wie lad ich was per Binary
|
|
|
09/13/2013, 15:39
|
#6
|
elite*gold: 3653
Join Date: Aug 2008
Posts: 30,854
Received Thanks: 529
|
so wie im skype beprochen post ich nochmal hier, damit auch andere ne lösung finden:
der winhttpteil sieht wie folgt aus wenn man captchas macht
Code:
$hagent = _winhttpopen("euer useragent")
$hconnect = _winhttpconnect($hagent, "server auf dem die regpage liegt")
$html = winhttpsimplerequest($hconnect, "GET", "regpage")
$captcha_url = StringRegExp($html, 'pattern zb:"img src="validation_png.php?(.+)" alt="" name="Captcha"',3)
$captcha_binary = _winhttpsimplerequest($hconnect, "GET", validation_png.php?$captcha_url[0],"","","",false,2); lädt das bild binär herunter
$captcha_datei = FileOpen("captcha.jpg",18); parameter 18 = 16(überschreiben) + 2(write binary)
FileWrite($captcha_datei, $captcha_binary)
FileClose($captcha_datei)
;diese datei danch in die gui laden per createpic, bei png _gdiplus verwenden
is keine c&p lösung, vor allem weil syntaxfehler drin sind  aber wer sich ein wenig mit regexp und winhttp auskennt sollte sich hier zurecht finden
|
|
|
09/13/2013, 15:41
|
#7
|
elite*gold: 128
Join Date: Sep 2007
Posts: 1,495
Received Thanks: 109
|
Auch hier noch einmal ein Danke!
|
|
|
 |
Similar Threads
|
WinHTTP Kleines Problem :)
04/04/2013 - AutoIt - 5 Replies
Ich habe ein Darkorbit Login projekt aber wie kan ich etc:uridium,credits.... anseigen
etc:
Msgbox(64,Credits,$iCredits & " Credits hast du")
aber wie finde ich credits :)
$iCredits = StringRegExp($sHTML, '<div id="header_credits" class="header_money">'&'(.*?)< /div>', 3)
|
Shakes & fidget login Problem, Winhttp
03/16/2013 - AutoIt - 3 Replies
Moin,
Ich habe hier ein Problem mit dem Shakes und Fidget login.
Undzwar:
#include <winhttp.au3>
#Include <Crypt.au3>
$sUsername = ''
|
WinHTTP Send Problem
05/31/2012 - AutoIt - 5 Replies
Ich hoffe mal ich hab die Überschrift treffen beschrieben.
Mein Problem ist liegt darin, das ich versuche einen Packtbot zumachen der mir die Belohnung eines Spiels abholt. Das klappt auch einwandfrei.
Das ist mein Script wenn ich es ohne Gui mache:
#RequireAdmin
#include <WinHTTP.au3>
$Session = _WinHttpOpen ("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0")
$Connect = _WinhttpConnect ($Session,"www.aeriagames.com")
$HTML = _WinHttpSimpleRequest ($Connect,...
|
AutoIT WinHTTP PacketBot Problem
05/30/2012 - AutoIt - 6 Replies
Hi,
ich arbeite derzeit an einem kleinen Darkorbit Packet-Bot.
Nur scheitere ich beim Login schon.
Also bis zur Instance auswahl komm ich aber dann die Instance wählt es nicht aus. ich habe hier mal meinen Code gepostet ich hoffe ihr könnt mir schnell helfen.
#include <WinHTTP.au3>
$hSession = _WinHttpOpen("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0 Firefox/12.0")
$hConnect = _WinhttpConnect($hSession, "www.darkorbit.com")
|
WinHTTP Proxy Problem
10/30/2011 - AutoIt - 8 Replies
Hallo com,
habe folgendes Problem bei der Proxy Einstellung mit WinHTTP.
Mein Code sieht wie folgt aus:
#include <WinHTTP.au3>
#include <String.au3>
#include <Array.au3>
$Proxy = "59.66.63.182:8909"
|
All times are GMT +1. The time now is 20:37.
|
|