Hack Forums
Read file with different permissions. - 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: Read file with different permissions. (/showthread.php?tid=4497478)



Read file with different permissions. - Jon Snow - Oct 19, 2014

i.php is my shell.
https://i.imgur.com/MP04Gvv.png

I want to read flag.php
https://i.imgur.com/7ttn4LU.png

How can I do that? If I try to access it directly, I get Permision denied (/flag.txt)!

Thanks a lot!


* - iHacker-n00b - Oct 19, 2014

Did You Try To Create Symlink or Hardlink?


* - Jon Snow - Oct 19, 2014

(Oct 19, 2014 08:39 AM)iHacker-n00b Wrote:  Did You Try To Create Symlink or Hardlink?

Just did and it doesn't work...
Any other ideas?


* - iHacker-n00b - Oct 20, 2014

(Oct 19, 2014 10:11 AM)Jon Snow Wrote:  Just did and it doesn't work...
Any other ideas?

Yea How about trying privilege escalation?? 🤭 http://www.exploit-db.com/exploits/33824/


* - Sky - Oct 20, 2014

You could try using this code;
PHP Code

<?
include /path/to/flag.txt;
?>

Then view the page source, I've used this trick to read a few config files before.

You could also try copying the contents to a new file;
PHP Code

<?
echo copy("flag.txt","flagnew.txt");
?>

~Sky 🤝