How to use tcpdump to be able to see http requests sent to the server?
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to use tcpdump to be able to see http requests sent to the server?
Hi All,
Is it possible using tcpdump to display roughly the urls, or POST or GET data. I've got this command so far:-
tcpdump src host [ipaddress] and dst port http -XX
As you can see it displays part of the nagios URL there... what i'm trying to do is find out what POST/GET/URL nagios executes form the nagios web management when say clicking on the button in nagios that disables notifications for a specific host and service, etc. so unless there is another way to find this out, i'm trying to find the data i need by dumping the packet data. But not sure how i can get all the packet data i need from it. I can see small amount of the request but not all of it?
Cheers,
MJ
EDIT:- Well obviously i can see the PHP code page when clicking on the submit button is sending a POST, but i can't see all the entire request?
Last edited by helptonewbie; 01-09-2009 at 06:20 AM.
Well it says right there that it was a POST to that uri... isn't that *exactly* what you want? I think a -v should make it prettier, printing some level of formal decode compared to a dump. In general wireshark is a better option for elegantly pulling stuff like that apart.
I've managed to get more data using the '-s' of tcpdump to not truncate output to 62 bytes as default but to capture whole packet. But this still didn't really give me the exact POST request that was sent. Perhaps i can't do what i want with this method?
Because at the end of the day i want to be able to in a script, run something like:-
curl --connect-timeout 4 --basic -u USER:PASSWORD http://NAGIOS/URL -d 'POST DATA'
To be able to start and stop notifications or checks using the nagios web page but via a script.
Last edited by helptonewbie; 01-09-2009 at 06:40 AM.
Something like a firefox extension may well be a simpler way to actually get the data in a useable form. plenty of developer extensions to track this sort of stuff.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.