linux中用telnet如何构造get、post请求头报文
2014-04-04 13:00
453 查看
构造报文的方法应该很多,telnet、pyhon脚本、写代码,应该都行,但个人感觉telnet还是最简单的,哈哈!
在命令行下输入telnet 172.18.1.179 80
然后输入如下的报文头,直接回车发送即可
(如果没有telnet客户端,可以直接 apt-get install telnet-ssl 安装一个客户端工具 就可以了)
例1:
GET /index.html HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-powerpoint, application/vnd.ms-excel, */*
Accept-Language: zh-cn
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; InfoPath.2)
Accept-Encoding: gzip, deflate
Cookie: hidden=value; TestCookie=WAF_Cookie_Test; phpbot=hijklmn123; phpsessid=abcdefg
Host: 172.18.1.179
Connection: Keep-Alive
例2:
POST /index.html HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-powerpoint, application/vnd.ms-excel, */*
Accept-Language: zh-cn
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; InfoPath.2)
Accept-Encoding: gzip, deflate
Host: 172.18.1.179
Content-Length:20
Connection: Keep-Alive
Cache-Control: no-cache
fname=0123456789012345678&lname=aa
报文的内容也可以通过抓包工具获取比如http watch
在命令行下输入telnet 172.18.1.179 80
然后输入如下的报文头,直接回车发送即可
(如果没有telnet客户端,可以直接 apt-get install telnet-ssl 安装一个客户端工具 就可以了)
例1:
GET /index.html HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-powerpoint, application/vnd.ms-excel, */*
Accept-Language: zh-cn
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; InfoPath.2)
Accept-Encoding: gzip, deflate
Cookie: hidden=value; TestCookie=WAF_Cookie_Test; phpbot=hijklmn123; phpsessid=abcdefg
Host: 172.18.1.179
Connection: Keep-Alive
例2:
POST /index.html HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-powerpoint, application/vnd.ms-excel, */*
Accept-Language: zh-cn
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; InfoPath.2)
Accept-Encoding: gzip, deflate
Host: 172.18.1.179
Content-Length:20
Connection: Keep-Alive
Cache-Control: no-cache
fname=0123456789012345678&lname=aa
报文的内容也可以通过抓包工具获取比如http watch
相关文章推荐
- 客户端与服务端Post报文构造请求及Http Post与Get请求方法
- http以post方式上传一个文件,构造其请求头和消息报文
- 请求报文之GET请求报文和POST请求报文
- 如何使用SOCKET 发送HTTP1.1 GET POST请求包
- linux命令发送http的get或post请求(curl和wget两种方法)
- Get请求/Post请求与如何在Servlet中获取请求信息——day_07
- Linux 下curl模拟Http 的get or post请求
- xss的payload构造(cookie劫持和get\post请求进行操控浏览器)
- Java如何实现URL带请求参数(get/post)及得到get和post请求url和参数列表的方法
- get、post请求使用ab工具如何做并发测试
- HTTP请求响应报文&&相关状态码&&GET_POST请求方法
- PHP使用http_build_query()构造URL字符串的方法(可将POST参数组转换拼接成GET请求链接)
- spring boot 使用@RestController 和 @Controller 构造常见http get ,post请求例子
- java如何得到GET和POST请求URL和参数列表
- C++网络编程 如何使用SOCKET 发送HTTP1.1 GET POST请求包
- Linux下开发常用 模拟 Http get和post请求
- 如何使用SOCKET 发送HTTP1.1 GET POST请求包(转)
- 如何使用火狐浏览器的 live http headers调试http post get请求
- java如何得到GET和POST请求URL和参数列表
- java如何得到GET和POST请求URL和参数列表