LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 12-13-2002, 09:44 PM   #1
urhackking
LQ Newbie
 
Registered: Dec 2002
Posts: 4

Rep: Reputation: 0
TCPDUMP -- how to monitor traffic between one machine in My LAN and one website.


Hi All,
I have LAN of 12 machines, all are running redhat linux with private IP adresses in 192.168.1. series. This Lan is connected to public Internet through router which have a static public IP.

Now, I want to monitor all the traffic from one particular machine in LAN to one particular website. But I want to monitor the traffic using my system only but the traffic that originates from one particular machine(192.168.1.10) to www.google.com
Assume that my machine IP address is 192.168.1.5.

How can I make use of "tcpdump" utility for this purpose.
Can any one give the exact syntax of the "tcpdump" command for the above purpose.( I gave all the ip addresses and website name).

Thanks in advance.

Daniel
 
Old 12-14-2002, 03:01 AM   #2
Grim Reaper
Member
 
Registered: Apr 2002
Distribution: Gentoo 2006.0 AMD64
Posts: 399

Rep: Reputation: 30
I'm not entirely sure if you can do that...i was looking for the exact same thing and i searched tmpdump's man pages but couldn't find anything....AFAIK, what you can do is route all traffic from that machine through yours, and then use tcpdump to monitor the traffic as its going through you...
But it would be good if there was a way to just sniff the network from your machine...?
 
Old 12-14-2002, 02:12 PM   #3
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
The good news, you can listen to anything on a lan segment...

Once the NIC is in "promiscuous mode" it stops ignoring packets not destined for itself..
eg "arpwatch" will place a card in this mode...

A quick Google search for "promiscuous mode" threw up a lot of useful reading...
 
Old 12-14-2002, 04:00 PM   #4
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
yes you can do it

tcpdump | grep 192.168.0.25 | grep linuxquestions.org > /var/log/192.168.0.25-linuxquestions

cat /var/log/192.168.0.25-linuxquestions
tcpdump: listening on eth0
21:58:19.252247 192.168.0.25.32796 > linuxquestions.org.http: P 3019032012:3019032816(804) ack 3039838404 win 6432 <nop,nop,timestamp 3576334 76774486> (DF)
21:58:19.252414 linuxquestions.org.http > 192.168.0.25.32796: . ack 804 win 8040 <nop,nop,timestamp 76786926 3576334> (DF)
21:58:19.641067 linuxquestions.org.http > 192.168.0.25.32796: . 1:1449(1448) ack 804 win 8040 <nop,nop,timestamp 76787126 3576334> (DF)
21:58:19.641104 linuxquestions.org.http > 192.168.0.25.32796: P 1449:1493(44) ack 804 win 8040 <nop,nop,timestamp 76787126 3576334> (DF)
 
Old 12-15-2002, 01:03 AM   #5
Grim Reaper
Member
 
Registered: Apr 2002
Distribution: Gentoo 2006.0 AMD64
Posts: 399

Rep: Reputation: 30
sweet, ill have to try that after...

seeings as tcpdump grabs every packet header...is there something that will grab the entire packet? or will this be a 3rd party program/script that needs to be installed?

I've never seen any entire packets being sent/recieved before (only the headers that tcpdump shows), shall be interesting
 
Old 12-15-2002, 03:27 AM   #6
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
try something like tcpdump -s 0 -xX -vvv
 
Old 12-16-2002, 09:16 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Btw, using tcpdump tcpdump | grep 192.168.0.25 | grep linuxquestions.org can also be done with a BPF filter:
tcpdump <args> -w <filename> 'host 192.168.0.25 and host linuxquestions.org' or if you already have a full dump: tcpdump <args> -r <tcp.dump> -w <filename> 'host 192.168.0.25 and host linuxquestions.org'. So the answer to your original question using BPF could be: tcpdump <args> 'src 192.168.1.10 and dst 216.239.53.98'.

*If you're seeing zilch on a switched LAN, then (if you own the LAN/have permission) you could try ettercap or another MITM/MAC flood tool.
 
Old 12-16-2002, 10:11 PM   #8
urhackking
LQ Newbie
 
Registered: Dec 2002
Posts: 4

Original Poster
Rep: Reputation: 0
robb,
can you tell me how to keep NIC in promiscuous mode
 
Old 12-16-2002, 10:58 PM   #9
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
tcpdump will do it


or use


ifconfig eth0 promisc

Last edited by DavidPhillips; 12-17-2002 at 12:52 AM.
 
  


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
WebSite Traffic essoft478 General 10 12-09-2004 05:16 PM
How to use tcpdump to monitor traffic of a TCP connection sajsal Linux - Networking 0 03-05-2004 04:11 AM
Wireless traffic stomps isdn traffic on gateway machine Radix999 Linux - Wireless Networking 0 11-14-2003 12:54 AM
TCPDUMP -- how to monitor traffic between one machine in My LAN and one website. urhackking Linux - Software 1 12-14-2002 03:05 PM
TCPDUMP -- how to monitor traffic between one machine in My LAN and one website. urhackking Linux - Networking 2 12-14-2002 02:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:59 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