Jump to content
Sign in to follow this  
legend

.htaccess and .htpasswd

Recommended Posts

legend

Hi. I have made a .htaccess file:

AuthUserFile /home/fileprot/public_html/test/.htpasswd
AuthType Basic
AuthName "My Files"
Require valid-user

and 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?

Posted Image

(I need it all to authenticate silent, maybe winhttp can do it?)

Edited by legend

Share this post


Link to post
Share on other sites
FireFox

Hi,

Does anyone knows how I would make a autoit script that authenticates with that login?

Through what? To what purpose?

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
legend

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 by legend

Share this post


Link to post
Share on other sites
FireFox

This should be quite easy with the WinHTTP UDF. Take a look at the _WinHttpSetCredentials function.

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
legend

ok, thanks :)

Share this post


Link to post
Share on other sites
legend

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

Share this post


Link to post
Share on other sites
legend

works! :D thanks alot :)

Share this post


Link to post
Share on other sites
legend

edit: picture removed

Edited by legend

Share this post


Link to post
Share on other sites
legend

removed the picture, do you know if it would be more secure to use https?

Share this post


Link to post
Share on other sites
Melba23

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. :naughty:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×