01101: Web Hacking
By: CainWell, I'm back. I should have put this article out last month, but I neglected to. Flames to /dev/null. Well anyway, you know how sometimes when you connect to a web page, you are asked for a username and password? Well, here's how that works. In a directory there is a file almost always called .htpasswd. And in another directory(or possibly that same one) there is a file called .htaccess. The .htpasswd file follows basically the same format as the /etc/passwd file:
jblow:F#.DG*m38d%RF
cain:GJA54j.3g9#$@f
and the .htaccess file follows this format:
AuthUserFile /path/to/.htpasswd
<LIMIT GET PUT POST>
require user <user>
</LIMIT>
If there is an .htaccess file in a directory, you must have a valid username and password to view any files in that directory.
So here is what happens, the httpd sees the .htaccess file in the directory that you request a file from. It finds the location of the .htpasswd file and then find out who has access to the files in the directory. Therefore you must have a username and password. Well here's the bug: Only the files in the directory with the .htaccess file are passworded. So if the .htpasswd file is somewhere else(root directory maybe) then you can read that file. It uses the same form as /etc/passwd so therefore password crackers will work on this also. Insta hack if the webmaster doesn't know what s/he's doing.
jblow:F#.DG*m38d%RF
cain:GJA54j.3g9#$@f
and the .htaccess file follows this format:
AuthUserFile /path/to/.htpasswd
<LIMIT GET PUT POST>
require user <user>
</LIMIT>
If there is an .htaccess file in a directory, you must have a valid username and password to view any files in that directory.
So here is what happens, the httpd sees the .htaccess file in the directory that you request a file from. It finds the location of the .htpasswd file and then find out who has access to the files in the directory. Therefore you must have a username and password. Well here's the bug: Only the files in the directory with the .htaccess file are passworded. So if the .htpasswd file is somewhere else(root directory maybe) then you can read that file. It uses the same form as /etc/passwd so therefore password crackers will work on this also. Insta hack if the webmaster doesn't know what s/he's doing.
Back Next
























