29.09.2015 Views

Legal Disclaimer

Hacking-For-Beginners-a-beginners-guide-for-learning-ethical-hacking

Hacking-For-Beginners-a-beginners-guide-for-learning-ethical-hacking

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Hacking For Beginners – Manthan Desai 2010<br />

Example of a directory traversal attack via web application code<br />

In order to perform a directory traversal attack, all an attacker needs is a web browser and some knowledge on where to<br />

blindly find any default files and directories on the system.<br />

The following example will make clear everything<br />

Visit this website vulnerable to directory transversal attack<br />

http://www.chitkara.edu.in/chitkara/chitkarauniversity.php?page=notification.php<br />

This web server is running on UNIX like operating system. There is a directory 'etc' on unix/linux which contains<br />

configuration files of programs that run on system. Some of the files are passwd, shadow, profile,sbin placed in 'etc'<br />

directory.<br />

The file etc/passwd contains the login names of users and even passwords too.<br />

Lets try to access this file on web server by stepping out of the root directory. Carefully see the position of directories<br />

placed on the web server.<br />

We do not know the actual names and contents of directories except 'etc' which is default name , So I have marked them<br />

as A,B,C,E or whatever.<br />

We are in directory in F accessing the web pages of website.<br />

Let’s type this in URL field and press enter<br />

http://www.chitkara.edu.in/chitkara/chitkarauniversity.php?page=etc/passwd<br />

This will search the directory 'etc' in F. But obviously, there is nothing like this in F, so it will return nothing now type<br />

http://www.chitkara.edu.in/chitkara/chitkarauniversity.php?page=../etc/passwd<br />

w w w . h a c k i n g t e c h . c o . t v Page 56

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!