0

我正在使用 pcap 库编写一个嗅探器程序来检查 http 流量。当我在寻找 GET 消息或状态码时我成功了,但我不知道为什么它不适用于发布请求。我尝试使用wireshark,发现对于POST请求,除了http协议之外,还有一个基于Line的文本数据:application/x-www-form-urlencoded "protocol"。当我尝试打印有效负载的内容时,我没有得到结果或者我得到奇怪的字符..所以我想问题可能是这个“基于行的..”的东西..知道可能的原因吗?

4

2 回答 2

1

The strange characters may be from utf-8 encoded as opposed to ascii encoded POSTs. It also depends which applications you are looking to capture, as some Flash apps use POST requests but encrypt them to prevent tampering.

于 2010-12-17T17:28:00.083 回答
0

编辑: 查看我对您其他问题的回答

这就是我使用 tcpdump 捕获的内容。你看到了什么?

POST /xml/crud/posttest.cgi HTTP/1.1
Host: www.snee.com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Fedora/3.6.12-1.fc13 Firefox/3.6.12
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://www.snee.com/xml/crud/posttest.html
Content-Type: application/x-www-form-urlencoded
Content-Length: 21

fname=test&lname=test
于 2010-12-17T19:02:53.243 回答