legend Posted January 23, 2013 Share Posted January 23, 2013 (edited) Hi. I have made a .htaccess file:AuthUserFile /home/fileprot/public_html/test/.htpasswd AuthType Basic AuthName "My Files" Require valid-userand in my .htpasswd the login is stored.It's a simple authentication.Does anyone knows how I would make a autoit script that authenticates with that login?(I need it all to authenticate silent, maybe winhttp can do it?) Edited January 23, 2013 by legend Link to comment Share on other sites More sharing options...
FireFox Posted January 23, 2013 Share Posted January 23, 2013 Hi,Does anyone knows how I would make a autoit script that authenticates with that login?Through what? To what purpose? Link to comment Share on other sites More sharing options...
legend Posted January 23, 2013 Author Share Posted January 23, 2013 (edited) I made a hardware authentication script, and I make only the script being able to get the content on the webhost, by using a custom user agent (htaccess) the problem is, you can just spoof the user agent, and then get access, therefor this could solve the problem, by storing the login in the compiled autoit script, and then making it authenticate if it's possible to do that hidden Edited January 23, 2013 by legend Link to comment Share on other sites More sharing options...
FireFox Posted January 23, 2013 Share Posted January 23, 2013 (edited) This should be quite easy with the WinHTTP UDF. Take a look at the _WinHttpSetCredentials function. Br, FireFox. Edited January 23, 2013 by FireFox Link to comment Share on other sites More sharing options...
legend Posted January 23, 2013 Author Share Posted January 23, 2013 ok, thanks Link to comment Share on other sites More sharing options...
legend Posted January 23, 2013 Author Share Posted January 23, 2013 I tried this: #include ;========================> $hInternet = _WinHttpOpen() $hConnect = _WinHttpConnect($hInternet, "site.net/test") $hRequest = _WinHttpOpenRequest($hConnect, "GET", "/") If _WinHttpSetCredentials($hRequest, $WINHTTP_AUTH_TARGET_SERVER, $WINHTTP_AUTH_SCHEME_BASIC, "testuser", "testpass") = 0 Then MsgBox(16, "Fehler", "_WinHttpSetCredentials ist fehlgeschlagen. Errorcode: " & @error) EndIf _WinHttpSendRequest($hRequest) If @error Then MsgBox(16, "Error", ",..") _WinHttpReceiveResponse($hRequest) $sRead = "" Do $sRead &= _WinHttpReadData($hRequest) until @error InetGet("http://www.site.net/test/test.txt", @scriptdir & "\test.txt") but didn't work Link to comment Share on other sites More sharing options...
JohnOne Posted January 23, 2013 Share Posted January 23, 2013 try InetGet("http://username:password@www.site.net/test/test.txt", @scriptdir & "test.txt") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
legend Posted January 23, 2013 Author Share Posted January 23, 2013 works! thanks alot Link to comment Share on other sites More sharing options...
legend Posted January 23, 2013 Author Share Posted January 23, 2013 (edited) edit: picture removed Edited January 23, 2013 by legend Link to comment Share on other sites More sharing options...
JohnOne Posted January 23, 2013 Share Posted January 23, 2013 (edited) I don't think it's wise to be hinting to people here, how to do that sort of thing.But an answer is to use ssl. Edited January 23, 2013 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
legend Posted January 23, 2013 Author Share Posted January 23, 2013 removed the picture, do you know if it would be more secure to use https? Link to comment Share on other sites More sharing options...
JohnOne Posted January 23, 2013 Share Posted January 23, 2013 edited post above. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 23, 2013 Moderators Share Posted January 23, 2013 legend,Two things:- 1. Please read the Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing log-in and security dialogs - before you post again.- 2. Your use of a "password sniffer" was reported before you edited your posts and I have seen the images. Not something we want to see here - do not do it again.As a result - thread locked. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts