Open PyxYuYu opened 7 years ago
There is only one happiness in life, to love and be loved.
HTTP Server
Web
HTTP
IIS 5.X/6.0
.asp
.asa
IIS
http://www.xxx.com/xx.asp/xx.jpg
IIS 6.0
xx.asp;.jpg
xx.asp
http://www.xxx.com/xx.asp;.jpg
asp
asa
cer
cdx
IIS 7.0/IIS7.5/Nginx < 8.03
Fast-CGI
xx.jpg
php
http://www.xxx.com/xx.jpg/.php
Nginx < 8.03
Nginx 0.5, 0.6, 0.7 <= 0.7.65, 0.8 <= 0.8.37
http://www.xxx.com/xx.jpg%00.php
Apache
xx.php.owf.rar
rar
owf
http://www.xxx.com/xx.php.owf.rar
CVE-2013-4547 Nginx
http://www.xxx.com/xx.jpg (非编码空格) \0.php
.htaccess
<FilesMatch ".(jpg)$"> SetHandler application/x-httpd-php </FilesMatch>
jpg
Nginx
httpd.conf
Options Indexes FollowSymLinks
Options -Indexes FollowSymLinks
nginx.conf
WebServer
location /soft/ { root /var/www; 此处为soft的上一级目录 autoindex on; autoindex_exact_size off; autoindex_localtime on; }
[root@localhost Soft]#ps aux | grep -v grep | grep nginx | awk '{print $2}' | xargs kill -9 #结束进程 [root@localhost Soft]#nginx #启动进程
appcmd set config /section:directoryBrowse /enabled:false
Padding Oracle Attack
Padding Oracle
MS10-070
ASP.NET
Padding
IV
PadBuster.pl
Webconfig Bruter.pl
Padbuster.pl http://www.xxx.com/WebResource.axd?d=XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 16 -encoding 3 -plaintext "|||~/web.config"
XXXXXXXXXXXXXXXX
http://www.xxx.com/WebResource.axd?d=XXXXXXXXXXXXXXXX
d
16
8
encoding
0=Base64
1=Lower HEX
2=Upper HEX
3=.NET UrlToken
4=WebSafe Base64
plaintext
web.config
URL
Webconfig Bruter.pl http://www.xxx.com/ScriptResource.axd XXXXXXXXXXXXXXXX 16
Padbuster.pl
http://www.xxx.com/ScriptResource.axd?d=XXXXXXXXXXXXXXX
J2EE 架构配置
J2EE
SSH
Struts2
host
IP
xxx.com为公开站点,并且指向IP为公网网卡 admin.xxx.com为管理站点,并且指向内网网卡
admin.xxx.com
xxx.com ip 1.1.1.1 admin.xxx.com ip 10.0.0.1
hosts
1.1.1.1 admin.xxx.com
DNS
bind
zone
options
allow-transfer
key
vim /etc/named.conf #在options中添加 allow-transfer {192.168.5.6;};
vim /etc/named.rfc1912.zones #对应的zone中添加 allow-transfer {192.168.5.1;};
dig
dig @192.168.5.6 test.com axfr
nmap
nmap --script dns-zone-transfer --script-args dns-zone-transfer.domain=test.com -p 53 -Pn 192.168.5.6
Squid
http://ip/cgi-bin/cachemgr.cgi
squidclient -h ip -p port mgr:info
cachemgr.cgi
cgi
401
openssl
bash
shellshock
PHP-CGI
RCE
0x01 Drops Wiki
HTTP Server
Web
服务器因对HTTP
请求处理不当导致将非可执行的脚本、文件当作可执行的脚本、文件等执行,该漏洞一般配合服务器的文件上传功能使用,以获得服务器的权限IIS 5.X/6.0
解析漏洞.asp
、.asa
等可执行脚本文件后缀为后缀的文件夹,其目录内的任何扩展名的文件都被IIS
当作可执行文件来解析并执行IIS 6.0
下,分号后面的不被解析,也就是说在IIS 6.0
下,xx.asp;.jpg
将被当做xx.asp
解析并执行IIS 6.0
默认的可执行文件有asp
、asa
、cer
、cdx
四种IIS 7.0/IIS7.5/Nginx < 8.03
畸形解析漏洞Fast-CGI
开启状况下,访问以下网址,服务器将把xx.jpg
文件当做php
解析并执行Nginx < 8.03
空字节代码执行漏洞Nginx 0.5, 0.6, 0.7 <= 0.7.65, 0.8 <= 0.8.37
xx.jpg
文件当作php
解析并执行Apache
解析漏洞Apache
对文件解析是从右到左开始判断解析,如果文件的后缀为不可识别,就再往左判断,解析,如xx.php.owf.rar
,由于Apache
无法解析rar
和owf
后缀,但能够解析php
后缀,因此Apache
会将xx.php.owf.rar
当作php
格式的文件进行解析并执行xx.php.owf.rar
文件当作php
解析并执行CVE-2013-4547 Nginx
解析漏洞xx.jpg
文件当作php
解析并执行.htaccess
将任意文件作为可执行脚本解析Apache
中.htaccess
可被执行,且可被上传,那可尝试在.htaccess
中写入jpg
的文件当作可执行的php
脚本并执行Web
服务器版本或安装相应的官方补丁Web
服务器目录浏览的功能被开启时,若客户端浏览器在请求未指定文档名称且Web
服务器无法返回默认文档时便会启用目录浏览,显示一个列出目录内容的网页,或者当网站的代码存在缺陷,导致可以获取到服务器目录内容、结构,进而影响网站的敏感信息,威胁系统安全Web
服务器的配置引起的目录遍历IIS
和Nginx
默认不开启目录遍历的功能,而Apache
默认开启了目录遍历的功能Web
服务器目录遍历的功能被开启的时,若客户端浏览器在请求未指定文档名称且Web
服务器无法返回默认文档时,便会启用目录浏览,显示一个列出目录内容的网页Web
服务器配置引起的目录遍历Apache
禁止目录浏览httpd.conf
Options Indexes FollowSymLinks
改为Options -Indexes FollowSymLinks
Nginx
禁止目录浏览nginx.conf
, 找到WebServer
配置处2,删除类似内容Nginx
服务器即可IIS
禁止目录appcmd set config /section:directoryBrowse /enabled:false
Padding Oracle Attack
Padding Oracle
又名MS10-070
, 是ASP.NET
中由于加密填充验证过程中处理错误不当,导致存在一个信息泄漏漏洞,成功利用此漏洞的攻击者可以读取服务器加密的数据,例如视图状态,此漏洞还可以用于数据篡改,如果成功利用,可用于解密和篡改服务器加密的数据,虽然攻击者无法利用此漏洞来执行恶意攻击代码或直接提升他们的用户权限,但此漏洞可以用于信息搜集,这些信息可用于进一步攻击受影响的系统Padding Oracle
攻击中,攻击者只需要一个合法密文,即可通过不断向网站发送篡改过的密文,观察是否有Padding
异常错误提示,网站中的异常错误提示可能直接显示在网页当中,也可能只是HTTP
状态码,根据两个不同的HTTP
状态码做对比即可,而不需要其他任何详细信息,如果有异常错误提示即可不断地给网站提供密文,让解码程序出现错误提示,再而不断地修正,从而最终获得混淆之前的中间密文,拿到中间密文之后,可以通过构造IV
(初始化向量),使得中间密文被逆向混淆之后得到的明文为指定内容,从而达到攻击目的,在这过程中Padding Oracle
攻击并没有破解掉加密算法的密钥,也没有能力对任意密文做逆向解密,只是可以利用一个有效密文,生成一个解密后得到任意指定内容明文的伪造密文PadBuster.pl
和Webconfig Bruter.pl
XXXXXXXXXXXXXXXX
是http://www.xxx.com/WebResource.axd?d=XXXXXXXXXXXXXXXX
中参数d
的值,16
为每个数据块的字节数,分为8
和16
,encoding
参数有4中,分别是0=Base64
、1=Lower HEX
、2=Upper HEX
、3=.NET UrlToken
、4=WebSafe Base64
,plaintext
为想读取内容的文件,本次这里以web.config
为例,之后按程序提示进行操作,若网站存在Padding Oracle
漏洞,最终将返回web.config
的URL
的加密地址XXXXXXXXXXXXXXXX
为Padbuster.pl
得到的加密地址XXXXXXXXXXXXXXXX
为Webconfig Bruter.pl
得到的加密地址,服务器会返回目标文件的内容(此处为web.config
文件)J2EE 架构配置
J2EE
架构SSH
Struts2
host
绑定的不安全因素host
主机头绑定是很多网站常用的一种一机多站的实现方法,相对于使用不同端口来实现一机多站要安全许多,因为端口可以通过暴力手段找到,而host
绑定就要难破解很多,因为需要IP
和主机名的对应host
admin.xxx.com
必须在内网才能访问但是却忽略了host
绑定的问题,但是当我们将外网IP
地址强制绑定到admin.xxx.com
的时候Web
服务器又没有做来源检查,那么我们就可以通过外网访问到本来应该只有内网才能访问的管理站点,并且由于是内网站点,很多情况下管理员为了方便都是弱密码,或者直接未授权访问等IP
和内网IP
的域名全部记录下来IP
上,写入hosts
文件DNS
域传送漏洞bind
允许任何人来同步数据,所有的DNS
解析记录都会被泄漏,直接暴漏整体网络结构zone
、options
中添加allow-transfer
限制可以同步的服务器就可以了,可以有两种方式:限制IP
、使用key
认证IP
的方法dig
直接请求nmap
进行扫描Squid
Squid
代理服务器,未做任何验证,就可以使用,可以直接访问内网Squid
的一些基本信息cachemgr.cgi
泄漏的话,可以直接删除cgi
或者做一个401
认证openssl
)bash
漏洞(shellshock
)PHP-CGI
、RCE