Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL exploits for takeover #276

Open
SQLmapTester opened this issue Dec 4, 2012 · 3 comments
Open

MySQL exploits for takeover #276

SQLmapTester opened this issue Dec 4, 2012 · 3 comments

Comments

@SQLmapTester
Copy link

No description provided.

@stormwin
Copy link

stormwin commented Dec 4, 2012

I already wrote mail to Miroslav about that 2 days ago.
And the answer is:

Thank you for links. Skimmed through those. Will have it on my mind.

Kind regards,
Miroslav Stampar

@bdamele
Copy link
Member

bdamele commented Dec 4, 2012

http://1337day.com/exploit/19853 is a rudimentary version of what sqlmap has with regards to UDF injection since Sept 2009 (http://www.slideshare.net/inquis/expanding-the-control-over-the-operating-system-from-the-database). This technique is leveraged with --os-pwn and on Linux it does work only if the MySQL instance run as root because MySQL shared objects defining UDFs need to be in /usr/lib/mysql and this path is writable only by root. Nevertheless, on Windows it does work as MySQL runs as Local System hence the path for shared objects is writable.
The attached "0day" exploit is limited in functionality compared to the built-in in-memory execution of Metasploit alphanumeric-encoded payload that sqlmap has already.

I see the value of implementing http://1337day.com/exploit/19859 and eventually http://1337day.com/exploit/19852 within sqlmap.

The rest of PoC will eventually make their way as buffer overflow exploits in Metasploit, although not exploitable via SQL injection, but direct connection to the DBMS (corresponding -d switch in sqlmap).

@ghost ghost assigned bdamele Dec 4, 2012
@bdamele
Copy link
Member

bdamele commented Dec 6, 2012

Port of http://1337day.com/exploit/19859 to Metasploit: https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/windows/mysql/mysql_mof.rb

This can be ported to sqlmap, useful for OS takeover functionality when current user has FILE privilege (only), sweet so that it also works via SQLi too.

@bdamele bdamele changed the title My MySQL exploits for takeover Feb 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants