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 - 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 08-02-2004, 12:32 AM   #1
subt13
LQ Newbie
 
Registered: Aug 2004
Posts: 12

Rep: Reputation: 0
Portsentry working or not working?


Hi


I am running Gentoo 2.6 kernel, with latest iptables and portsentry. I have setup portsentry exactly as the man page said and it doesn't work. I have used port scan tests from grc.com and from other hosts, and portsentry is not blocking them. Here is a sniplet of what /etc/portsentry/portsentry.history shouts about:


1090017851 - 07/16/2004 16:44:11 Host: pcp02820079pcs.lwrswt01.pa.comcast.net/68.85.240.218 Port: 10000 TCP Blocked
1090018696 - 07/16/2004 16:58:16 Host: scan.sygate.com/207.33.111.37 Port: 21 UDP Blocked
1090025286 - 07/16/2004 18:48:06 Host: proxyscan.freenode.net/82.96.96.3 Port: 10000 TCP Blocked
1091323222 - 07/31/2004 19:20:22 Host: shieldsup.grc.com/204.1.226.228 Port: 0 TCP Blocked

This is from the portsentry.conf:
KILL_ROUTE="/usr/local/bin/iptables -I INPUT -s $TARGET$ -j DROP"
that is suppose to take the above lines and block them I had to changed iptables to be /sbin/iptables because thats where it is for me.
It is running in tcp udp mode.

Any help would be appreciated.
 
Old 08-02-2004, 12:41 AM   #2
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
I think you can configure it to also use /etc/hosts.deny This works good. But I'm not sure why it's not creating the IPTABLE rule.
 
Old 08-02-2004, 12:59 AM   #3
subt13
LQ Newbie
 
Registered: Aug 2004
Posts: 12

Original Poster
Rep: Reputation: 0
KILL_ROUTE="/bin/echo $TARGET$ >> /etc/hosts.deny"
is what I put in the config file. Is that right?
I scanned again from grc.com and it didn't block it .

help!; 0
 
Old 08-02-2004, 01:03 AM   #4
subt13
LQ Newbie
 
Registered: Aug 2004
Posts: 12

Original Poster
Rep: Reputation: 0
it looked like it added
ALL: 207.33.111.37 : DENY
ALL: 82.96.96.3 : DENY
ALL: 204.1.226.228 : DENY
to /etc/hosts.deny
but no action has been taken when I rerun the scan
 
Old 08-02-2004, 01:13 AM   #5
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
I have:

blah blah'

IGNORE_FILE="/etc/portsentry/portsentry.ignore"
HISTORY_FILE="/etc/portsentry/portsentry.history"
BLOCKED_FILE="/etc/portsentry/portsentry.blocked"
RESOLVE_HOST = "1"
BLOCK_UDP="1"
BLOCK_TCP="1"
KILL_ROUTE="/sbin/iptables -I INPUT -s $TARGET$ -j DROP"
KILL_HOSTS_DENY="ALL: $TARGET$"
SCAN_TRIGGER="0"

Seems to work great.
 
Old 08-02-2004, 01:14 AM   #6
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
Quote:
Originally posted by subt13
but no action has been taken when I rerun the scan
Odd'
 
Old 08-02-2004, 01:16 AM   #7
subt13
LQ Newbie
 
Registered: Aug 2004
Posts: 12

Original Poster
Rep: Reputation: 0
That is the exact configuration on my box.... *sniff*
 
Old 08-02-2004, 10:24 AM   #8
subt13
LQ Newbie
 
Registered: Aug 2004
Posts: 12

Original Poster
Rep: Reputation: 0
This is cut from /var/log/messages
so I know its started correctly and is binding to each port that I set.
Does anyone know what I should do?
Aug 2 00:01:46 athlon postfix/qmgr[3162]: BCA781608038: removed
Aug 2 00:01:54 athlon portsentry[3035]: securityalert: PortSentry is shutting down
Aug 2 00:01:54 athlon portsentry[3035]: adminalert: PortSentry is shutting down
Aug 2 00:01:54 athlon portsentry[3037]: securityalert: PortSentry is shutting d
 
Old 08-02-2004, 02:15 PM   #9
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
Are those the only messages from portsentry? try:
cat /var/log/messages | grep portsentry
 
Old 08-02-2004, 02:37 PM   #10
subt13
LQ Newbie
 
Registered: Aug 2004
Posts: 12

Original Poster
Rep: Reputation: 0
Aug 2 13:22:55 athlon portsentry[3038]: securityalert: PortSentry is shutting d
own
Aug 2 13:22:55 athlon portsentry[3038]: adminalert: PortSentry is shutting down
Aug 2 13:22:55 athlon portsentry[3040]: securityalert: PortSentry is shutting d
own
Aug 2 13:22:55 athlon portsentry[3040]: adminalert: PortSentry is shutting down
Aug 2 13:22:56 athlon portsentry[8867]: adminalert: PortSentry 1.2 is starting.
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 1
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 7
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 9
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 69
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 161
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 162
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 513
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 635
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 640
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 641
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 700
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 37444
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 34555
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 31335
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 32770
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 32771
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 32772
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 32773
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 32774
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 31337
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: Going into listen mode on U
DP port: 54321
Aug 2 13:22:56 athlon portsentry[8868]: adminalert: PortSentry is now active an
d listening.
Aug 2 13:22:56 athlon portsentry[8869]: adminalert: PortSentry 1.2 is starting.
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 1
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 11
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 15
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 79
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 111
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 119
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 143
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 540
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 635
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 1080
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 1524
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 2000
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 5742
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 6667
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 12345
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 12346
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 20034
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 27665
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 31337
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 32771
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 32772
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 32773
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 32774
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 40421
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 49724
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: Going into listen mode on T
CP port: 54320
Aug 2 13:22:56 athlon portsentry[8870]: adminalert: PortSentry is now active an
d listening.

Thats what shows. it appears to work perfectly.
For now I made a script using snort that will add everything it finds in the /var/log/snort directory to iptables (a sorry sub.)
 
Old 08-02-2004, 03:34 PM   #11
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
Hum. I don't know. You do have two portsentry processes running right? One for udp and another for tcp
 
Old 08-02-2004, 11:33 PM   #12
subt13
LQ Newbie
 
Registered: Aug 2004
Posts: 12

Original Poster
Rep: Reputation: 0
Well I believe so... in /etc/conf.d/portsentry there is a line telling it to use "tcp udp" mode and since the log said it started ok... ya ;0
 
Old 08-02-2004, 11:35 PM   #13
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
Check it out with:

ps waux | grep portsentry
 
Old 08-03-2004, 12:21 AM   #14
subt13
LQ Newbie
 
Registered: Aug 2004
Posts: 12

Original Poster
Rep: Reputation: 0
root 3068 0.0 0.0 1356 476 ? Ss 14:00 0:00 /usr/bin/portsentry -udp
root 3070 0.0 0.0 1356 492 ? Ss 14:00 0:00 /usr/bin/portsentry -tcp
rjw 10415 0.0 0.1 1408 516 pts/2 S+ 23:08 0:00 grep portsentry
 
  


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
After Online update: Hard drive working and working dacosta SUSE / openSUSE 6 11-06-2004 12:14 AM
F1 - F10 not working when F13 - F20 working in Linux haivinay Linux - General 0 09-20-2004 07:31 AM
F3-F10 is not working when F13-F20 is working in redht-8. haivinay Linux - General 0 09-20-2004 06:39 AM
how to change notification email for portsentry and how to test portsentry roorings Linux - Security 1 11-04-2003 10:36 AM
cannot download files in mozilla -save dialog not working, galeon not working cmisip Linux - General 0 08-03-2003 03:25 PM

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

All times are GMT -5. The time now is 07:42 AM.

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