Welcome, Guest! Registration RSS

Shehab Hacking And Cracking Articles

Thursday, 2024-04-25
Main » 2011 » December » 13 » Hack a Website using Directory Transversal Attack
5:41 PM
Hack a Website using Directory Transversal Attack
What is root directory of web server ?

It is a specific directory on server in which the web contents are placed and can be seen by website visitors. The directories other that root may contain any sensitive data which administrator do not want visitors to see. Everything accessible by visitor on a website is  placed in root directory. The visitor can not step out of root directory.

what does ../ or ..\ (dot dot slash) mean  ?

The ..\ instructs the system to go one directory up. For example, we are at this location C:\xx\yy\zz. On typing ..\ , we would reach at C:\xx\yy.

Again on typing ..\ , we would rech at C:\xx

Lets again go at location C:\xx\yy\zz. Now suppose we want to access a text file abc.txt placed in folder xx. We can type ..\..\abc.txt . Typing ..\ two times would take us two directories up (that is to directory xx) where abc.txt is placed.

Note : Its ..\ on windows and ../ on UNIX like operating syatem.

What is Directory Transversel attack?

Directory Traversal is an HTTP exploit which allows attackers to access restricted directories and execute commands outside of the web server's root directory.

The goal of this attack is  to access sensitive files placed on web server by stepping out of the root directory using dot dot slash .

The following example will make clear everything

Visit this website vulnerable to directory transversal attack

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

This webserver is running on UNIX like operating system. There is a directory 'etc' on unix/linux which contains configration files of programs that run on system. Some of the files are passwd,shadow,profile,sbin  placed in 'etc' directory.

The file etc/passwd contain the login names of users and even passwords too.

Lets try to access this file on webserver by stepping out of the root directory. Carefully See the position of directories placed on the webserver.

We do not know the actual names and contents of directories except 'etc' which is default name , So I have
marked them as A,B,C,E or whatever.

We are in directory in F accessing the webpages of website.


Lets type this in URL field and press enter

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

This will search the directory 'etc' in F. But obviously, there is nothing like this in F, so it will return nothing

Now type
http://www.chitkara.edu.in/chitkara/chitkarauniversity.php?page=../etc/passwd
Now this will step up one directory (to directory E ) and look for 'etc' but again it will return nothing.

Now type 

http://www.chitkara.edu.in/chitkara/chitkarauniversity.php?page=../../etc/passwd
Now this will step up two directories (to directory D ) and look for 'etc' but again it will return nothing.

So by proceeding like this, we we go for this URL
http://www.chitkara.edu.in/chitkara/chitkarauniversity.php?page=../../../../../etc/passwd

It takes us 5 directories up to the main drive and then to 'etc' directory and show us contents of 'passwd' file.
To understand the contents of 'passwd' file, visit http://www.cyberciti.biz/faq/understanding-etcpasswd-file-format


You can also view etc/profile ,etc/services and many others files like backup files which may contain sensitive data. Some files like etc/shadow may be not be accessible because they are accesible only by privileged users.

Note- If proc/self/environ would be accessible, you might upload a shell on server which is called as Local File Inclusion.
Views: 6137 | Added by: shehab3451 | Tags: UNIX, Hacking | Rating: 0.0/0
Total comments: 3
3 Seo-Ul-jap  
0
Мы компания профессиональных SEO-оптимизаторов, занимающихся увеличением посещаемости и рейтинга вашего сайта в поисковых системах.
Наша команда получили заметные достижения и предлагаем вам воспользоваться нашим опытом и знаниями.
Какие услуги мы предоставляем:
• <a href=https://seo-prodvizhenie-ulyanovsk1.ru/>аудит сео сайта</a>
• Глубокий анализ вашего сайта и формирование индивидуального плана продвижения.
• Оптимизация контента и технических параметров вашего сайта для лучших результатов.
• Постоянное отслеживание результатов и анализ вашего онлайн-присутствия с целью его совершенствования.
Подробнее <a href=https://seo-prodvizhenie-ulyanovsk1.ru/>https://seo-prodvizhenie-ulyanovsk1.ru/</a>
Наши клиенты уже видят результаты: увеличение трафика, улучшение рейтинга в поисковых системах и, конечно, увеличение прибыли. У нас вы можете получить бесплатную консультацию, для обсуждения ваших требований и разработки стратегии продвижения, соответствующей вашим целям и бюджету.
Не упустите возможность улучшить свой бизнес в онлайн-мире. Свяжитесь с нами сегодня же.

2 Bhoblhwhava  
0
I was really itching to tails of some wager some money on some sports matches that are happening fitting now. I wanted to say you guys be familiar with that I did spot what I weigh to be the a-one plat in the USA.
If you want to confound in on the engagement, verify it out-moded: <a href=https://pokeronline.guru/online-gambling/>https://pokeronline.guru/online-gambling/</a>

1 ppu-prof_bic  
0
Забота о недвижимости - это забота о радости. Термомодернизация фасадов - это не только модный облик, но и обеспечение теплового комфорта в вашем уголке уюта. Профессионалы, группа специалистов, предлагаем вам переделать ваш дом в идеальный уголок для проживания.
Наши работы - это не просто теплоизоляция, это художественная работа с каждым элементом. Мы нацелены на совершенному сочетанию между внешним видом и практической ценностью, чтобы ваш уголок стал не только теплым и стильным, но и изысканным.
И самое главное - доступные расценки! Мы верим, что высококачественные услуги не должны быть неприемлемо дорогими. <a href=https://ppu-prof.ru/>Утепление дома цена за квадратный метр работа</a> начинается всего по цене от 1250 рублей за квадрат.
Использование современных материалов и технологий позволяют нам создавать тепловую обработку, которая обеспечивает долговечность и надежность. Позабудьте о холоде стен и дополнительных затратах на отопление - наше утепление станет вашим надежным защитником от холода.
Подробнее на <a href=https://ppu-prof.ru/>https://ppu-prof.ru</a>
Не откладывайте на потом заботу о приятности в вашем доме. Обращайтесь к мастерам своего дела, и ваше жилье станет настоящим архитектурным искусством, которое согреет вас не только теплом. Вместе мы создадим дом, в котором вам будет по-настоящему комфортно!

Name *:
Email *:
Code *: