一些網絡分析工具的使用(Wireshark,Fiddler)

Wireshark


Wireshark


I was composing a http request with cURL in PHP, posting username and password to a user authentication url to get a token, which is actually exactly what users do to log onto a website. But I got stuck in a 401 error, I was told 'unauthorized' all the time even I was pretty sure I had typed in the correct user-name & password, which I could sign in with, but failed to do that with PHP.


So, this is where I need Wireshark. And what I did was to log into my site from browser, say, Chrome, and with Wireshark monitoring and recording the network traffic; and then do the same request from PHP.


Now, I have captured the two HTTP requests, one of which is successful, the other is a failure. And compare them in details, then, field by field. Like demonstrated as following:



As shown, the difference of HTTP fields were highlighted on the right, which were absent in the HTTP request from my PHP script, and that is the reason I was looking for.


How to do that?





How to set capture filter based on ip addresses of hosts:




In case you dont know how to look up the ip address of a domain name:


How to filter by ip address





How to pick the packets out with protocol being TLSv1.2:



You can find out the version number by inspecting the detail of one package:




Fiddler


Fiddler






If you would like to create a POST request with data, just as if you are submitting data through a web form, then you must add the string:Content-Type: application/x-www-form-urlencoded.


You can refer to Send POST request to asp.net mvc action via Fiddler



评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值