LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-28-2015, 12:30 AM   #1
gaurav_s
Member
 
Registered: Jul 2014
Posts: 43

Rep: Reputation: Disabled
Capture packets and tomcat server header information


I am using tcpdump command to retrieve tomcat server header information.
I am executing wget command from remote node.
node1:-

wget -S http://XXX.XXX.XXX.XXX:8093

node2:-

tcpdump -f "tcp src port 8093" -s0 -w /tmp/tomcat11.pcap


node2 is running tomcat server on port 8093

i am opening tomcat11.pcap in wireshark but i am not able to find server information i.e Apache Tomcat X.X .
 
Old 05-28-2015, 02:40 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,854

Rep: Reputation: 161Reputation: 161
It might be in HTTP header.
 
Old 05-28-2015, 11:57 PM   #3
gaurav_s
Member
 
Registered: Jul 2014
Posts: 43

Original Poster
Rep: Reputation: Disabled
There are no http headers present in Wireshark. I amusing http.response as filter.
 
Old 05-29-2015, 12:08 AM   #4
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,902

Rep: Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052
I googled it with search terms "tcpdump for tomcat" and found:

http://blog.2partsmagic.com/2011/01/...-http-headers/

Google is your friend!
 
Old 05-29-2015, 01:29 AM   #5
gaurav_s
Member
 
Registered: Jul 2014
Posts: 43

Original Poster
Rep: Reputation: Disabled
Now, i am able to get GET request ,but i want to see POST .
 
Old 05-29-2015, 02:55 PM   #6
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,854

Rep: Reputation: 161Reputation: 161
Just capture port 8093 instead of src port 8093. You should see both direction packet.
 
Old 06-01-2015, 12:45 AM   #7
gaurav_s
Member
 
Registered: Jul 2014
Posts: 43

Original Poster
Rep: Reputation: Disabled
Still i am not getting POST data.I guess with wget command i can't get POST data.
 
Old 06-01-2015, 09:28 AM   #8
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,902

Rep: Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052
Look at the man page of wget and you will see that you need to pass specific options to wget to execute a HTTP POST.
 
Old 06-01-2015, 02:38 PM   #9
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,854

Rep: Reputation: 161Reputation: 161
Tool, wget, only use get request to download information. The put request is uploading information.
One tool, CURL, can do anyway you want, such as GET, POST, DELETE and so on.
http://curl.haxx.se/
 
Old 06-02-2015, 06:37 PM   #10
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,902

Rep: Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052
Capture packets and tomcat server header information

Good point about curl. I was not thinking in terms of receiving data , rather submitting data to a service.

The curl command will do what you need.
 
Old 06-07-2015, 05:07 PM   #11
joec@home
Member
 
Registered: Sep 2009
Location: Galveston Tx
Posts: 291

Rep: Reputation: 70
Been a while, but looking through my old notes I used to prefer to search by IP address to get a larger scope of data. Try playing around with the different flags, removing and adding different flags to check for different results, switching between the IP address of both the sender and the receiver. Also try switching between "0" and "1500" in the -s flag. Just print to screen at first while you fine tune then start grabbing to a file.

tcpdump -x -v -s 1500 host 12.34.56.78 -l -n
 
Old 06-07-2015, 05:28 PM   #12
joec@home
Member
 
Registered: Sep 2009
Location: Galveston Tx
Posts: 291

Rep: Reputation: 70
Another thing you might try is to run a tail on the module being used by tomcat to get a psudo'ish strace.

tail -f /proc/(PID of Tomcat)/map_files/(module being called by tomcat) | od -a

Different od flags for translation:

From
http://unixhelp.ed.ac.uk/CGI/man-cgi?od

-a same as -t a, select named characters
-b same as -t o1, select octal bytes
-c same as -t c, select ASCII characters or backslash escapes
-d same as -t u2, select unsigned decimal 2-byte units
-f same as -t fF, select floats
-i same as -t dI, select decimal ints
-l same as -t dL, select decimal longs
-o same as -t o2, select octal 2-byte units
-s same as -t d2, select decimal 2-byte units
-x same as -t x2, select hexadecimal 2-byte units
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding Http tomcat server information. gaurav_s Linux - Software 3 05-27-2015 12:02 PM
Capture, drop packets using C pumpkin Linux - Networking 12 03-14-2012 04:36 AM
Capture my ICMP packets manolakis Linux - Networking 4 11-12-2009 08:29 PM
can anyone help me to capture IEEE80211 packets faribah Linux - Wireless Networking 1 07-02-2009 10:11 AM
Is there a way to capture outgoing packets only? homer_3 Linux - Networking 1 06-11-2009 11:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration