LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-14-2006, 08:36 PM   #1
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Rep: Reputation: 30
Labrea


I'm costantly under DOS bombing on netbios ports from windows pcs in my isps network .I tought running a software like labrea but some of his options still look obscure to me !I would like to hear from people using it for advices !
Thanks !
 
Old 05-14-2006, 10:30 PM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
If you run labrea, you could very well make the problem worse if it's a real DoS attack (from the info in your other thread it's not). LaBrea will help to slow the progress of a worm when moving through a network, but it puts more load on the Tarpit system itself because it has to maintain the open connections with the worm infected host.

Plus, if I remember correctly from your other thread, you have a Netgear SOHO router that is between the linux box and the internet. So the linux box is not likely even seeing the worm scan on ports 135/445. You'd need to forward the worm traffic into your LAN in order for the Tarpit to work (otherwise the router simply blocks the requests). IMHO forwarding malicious traffic into the LAN is probably an even worse idea in terms of security and the Netgear router would now have to maintain the NATed tarpitted connections.
 
Old 05-15-2006, 12:04 AM   #3
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Original Poster
Rep: Reputation: 30
Logs are coming from both the router and portsentry on the gateway system :

Quote:
May 3 21:36:28 argo portsentry[2437]: attackalert: Host 87.7.30.249 has been blocked via dropped route using command: "/sbin/route add -host 87.7.30.249 gw 192.168.0.3"
May 3 21:47:24 argo portsentry[2437]: attackalert: Connect from host: 80.218.134.76/80.218.134.76 to TCP port: 139
May 3 21:47:24 argo portsentry[2437]: attackalert: Host 80.218.134.76 has been blocked via wrappers with string: "ALL: 80.218.134.76 : DENY"
May 3 21:47:24 argo portsentry[2437]: attackalert: Host 80.218.134.76 has been blocked via dropped route using command: "/sbin/route add -host 80.218.134.76 gw 192.168.0.3"
May 3 21:47:24 argo portsentry[2437]: attackalert: Connect from host: 80.218.134.76/80.218.134.76 to TCP port: 139
May 3 21:47:24 argo portsentry[2437]: attackalert: Host 80.218.134.76 has been blocked via wrappers with string: "ALL: 80.218.134.76 : DENY"
May 3 21:47:24 argo portsentry[2437]: attackalert: Host 80.218.134.76 has been blocked via dropped route using command: "/sbin/route add -host 80.218.134.76 gw 192.168.0.3"
May 3 21:47:25 argo portsentry[2441]: attackalert: Connect from host: 80.218.134.76/80.218.134.76 to UDP port: 137
May 3 21:47:25 argo portsentry[2441]: attackalert: Host 80.218.134.76 has been blocked via wrappers with string: "ALL: 80.218.134.76 : DENY"
May 3 21:47:25 argo portsentry[2441]: attackalert: Host 80.218.134.76 has been blocked via dropped route using command: "/sbin/route add -host 80.218.134.76 gw 192.168.0.3"
May 3 21:47:25 argo portsentry[2441]: attackalert: Connect from host: 80.218.134.76/80.218.134.76 to UDP port: 137
May 3 21:47:25 argo portsentry[2441]: attackalert: Host 80.218.134.76 has been blocked via wrappers with string: "ALL: 80.218.134.76 : DENY"
May 3 21:47:25 argo portsentry[2441]: attackalert: Host 80.218.134.76 has been blocked via dropped route using command: "/sbin/route add -host 80.218.134.76 gw 192.168.0.3"
May 3 21:47:27 argo portsentry[2441]: attackalert: Connect from host: 80.218.134.76/80.218.134.76 to UDP port: 137
May 3 21:47:27 argo portsentry[2441]: attackalert: Host: 80.218.134.76 is already blocked. Ignoring
May 3 21:47:27 argo portsentry[2441]: attackalert: Connect from host: 80.218.134.76/80.218.134.76 to UDP port: 137
May 3 21:47:27 argo portsentry[2441]: attackalert: Host: 80.218.134.76 is already blocked. Ignoring
May 3 21:48:28 argo portsentry[2437]: attackalert: Connect from host: 87.7.193.124/87.7.193.124 to TCP port: 139
May 3 21:48:28 argo portsentry[2437]: attackalert: Host 87.7.193.124 has been blocked via wrappers with string: "ALL: 87.7.193.124 : DENY"
May 3 21:48:28 argo portsentry[2437]: attackalert: Host 87.7.193.124 has been blocked via dropped route using command: "/sbin/route add -host 87.7.193.124 gw 192.168.0.3"
May 3 21:48:28 argo portsentry[2437]: attackalert: Connect from host: 87.7.193.124/87.7.193.124 to TCP port: 139
I know i can tarpit this systems even with a proper tcp window size set to 0 with iptables do you know how i can best do this ??

Last edited by gabsik; 05-15-2006 at 12:08 AM.
 
Old 05-18-2006, 06:10 PM   #4
thorn168
Member
 
Registered: Oct 2004
Location: USA
Distribution: Vector Linux 5.1 Std., Vector Linux 5.8 Std., Win2k, XP, OS X (10.4 & 10.5)
Posts: 344

Rep: Reputation: 42
If Capt_Caveman says that using Tarpit to solve you problem is a "bad idea" then I would trust him because in your case its a "bad idea".

It is a "bad idea" why? Because if you trap ALL the DDoS requests with a tarpit...you are going to eat up your own bandwidth and hasten the success of the attack against you.

What you should do is create an IPtable rule that drops/denies all requests on the attacked port.

Or you could call your ISP and ask them if they are seeing an unusual amount of traffic from the offending IP addresses.
 
Old 05-18-2006, 07:05 PM   #5
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Original Poster
Rep: Reputation: 30
For the moment i have this for my iptables:
Quote:
$IPT -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.0.2 -s 87.0.0.0/255.0.0.0 -j ULOG --ulog-prefix "BLACK_LIST:"
$IPT -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.0.2 -s 87.0.0.0/255.0.0.0 -j DROP
$IPT -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.0.2 -s 82.0.0.0/255.0.0.0 -j ULOG --ulog-prefix "BLACK_LIST:"
$IPT -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.0.2 -s 82.0.0.0/255.0.0.0 -j DROP
$IPT -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.0.2 -s 212.0.0.0/255.0.0.0 -j ULOG --ulog-prefix "BLACK_LIST:"
$IPT -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.0.2 -s 212.0.0.0/255.0.0.0 -j DROP
$IPT -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.0.2 -s 89.0.0.0/255.0.0.0 -j ULOG --ulog-prefix "BLACK_LIST:"
$IPT -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.0.2 -s 89.0.0.0/255.0.0.0 -j DROP
$IPT -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.0.2 -s 62.0.0.0/255.0.0.0 -j ULOG --ulog-prefix "BLACK_LIST:"
$IPT -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.0.2 -s 62.0.0.0/255.0.0.0 -j DROP
$IPT -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.0.2 -s 151.0.0.0/255.0.0.0 -j ULOG --ulog-prefix "BLACK_LIST:"
$IPT -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.0.2 -s 151.0.0.0/255.0.0.0 -j DROP
I'm stopping the entire class A of each address , i have logs full of 87.10 87.1 87.9 151.40 151.6 i nmaped "some of them" and many of them have the 1234 netbus port open but most 135,137,139,445 all -O Microsoft-XP Windows2000Nt ... they switch my router off and mynetwork goes down !!!
 
Old 05-18-2006, 08:06 PM   #6
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
What do you have the KILL_ROUTE variable set to in portsentry.conf ? What hosts do you have in your portsentry.ignore file?

You might want to add some type of threshold on the number of packets that will match the LOG rules you posted above. Worms can do some heavy-duty scanning, which would rapidly fill your logs with alot of noise and potentially bog it down.

Also, could you describe how your network is structured? Does it look like this:
Internet---Linux_Gateway----Router----Linux box

Last edited by Capt_Caveman; 05-18-2006 at 08:08 PM.
 
Old 05-18-2006, 08:20 PM   #7
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Original Poster
Rep: Reputation: 30
Quote:
KILL_ROUTE="/sbin/route add $TARGET$ 192.168.0.4"
192.168.0.4 is the laptop it's not always on before there was microsoft.it but never tested out the effect ,how would it be?a simple redirection ... ?
For the logs yu are right i have my router sending to syslogd + portsentry logs + gateway ULOG + iptables' kernel logs it's sh... lots of logs ...
Quote:
[netgearDG834]---[Gatewayfirewall-linux]--switch---[www]-[mail]
Do you have some interesting scripts to use "against" tell me about the ack reply window size set to 0!Something to sort of slow down their scans ... or make their admins aware ... !
If there is a :
iptables -A bad_tcp_packets -p tcp --tcp-flags SYN,ACK SYN,ACK \
-m state --state NEW -j REJECT --reject-with tcp-reset
could they get "bombed" by tcp-reset messages ?If insted use tcp flags match like ALL NONE (?) could i slow them .... make them shout !!!!

Last edited by gabsik; 05-18-2006 at 08:39 PM.
 
  


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
LaBrea/libnet/libpcap compile woes hoffswell Linux - Newbie 0 03-10-2003 12:48 PM

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

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