Jump to content
Sign in to follow this  
wakillon

HttpHeaderWatcher v1.0.1.3 recreate full WinHttp Request in au3 format

Recommended Posts

wakillon

HttpHeaderWatcher v1.0.1.3

 

201402131358371.jpg

Some time ago, some members asked how to see the Http Requests.
There are quite a few external applications but not in AutoIt!
HttpHeaderWatcher in association with WinPcap, very modestly solves this lack.

 

Once done this http watcher, i asked me : why not Re-build a WinHttp Request in AutoIt from a selected Request in one Click ?
So i have added a "Create au3" button who open the WinHttp Request of your choice in AutoIt format in SciTE Editor.

Voila voila, hope it can help !  :)

Buttons were made online with chimply.com the easy and free buttons generator !

See Help for more infos.

previous downloads : 253

source and executable are available in the Download Section

Hope you like it !

Edited by wakillon
  • Like 1

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
nend

I've tryd it but.... ill get a error and it is'nt possible to select a device (the list is empty).

(614) : ==> Array variable subscript badly formatted.:
$pCap = _PcapStartCapture ( $aPcapDevices[$int][0], 'host ' & $aPcapDevices[$int][7] & ' and tcp port (80 or 8080)', 0, 65536, 2^24, 0 )
$pCap = _PcapStartCapture ( $aPcapDevices[^ ERROR
 
I'm not using the latest version of Autoit (i'm using 3.3.8.1) mabey that is the problem?
I've installed the lattest Win pcap.
 
EDIT:
 
I've found it:
 
On line number 321 it sets $ipv4 = 0
On line number 331 it won't come by this: If $ipv4 > 1 Then
I've I comment out this line al thing works greate.
 
 
Thanks for this nice program
Edited by nend

Share this post


Link to post
Share on other sites
wakillon

Hi nend

You are right, it should be : If $ipv4 >= 1 Then

You had an error because you only have a unique device detected.

Say me if i'm wrong. :)

Thanks for your feedback.


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
nend

No The problem was that I just can't select a device.

So I've tryd to start it without selecting a device and that produce a error.

This is a good program for me to learn WinPcap, I wan't to make a program that capture streaming audiolinks.

Edited by nend

Share this post


Link to post
Share on other sites
nend

The first time when I started this program nothing was showing in the combobox until I comment out line 331.

Every next time it's showning 1 ethernetcard (the only one in this pc).

And I works perfectly so far.

Share this post


Link to post
Share on other sites
wakillon

Ok, so i was right.

$ipv4 indicate the number of detected devices

and as i set the condition to be superior to 1 for set datas to the combo (who is logic for a combo to have several items),

it didn't set anything in your case, cause you only have 1 device.

Instead of comment the line, replace it by : If $ipv4 >= 1 Then 

and it should work.  ;)

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
wakillon

Hi JohnOne  ;)

It's normal that line 321 the variable $ipv4 is declared and set to 0

I suggest to modify the line 330 :  If $ipv4 > 1 Then  to  If $ipv4 >= 1 Then

I have made some tries on several computers and i always get 2 devices, that's why i set a combo.

Did you try it ?


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
wakillon

Yes tried it, all works fine for me, I have a number of devices.

 

Cool !

I 'm waiting for nend confirmation for update script.

Thanks  ;)


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
nend

@ Wakillon,

All works well with "If $ipv4 >= 1 Then"

Edited by nend

Share this post


Link to post
Share on other sites
DeltaRocked

Hi ,

Downloaded and installed WinPcap , getting the list of NICs in the dropdown list . When I click on start and then via a browser trying to browse --- nothing shows up on the Application console.

Are there any pre-requisites ?

Rgds

Share this post


Link to post
Share on other sites
wakillon

Hi ,

Downloaded and installed WinPcap , getting the list of NICs in the dropdown list . When I click on start and then via a browser trying to browse --- nothing shows up on the Application console.

Are there any pre-requisites ?

Rgds

 

No.

1 - May be your browser use his cache, in this case try to actualize the page.

2 - May be you use a "https" url and as this type of request are ssl encrypted and on port 443, script do not support them.

3 - May be you can try by selecting an other device.

Do you have a device who look as mine in the picture of the first post ?

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
wakillon

@ Wakillon,

All works well with "If $ipv4 >= 1 Then"

 

Cool !

i will update script and by the same occasion disable the combo if there is only one device.  

Thanks.

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
wakillon

Updated for correct the bug that nend have found !

@DeltaRocked : Have you managed to make it work ?


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
DeltaRocked

Hi Wakillon,

Downloaded the latest version and now it works as per the documentation. thanks.

Regards

Share this post


Link to post
Share on other sites
wakillon

Hi Wakillon,

Downloaded the latest version and now it works as per the documentation. thanks.

Regards

 

Glad it works well now.

Thanks for your feedback.


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
DeltaRocked

There is one more request :

During my testing , I was working on a local server ie. 127.0.0.1 and wanted to look into the headers , but since the LAN IP is tapped , I wassnt able to look into the https headers from the local machine and had to utilise another resource.

1: Would it be possible to tap into 127.0.0.1 

rgds

Share this post


Link to post
Share on other sites
wakillon

Hi DeltaRocked

 

Sorry but "Https" requests are ssl encrypted and i do not know how use the "man in the middle" method for be able to "decrypt" them.


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

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
Sign in to follow this  

  • Similar Content

    • AndyS19
      By AndyS19
      The _WinAPI_TextOut() function requires a x/y point.  In a rectangle enclosing a text character, where is the x/y point, upper left or lower left?  I'm trying to setup a function to print a header, then normal text lines, and I want the header to be at the top of the printable area on a page..  I use _WinAPI_GetDeviceCaps() to get the start of the printable area.  Then at the start of each page, I want to print a header, then text lines.
      $iLeftMargin_X = _WinAPI_GetDeviceCaps($hDC, $PHYSICALOFFSETX) ; returns 151 $iTopMargin_Y = _WinAPI_GetDeviceCaps($hDC, $PHYSICALOFFSETY) ; returns 70 ; print the header: $x = $iLeftMargin_X $y = $iTopMargin_Y WinAPI_TextOut($hDC, $x , $y, "header text") ; print the first text line $y += 22 WinAPI_TextOut($hDC, $x , $y, "The first text line") Will the header text be at the physical top of the printable area or will it be 1 text line lower.  It all depends on whether $iTopMargin_Y refers to the top of the text or the bottom of the text.
    • Ascer
      By Ascer
      Hello
      Opertation Sys: Win7 x64
      Problem: Connecting to webs using TLS 1.1 +
      Description: WinHttp.WinHttpRequest.5.1 using TLS 1.0 by default, i need higher version to connect into some webs.
      Dim $oHttp = ObjCreate("WinHTTP.WinHTTPRequest.5.1") $oHttp.open ("GET", "https://howsmyssl.com/a/check", False) $oHttp.Option(9) = 128 ; 128 - TLS 1.0, 512 - TLS 1.1, 2048 - TLS 1.2, 2056 - TLS 1.1 & TLS 1.2 $oHttp.Send ConsoleWrite($oHttp.responseText & @CRLF) ; at end of the respond you can check your TLS version. Mine is: {"tls_version":"TLS 1.0","rating":"Bad"} Error: $oHttp.Option works only with parameter 128 (TLS 1.0) other values make error {Bad parameter}
      Additional: I've done this tutorial about enabling TLS in registry: <link>
      Thanks for support.
      Ascer
    • islandspapand
      By islandspapand
      Hi All
      i am currently trying to add a function to my project that can send SMS, i have gone with Twilio for the sms service that use a REST API.
      I have never worked with an API before, and could use some help.
      I can get my function working with using cURL.exe and copy past command from the website with the following code. And thats great unfortunately i am have issue with character like æøå when sending a SMS appears like a box or ?. this does not happen if i do it from the website so it looks like a Unicode issue in curl.exe.
      I have done some searching on the forum and understand that i should be able to implement this curl command with the WinHTTP UDF from @trancexx so i don't need a third part exe and it might fix my charater issue.
      Unfortunately i really don't understand how i am to change curl commands to the WinHTTP and i was hoping some good maybe give me an example i could learn from.
      Thanks in advanced
      i have removed the AuthToken number from the script.
      _SendSMS("00000000","SomeOne","SMS body info") Func _SendSMS($SendTo,$SendFrom,$Msgtxt) $AccountSID = "ACbb765b3180d5938229eff8b8f63ed1bc" $AuthToken = "Auth Token number" $Data = '"https://api.twilio.com/2010-04-01/Accounts/'&$AccountSID&'/Messages.json"'& _ '-X POST \ --data-urlencode "To=+45'&$SendTo&'" \ --data-urlencode "From='&$SendFrom&'" \ --data-urlencode "Body='&$Msgtxt&'" \ -u '&$AccountSID&':'&$AuthToken&'' ShellExecute(@ScriptDir&"\curl.exe","-k "&$Data) ;~ curl 'https://api.twilio.com/2010-04-01/Accounts/ACbb765b3180d5938229eff8b8f63ed1bc/Messages.json' -X POST \ ;~ --data-urlencode 'To=+4500000000' \ ;~ --data-urlencode 'From=Reception' \ ;~ --data-urlencode 'Body=Test Body' \ ;~ -u ACbb765b3180d5938229eff8b8f63ed1bc:[AuthToken] EndFunc  
       
    • jesus40
      By jesus40
      Hello friends, i have a working curl command that show informations about my account on binance.com, but_it dont work with autoit code without curl.exe.
      I want to do it without curl, because the whole process much Slower_ with StdoutRead (I want get the response in variable.)
      My Curl command in Autoit:
      This 2 are works, but_ i would like to do it without curl.exe
      $apikey="XYZ" sCommand = @ScriptDir & '\curl.exe -k -H "X-MBX-APIKEY: ' & $apikey & '" -X GET "https://api.binance.com/api/v3/account?' & $request the same in .bat  file
      curl.exe -k -H "X-MBX-APIKEY: XYZ" -X GET "https://api.binance.com/api/v3/account?timestamp=1514917812000&signature=85bdee77e53cd521e1d5229fbfb459d53799c42b3fa4596d73f1520fad5f965a" (I use curl with -k option which allows curl to make insecure connections, because there is problem with the sites certificate, (cURL error 60))
       
      I tried many variations, this is the latest... I cant get the same response.
      curl $error message (I changed ): {"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."}
      autoit version $error message (Response code:400): Mandatory parameter 'timestamp' was not sent, was empty/null, or malformed.
       
      $request = $query & '&signature=' & $signature $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("GET", "https://api.binance.com/api/v3/account", False) $oHTTP.SetRequestHeader("X-MBX-APIKEY", $apikey) $oHTTP.Send($request) $oReceived = $oHTTP.ResponseText $oStatusCode = $oHTTP.Status If $oStatusCode <> 200 then MsgBox(4096, "Response code", $oStatusCode) EndIf  
      thanks
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.