Author Topic: Shell from SQLi??  (Read 1265 times)

0 Members and 1 Guest are viewing this topic.

Offline z3ro

  • Knight
  • **
  • Posts: 345
  • Cookies: 60
    • View Profile
Shell from SQLi??
« on: August 17, 2012, 05:25:04 pm »
Any way I could drop a shell on a server with SQLi??
~ God is real. Unless declared as an integer.

Offline NeX

  • Peasant
  • *
  • Posts: 74
  • Cookies: 5
    • View Profile
Re: Shell from SQLi??
« Reply #1 on: August 17, 2012, 09:31:24 pm »
Depends :P You can use INTO FILE for MySQL and there's a little trick for mssql to run cmd commands..

Offline ande

  • Owner
  • Titan
  • *
  • Posts: 2664
  • Cookies: 256
    • View Profile
Re: Shell from SQLi??
« Reply #2 on: August 18, 2012, 04:11:49 pm »
Like NeX said, yes there are ways of doing it. But from experience it almost never work. You are better of getting logins from the DB and try to upload a shell through some admin panel or something similar.
if($statement) { unless(!$statement) { // Very sure } }
https://evilzone.org/?hack=true

Offline relax

  • Sir
  • ***
  • Posts: 562
  • Cookies: 114
  • The one and only
    • View Profile
Re: Shell from SQLi??
« Reply #3 on: August 22, 2012, 01:33:44 am »
do you know the username and password to the mysql server?
if u do you could run
mysql -h [ip] -u [username] -p [password]
then in console
SELECT ('code') INTO OUTFILE "[PATH]";
or some variant of that. you can also check out
http://websec.wordpress.com/2007/11/17/mysql-into-outfile/

Offline z3ro

  • Knight
  • **
  • Posts: 345
  • Cookies: 60
    • View Profile
Re: Shell from SQLi??
« Reply #4 on: August 23, 2012, 05:08:04 pm »
do you know the username and password to the mysql server?
if u do you could run
mysql -h [ip] -u [username] -p [password]
then in console
SELECT ('code') INTO OUTFILE "[PATH]";
or some variant of that. you can also check out
http://websec.wordpress.com/2007/11/17/mysql-into-outfile/


hmm... i'm gonna take a look.. Thanks   ;)
~ God is real. Unless declared as an integer.