Local File Inclusion (LFI)

AKA: Directory Traversal

Local File Inclusion

LFI Likely:
http://$IP/dept/manage.php?notes=files/nineveh.txt

Testing:
http://$IP/dept/manage.php?notes=files/../../../../etc/passwd
http://$IP/dept/manage.php?notes=files/../../../../../../../etc/passwd
http://$IP/dept/manage.php?notes=/myNotes/../../../etc/passwd

Automation

Whoami Home SSH:

Code exe with 'environ'

  • If you have access to 'environ' - you might have code execution

  • Burp > Repeater > /proc/self/environ

Fuzzing LFI

RFI from LFI (php cookies)

  • If you can locate the 'session' cookies

  • You may be able to inject them into Burp Repeater to get an Execution

Directory Traversals

NULL BYTE

  • %00 ..URL-encoded

  • Adding a NULL BYTE will get rid of suffix (on older systems)

  • Works well in Perl and older versions of PHP (solved since 5.3.4)

  • Scenario: Server is adding .png automatically to your page

Netcat Tricks

Last updated

Was this helpful?