LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 04-18-2004, 01:59 AM   #1
blacky777
LQ Newbie
 
Registered: Apr 2004
Posts: 3

Rep: Reputation: 0
Help Parsing Log files


Hello, I am looking for advice on how to parse my log files. I want to get the IPAddresses and the ports their scanning. I dont quite understand GREP or SED enough on how to parse the various IP and Port Numbers in Linux.

Anyone Advice?


Thanks
 
Old 04-18-2004, 04:14 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I am looking for advice on how to parse my log files.
What logfiles? Portscanning usually means a group of ports covered over a period of time by one or multiple IP addresses. Manual correllation will be tedious and prolly errorprone. If you want to see a lot of interesting details use Snort's portscan detection, else search Freshmeat for something simple like PSAD, ippl or portsentry.
 
Old 04-18-2004, 01:57 PM   #3
blacky777
LQ Newbie
 
Registered: Apr 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Just my message logfiles. I see hits from certain IP Addresses and wanted to filter them down to their IP Address and What Port their Sniffing For.
 
Old 04-18-2004, 03:55 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well yes so you need to use a text processing language / app like grep or sed or perl or awk to do this... off the top of my head i couldn't guess what your log files look like.....
 
Old 04-18-2004, 04:14 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Check out tools like Fwlogwatch.
 
Old 04-20-2004, 07:49 AM   #6
vladdy2004
LQ Newbie
 
Registered: Apr 2004
Distribution: Red Hat And 9 E-Smith
Posts: 11

Rep: Reputation: 0
How would one Grep for just the IP Addresses?
 
Old 04-21-2004, 01:06 PM   #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
How would one Grep for just the IP Addresses?
Should show the remote IP and local destination port for all of today's incoming traffic destined for this box:
d=$(date '+%b %e'); ipaddr=$(hostname -i)
grep /var/log/messages -ie "${d}.*kernel:.*DST=$ipaddr"\
|tr -s " "|cut -d " " -f 10,18|sed -e "s/D..=//g"
 
  


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
Log Parsing Program For Breezy seattlegeek Ubuntu 1 10-28-2005 10:41 AM
Apache-ssl not correctly parsing php files jme Linux - Software 2 05-03-2005 12:04 PM
Parsing config files unholy Programming 5 09-18-2004 03:59 PM
parsing log files jstu Linux - General 4 06-10-2003 07:26 PM
Can log files be time stamped? (such as FTP login and transfer log files) bripage Linux - Networking 6 08-08-2002 10:55 PM

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

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