AutoHotkey Community

It is currently May 27th, 2012, 8:12 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 228 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10, 11, 12 ... 16  Next
Author Message
 Post subject:
PostPosted: December 1st, 2011, 6:38 pm 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
You don't give much information about what's going on. When HTTPRequest encounters a problem, it usually gives some sort of hint in the output headers.

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2011, 1:24 am 
Offline

Joined: December 7th, 2005, 8:29 am
Posts: 345
How can i provide this info I am using HTTPS so the packets are encrypted?

_________________
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2011, 2:12 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
The third parameter, called inout_HEADERS, is used for the request headers and the response headers and error messages. You don't need to sniff packets at all.

After you encounter an error, what text is inside the variable you passed as the third parameter?

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 4th, 2011, 10:19 am 
Offline

Joined: December 7th, 2005, 8:29 am
Posts: 345
[VxE] wrote:
The third parameter, called inout_HEADERS, is used for the request headers and the response headers and error messages. You don't need to sniff packets at all.

After you encounter an error, what text is inside the variable you passed as the third parameter?


Sorry, I missed that :roll:

Here is the error from the inout_HEADERS:
Image


****UPDATE****


I have found that the error above is security related (ERROR_INTERNET_SEC_CERT_REV_FAILED - Security Revocation List Check)

I have found a way around it quoted from an internet post:
Quote:
This errors means that WinInet (Microsoft Internet layer) cannot check Certificate Revocation List (CRL) because it cannot connect to a
server that hosts that list. Checking CRL online is not strictly necessary, so you can turn it off.
Go into IE -> Tools -> Internet Options -> Advanced -> Security and uncheck 'Check for Server Certificate Revocation'.



I am trying to set a flag to disable this check by code and not through "Internet Explorer" by using a flag callled "SECURITY_FLAG_IGNORE_REVOCATION".

I added this flag like this "+SECURITY_FLAG_IGNORE_REVOCATION" in the options section where I have the codepage option, But its not working.
Still the same error.

I don't want to disable this flag in all of the internet explorers in our company I want to do it by code.

Can you please Help?

_________________
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2011, 4:11 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
Security flags are not manipulated like other internet flags, they require an additional call to InternetSetOption. A few posts ago, I tried to help another user tweak some security flags... unsuccessfully. If you're feeling brave, take a look at where 'InternetSetOption' is commented out in the HTTPRequest source and play with it.

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2011, 9:04 am 
Offline

Joined: December 7th, 2005, 8:29 am
Posts: 345
[VxE] wrote:
Security flags are not manipulated like other internet flags, they require an additional call to InternetSetOption. A few posts ago, I tried to help another user tweak some security flags... unsuccessfully. If you're feeling brave, take a look at where 'InternetSetOption' is commented out in the HTTPRequest source and play with it.


Thank you It WORKED!

Can you please elaborate about the way security flags are being handled, Why can't we add them in the options section of the function?

Maybe we can add a fifth parameter to the function that if he is used the commented part will be available?

One more this can you please put a version number in the file so we can track the changes :P

[VxE] You ROCK!

_________________
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 8th, 2011, 11:52 am 
Offline

Joined: December 7th, 2005, 8:29 am
Posts: 345
Hi,

I just added the security flag option into the function:
HTTPRequest_Sec

The following flag are supported:
Quote:
SECURITY_FLAG_128BIT=0x20000000
SECURITY_FLAG_40BIT=0x10000000
SECURITY_FLAG_56BIT=0x40000000
SECURITY_FLAG_FORTEZZA=0x08000000
SECURITY_FLAG_IETFSSL4=0x20
SECURITY_FLAG_IGNORE_CERT_CN_INVALID=0x1000
SECURITY_FLAG_IGNORE_CERT_DATE_INVALID=0x2000
SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTP=0x8000
SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTPS=0x4000
SECURITY_FLAG_IGNORE_REVOCATION=0x80
SECURITY_FLAG_IGNORE_UNKNOWN_CA=0x100
SECURITY_FLAG_IGNORE_WRONG_USAGE=0x200
SECURITY_FLAG_NORMALBITNESS=0x10000000
SECURITY_FLAG_SECURE=0x1
SECURITY_FLAG_STRENGTH_MEDIUM=0x40000000
SECURITY_FLAG_STRENGTH_STRONG=0x20000000
SECURITY_FLAG_STRENGTH_WEAK=0x10000000
SECURITY_FLAG_UNKNOWNBIT=0x80000000


You can use them by providing a comma separated line as the 5th parameter like this:
Quote:
size := HTTPRequest(API_EndPoint, Response_Data:=POSTData, Response_Headers:=Headers, My_Options, "SECURITY_FLAG_IGNORE_REVOCATION,SECURITY_FLAG_IGNORE_UNKNOWN")


I added a fifth parameter to the function called security_flags.

I added the security flags and values in lines 176-195.

Also added the security flag handling section using your commented code in lines 531-558.

In the last section there a lot of msgboxes detailing the conversion process.

Not too much error handling like you did and as pretty :D but it works.

Hope someone find it useful.

_________________
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: IPV6 Support/Issue?
PostPosted: January 5th, 2012, 9:33 pm 
Offline

Joined: October 19th, 2011, 10:11 pm
Posts: 5
I haven't had a chance to test out the security flag option, but i'm looking forward to it! Thanks for your work with that.

I am back with another issue, hopefully you guys could help me out again. This time it's IPV6. I'm attempting to send post data to log into a device, but I'm returning ErrorLevel = 0, A_LastError = 12019 for an invalid URL. I suspect it has to do with the IPV6 URL, as I can manually log into this device with no issues, and fiddler is also throwing errors in the headers stating they end in LFLF, and not CRLFLF.

Dealing with these new devices that support IPV6 has been a pain, but it looks like it's the way things will be going from here on out. Due to sensitive info I cannot provide any example devices without being fired and or having my fingers removed. Any advice or ideas are welcome – Thanks again.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 6th, 2012, 4:04 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
Thx twhyman, the next release of HTTPRequest will support security flags.

@ m3nth0l: it looks like IE versions less than 7 don't support IPv6 (WinINet.dll is at the core of both HTTPRequest and internet explorer). One of the changes in the next release of HTTPRequest is swapping out InternetCrackUrl for a string-based parse because InternetCrackUrl has a length limit of about 2060 characters in the url. I'll be sure to parses bracketed IP literals correctly.

Other changes include general stabilization and streamlining, more consistent output and the 'outputfile' option is rephrased.

Thanks all for your patience.

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 6th, 2012, 9:18 am 
Offline

Joined: December 7th, 2005, 8:29 am
Posts: 345
[VxE] wrote:
Thx twhyman, the next release of HTTPRequest will support security flags.

@ m3nth0l: it looks like IE versions less than 7 don't support IPv6 (WinINet.dll is at the core of both HTTPRequest and internet explorer). One of the changes in the next release of HTTPRequest is swapping out InternetCrackUrl for a string-based parse because InternetCrackUrl has a length limit of about 2060 characters in the url. I'll be sure to parses bracketed IP literals correctly.

Other changes include general stabilization and streamlining, more consistent output and the 'outputfile' option is rephrased.

Thanks all for your patience.



Looking forward for the next release, Please add version numbers :D

Thank you for your hard work.

_________________
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 6th, 2012, 6:28 pm 
Offline

Joined: October 19th, 2011, 10:11 pm
Posts: 5
[VxE] wrote:
Thx twhyman, the next release of HTTPRequest will support security flags.

@ m3nth0l: it looks like IE versions less than 7 don't support IPv6 (WinINet.dll is at the core of both HTTPRequest and internet explorer). One of the changes in the next release of HTTPRequest is swapping out InternetCrackUrl for a string-based parse because InternetCrackUrl has a length limit of about 2060 characters in the url. I'll be sure to parses bracketed IP literals correctly.

Other changes include general stabilization and streamlining, more consistent output and the 'outputfile' option is rephrased.

Thanks all for your patience.


Thanks for the info! I can't wait for the next version :D Thanks for all the hard work. It is extremely appreciated!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 9th, 2012, 9:20 am 
Offline

Joined: February 19th, 2010, 6:11 pm
Posts: 150
Location: California
Hey [VxE],
Love HTTPRequest, I am having one problem though. When I submit the following POST. For some reason the body is not sent correctly. When I intercept the message using burp suite i see box characters in between every character in the body. If I alter the body from within burp back to what it should be, the POST would work correctly and I would get back the desired page. But altering the message inside burp isn't exactly a solution. After much investigation I found that this problem does not arise in the 32 bit ansi version of AutoHotkey_L but in the 32 bit unicode version. I am not sure what that exactly means, but I am sure you do. If there is a solution I am eager to hear it and I await your response.

OS: Windows 7 Home Premium 64x bit
AHK: AutoHotkey_L Unicode 32x bit Version:1.1.05.06

Image from burp:
Image

Code:
URL :=         "http://www.autohotkey.com/search/search.php"
HEADERS :=      "Content-Type: application/x-www-form-urlencoded; Charset=utf-8"
BODY :=      "site=4&path=docs/%&query_string=test"
OPTIONS :=      "+INTERNET_FLAG_NO_COOKIES`nProxy: LocalHost:8080"
;  Note the proxy is set to LocalHost:8080 so i could use burp to intercept it.

HTTPRequest( URL, BODY, HEADERS, OPTIONS )


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 9th, 2012, 10:35 am 
Quote:
I found that this problem does not arise in the 32 bit ansi version of AutoHotkey_L but in the 32 bit unicode version. I am not sure what that exactly means,
you are on the right track. please inform yourself what Unicode and ANSI is, then you'll understand.
basicly you need to send the body as ANSI-encoded string, what is no problem with the ANSI-version of AHK, of coarse.
the Unicode-version uses obviously Unicode-encoding.
Unicode uses 2 bytes per Character, ANSI 1 byte.

so you'll need StrPut() on Unicode-versions.


Report this post
Top
  
Reply with quote  
 Post subject: kookster_UnAuth
PostPosted: January 10th, 2012, 12:20 am 
So I tried the following code and many other combinations and it still did not work. Any help would be much appreciated.

Code:
URL :=         "http://www.autohotkey.com/search/search.php"
HEADERS :=      "Content-Type: application/x-www-form-urlencoded; Charset=utf-8"
BODY :=      "site=4&path=docs/%&query_string=test"
OPTIONS :=      "+INTERNET_FLAG_NO_COOKIES`nProxy: LocalHost:8080"

if A_IsUnicode
   _dataSize := StrPutVar(@BODY, @BODY, "CP0")
HTTPRequest( URL, BODY, HEADERS, OPTIONS )
Return

[/code]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 10th, 2012, 12:22 am 
So I tried adding different encodings but it still wouldnt work. Any help as to what I should put before the HTTPRequest would be greatly appreciated.
Code:
if A_IsUnicode
   _dataSize := StrPutVar(BODY, BODY, "CP0")


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 228 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10, 11, 12 ... 16  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 13 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group