TCP/IP Connection Cutting On Linux Firewalls 233
Chris Lowth writes "Network security administrators sometimes need to be able to abort TCP/IP connections routed over their firewalls on demand. This would allow them to terminate connections such as SSH tunnels or VPNs left in place by employees over night, abort hacker attacks when they are detected, stop high bandwidth consuming downloads - etc. There are many potential applications.
This article describes how a Linux IPTables based firewall/router can be used to send the right combination of TCP/IP packets to both ends of a connection to cause them to abort the conversation. It describes the steps required to perform this task, and introduces a new open-source utility called 'cutter' that automates the process."
Would be handy (Score:5, Interesting)
Re:Would be handy (Score:5, Insightful)
However, given that a hell of a lot of places run 24/7, when woudl you propose running said script in their cases?
Re:Would be handy (Score:2)
For that matter, losing a connection is generally not that big a deal, and tends to happen anyway. If something is actually attended, the person will notice and restart it without losing much.
Re:Would be handy (Score:2)
Just because Joe sixpack has gone home for the evening, does NOt mean his session should be killed - he (in our case) is quite probably running stuff even while he is away.
Now, you might want to limit operations to 33% of the maximum available time, but for sites which require 24/7 operation, that is a very bad idea.
Re:Would be handy (Score:2)
How many boxes run underground warez servers w/o the user even knowing? "Gee, /my machine/the net/ seems to be a bit slow today?"
Re:Would be handy (Score:4, Insightful)
Re:Would be handy (Score:3, Insightful)
I agree 100%. But it does happen, and this is one of the /ways/tools/ to help sniff them out. More importantly, now Joe Sixpack can be educated to /log out/shut down/ when he leaves, instead of saying "what harm can it do to /leave my machine on all the time/run all sorts of downloaders while I'm home/". Any connection to his machine that comes in after all tcp/ip connections are cut will be ob
Re:Would be handy (Score:2)
*become* visible to the outside world.
there are trojans, such as windows xp, which
can be triggered by a web page, to connect
to a remote system, and thereby create a tunnel
into your network. it happens every day.
Re:Would be handy (Score:3, Insightful)
Depends on who you talk to, but nah, can't take too much credit for that
Ordinary desktops don't, and they should be logging out completely, as a habit. If they also learn to shut down properly at the end of every day, they could also help save the environment (less electricity, less heating, so less cooling required, so less electricity again
Re:fuckwit? I don't think so. (Score:5, Insightful)
Oh, come on, you can have your web server and ftp server up 24/7, and terminating connections twice every day isn't going to have much effect on legit users, unless you're hosting isos, in which case they'll just have to restart their ftp client and resume from where they left off.
the web server can be shut down and restarted every hour with no effect on users - http is, after all, a connectionless protocol, and on todays machines, it only takes 3 to 4 seconds to shut down and restart apache.
Also, with the newer high-latency DDOoS attacks, this would be a good way to stop them :-)
Just because you don't see the utility of something like this right off doesn't mean there is no use, or that it can't be adapted to certain situations.
Re:fuckwit? I don't think so. (Score:2)
I suppose it depends on application.
Re:fuckwit? I don't think so. (Score:5, Interesting)
Re:Would be handy (Score:5, Interesting)
Re:Would be handy (Score:5, Interesting)
Re:Would be handy (Score:2)
Re:Would be handy (Score:2)
" To limit contributition to the problem the fuse should disconnect the shool/small ISP giving the IT staff time to examine the fault offline."
That's very disruptive. The IT staff may be on callout (eg spend an hour to get there), part-ti
Re:Would be handy (Score:5, Interesting)
Re:Would be handy (Score:2, Interesting)
Re:Would be handy (Score:2)
Re:Would be handy (Score:2, Funny)
It will do nothing for your uplink though.
I'd guess that in most instances of the slashdot attack, line saturation is your biggest factor.
Re:Would be handy (Score:2)
<quote>
</quote>Sounds like bittorrent to me. Man, does it saturate your uplink or what!
That would be great (Score:5, Funny)
I always wanted to work 9 to 5 like the executives
Re:That would be great (Score:2)
That's just great. If that's what the poster intended, it sounds almost completely useless.
If I can just reconnect, the script kiddy will too.
This looks worse than simple logging.
Re:That would be great (Score:2)
Or, better yet, you would have a new outboud connection showing up in the logs from a machine that nobody is using, on which there are no cron jobs running (at least none authorized) and which is not suposed to be connected at that time.
It's not supposed to be a one-shot solution - just another tool in our swiss army knife :-)
Re:That would be great (Score:2)
If you just want to drop all tcp connections there are much easier ways to do this.
Also, if you find unknown connections in a log file for that time frame you are so worried about, it's real easy to get more information on them.
A script that uses cutter to terminate all connections will be slow, presents no new security, and serves to really screw up my day if
Don't get me wrong, cutter is a good tool. It's just not the ri
Re:That would be great (Score:2)
why would /usr fill up at any time. /usr/local, maybe, if you have users installing stuff on the server (which they shouldn't be - they should be sticking the stuff on their own machines).
maybe you meant /home? If that fills up, that's a different story, but then again, if that fills up, it may be an indication that you re
Re:Would be handy (Score:2)
Re:Would be handy (Score:2)
And on my box it would be suspicious activity - I'm not running debian.
Seriously, I don't do automatic updates, and I don't allow the other boxes to, either. Maybe I miss out on some of the latest and greatest, but I also know exactly what is supposed to be on each box. If I want an update shoved onto the other machines, I'll host it off a
Re:Would be handy (Score:2, Flamebait)
Re:Would be handy (Score:5, Insightful)
If the box is running only the minimum of services, only allows incoming connections that are established & related, doesn't allow connections from a blacklist of known bad ip blocks, etc., and has someone checking the logs on a regular basis, requires external access through a second box, doesn't have a bunch of /virus-laden internal machines/windows boxes/ on the internal network to serve as zombies for internal attacks (went through that once, all the sales reps lost their windows boxes, cd-roms and floppy drives the same day. They bitched for a while, but they got used to linux) :-), what's the problem?
Re:Would be handy (Score:2)
Sucks to be you, then, doesn't it?
Poster wrote: For one, in my company, we are a computer school, so we are required by Microsoft to use only Microsoft software for all vital business functions with the exception of classes which specifically require non-Microsoft software. If we fail in this we will have our licenses for teaching Microsoft curriculum pulled.
Why not
Re:Would be handy (Score:2)
Re:Would be handy (Score:3, Insightful)
The fact is that a properly configured linux machine is a pretty damn good firewall that is as good or better than many commercial firewalls.
If you are a fortune 500 type company it's not really appropriate, but for many of the millions of smaller businesses out there, it's just fine.
Re:Would be handy (Score:2, Insightful)
Upon what do you base this conclusion? I guess ignorance. We are the second largest DSL telco in the Benelux countries, and we use redundant Linux firewalls to protect important pieces of our network, such as places where our DNS and radius servers live.
This doesn't scare me at all, actually I like the setup better with regards to availability, maintainabili
Re:Would be handy (Score:2)
Well, I am reluctant these days to put a Linux box out on the Internet, protected only by iptables.
Do yourself a favor, and check OpenBSD's pf if you want to see something much better. It is very powerful and flexible. Configuration files are way smaller too, which makes it easier to verify that they are correct.
Oh yeah, and it uses a configuration file. Which is nice, because I can put in comments. None of the state-saving, can't really edit it stuff.
I need to run Linux for many things, becau
great (Score:5, Insightful)
Re:great (Score:5, Interesting)
Just a thought, really.
Re:great (Score:3, Insightful)
I can (and indeed, HAVE to) VPN in from absolutely anywhere I happen to be if Things Go Wrong with systems. So do my peers around the world.
We could be required to connect from anywhere at any time. So how do you list all those "safe" IPs? They have to onclude hotels, Kiosks, internet cafes, etc al. Which kinda makes your "safe" list completely pointless.
Re:great (Score:2)
Re:great (Score:5, Insightful)
The actual killing of connections, now, THAT is a useful tool where your intrusion detection has detected an active intrusion (or intrusion attempt). But that's not what was being discussed in this subthread
Re:great (Score:2)
- Current Bandwidth utilization (like the bar on kernel.org)
- Data transfered in total
- Data transfered since last reboot
- Data transfered in the previous (rolling) 24 hours
- The above 3 stats on a per IP address basis
Re:great (Score:2, Informative)
As for the bar on kernel.org, just click on it [kernel.org] for the source. Dang kernel.org has been slower than balls for me lately.
Re:great (Score:3, Insightful)
It gets so bad with IT and uber security, having urls with *trans* aka translate blocked by the web proxy software, blocking ftp (sorry mr vendor, you cant get this 100meg core file on your ftp site), etc.
If it gets any worse, i'll use my wireless modem in my laptop and route around IT.
Re:great (Score:2)
Re:great (Score:2)
Of course, your prob breaking every company security policy.
VPN (Score:3, Insightful)
Re:great (Score:2)
I live 15 minutes drive from work.
I dunno about you, but I much prefer rolling out of bed, logging on, fixing problem and rolling back to bed over getting out of bed, getting dressed, spending 30 - 60 minutes round trip driving,. fixing problem, getting undressed and rolling back into bed
Re:great (Score:2)
(2) You mean you are unable to remotely reboot your systrems? For real? Then you need to get a proper sysadmin and configure things up properly. I woudl hate to be admining our Norwegian servers (which I also do) and have to catch a flight just to be able to reboot them...
Re:great (Score:2)
The elusive second step solved!
Well, that kills that. (Score:5, Funny)
Oh, I remember this (Score:2, Funny)
I also like ice cream.
I have an even better idea: (Score:3, Funny)
Don´t you... (Score:2)
Re:I have an even better idea: (Score:2)
Sure you can -- you just need that robot arm thingy [slashdot.org].
Google Cache of post, and a quick comment (Score:5, Informative)
This is a great idea that someone should have come up with a long time ago. I also like how the author took into consideration the security conserns of such a cutter.
Google cache (Score:5, Informative)
NO They weren't slashdotted... (Score:5, Funny)
For Aol Users (Score:3, Funny)
Evil bit comes to the rescue! (Score:5, Funny)
Then simply enable a filter to drop those packets during off hours or peak usage.
And people thought that was a joke!
But what about UDP tunnels? (Score:5, Informative)
Re:But what about UDP tunnels? (Score:3, Informative)
Each UDP packet is seperate.
Just block the incoming UDP packets. The stream will just stop.
If you just block a TCP connecting _from being established_, this rule will not effect currently established connections, and that is what this tool is for.
nice first step (Score:5, Interesting)
This would be the ultimate-awesome tool for a netadmin. couple this with cutter and you have a great way of managing that traffic!
Re:nice first step (Score:2)
The way Open Source works is if someone wants something, they write it themselves, perhaps using other Open Source things as a base. Saying "give me X feature" rarely results in it happening.
Re:nice first step (Score:5, Interesting)
Re:nice first step (Score:2)
Re:nice first step (Score:2)
iptstate does that (not the traffic volume, though) on a Linux NAT firewall. It actually shows you everything the netfilter connection tracking stuff is keeping track of, so it's useful on any stateful firewall, not just NAT.
Also, try ipband [sf.net], iftop, or iptraf.
Useful (Score:2, Insightful)
It the cutter tool itself the news here? (Score:2, Informative)
Thought that was builtin?? (Score:2, Insightful)
Tm
How to announce software on /. (Score:5, Funny)
1) Go to SourceForge [sf.net].
2) Register a project; upload files
3) Post link to SourceForge page on
4) ???
5) Profit
How not to announce software on
1) Upload software to your web server behind a T1
2) Post link to
4) ???
5) Cry over the money you just wasted.
--Quentin
Gee, (Score:2, Informative)
I just don't see the point.
Golden days at my company (Score:5, Funny)
My old boss used to use bandwidth hogs as an excuse to cause users pain. We would track the inflated traffic down to hub port level, he would pull the plug and wait. After maybe 2 minutes always came the phone call from some frustrated user saying that his/her Internet was not working. Over the 12 times we did this EVERY time the phone call came from the abuser and not ONCE was he/she downloading anything work related.
The company has grown since then and those old tricks would get you fired nowadays. Ahhh, the days when IT ruled with an iron fist. Now there this newfangled notion of "service" in the department, how wierd is that?
Re:Golden days at my company (Score:2)
I too remember those days when a sysadmin (me) could use a 'special' DHCP lease as a LART because some $(LUSER) kept opening virus infected e-mails.
Anyhoo, disconnecting connections on the local network is ieasy. Just spoof the server endpoint and send some RST's to the connection origin you want to kill. That should stop any connection made quite easily. At least, that's how I stopped network connections originating from the LAN I used to administer. Great lart too. My hacked up version that
Re:Golden days at my company (Score:2)
There used to be a student that came to work part time as a secretary in one of the companies buildings. She used to model when she was younger and now she was in university.
The building was just across the street and yet we had no comfortable way of moving equipment between the two. On days that she was working, half the staff would suddenly feel like carrying 5 new 17 inch monitors across to the other building no question asked;
"Hi there, I've just carried this immensely heavy object a long dista
Can of Cron and a Script? (Score:3, Insightful)
Why do you need to ask either side of a tcp connection to abort? Shouldn't the fact that the connection is lost be enough?
If you're trying to stop large downloads run a usage tracking app to a database and temporarily block the IP. Geez.
I, like many people here, develop software. But I have to say, in this case, is this really needed? It just seems like it would be just another thing to test, configure, manage and keep up to date.
Re:Can of Cron and a Script? (Score:2)
Without terminating the connection (just dropping packets), it becomes entirely encumbent upon the application to have appropriate timeout code for those situations. There is no guarantee that the app has timeout code, or the timeout could be length
sniffit (Score:5, Informative)
As far as tools, I know of at least one that has been around since 97, "sniffit". It show connections in real time (like ethereal today) and has a hot key for resetting a connection.
Re:sniffit (Score:3, Informative)
Sniffit (or the tool it used - tcpkill I think) was using the FIN method though, because if my memory does not fail me, the error message you'd get on either end was "Connection closed by foreign host". I think the RST method would show a different error, probably "Connection reset".
No need for cutter (Score:4, Funny)
tcpkill (Score:5, Interesting)
Re:tcpkill (Score:3, Interesting)
Re:tcpkill (Score:5, Informative)
Easy to hack around! (Score:3, Interesting)
If I getting disconnected was really bugging me, I'm sure changing a few lines of the TCP stack code, and a quick (rather lengthy) recompile would yeild two inevitable outcomes:
1. Less frustration from disconnects!
2. The same (or larger) security hole than before!
Fantastic!!!
Re:Easy to hack around! (Score:2)
I liked this util better the first time... (Score:2, Interesting)
http://www.phrack.org/show.php?p=50&a=6
-Ben
Re:I liked this util better the first time... (Score:2)
Tools of the Trade (Score:2)
An idea (Score:3, Insightful)
My ISP is using this already (Score:4, Funny)
Generic Tools? (Score:2, Interesting)
Re:Generic Tools? (Score:2)
Somebody can come and flame me down if I'm wrong, I've never had much need to mangle packets myself, and all the things that do I don't need to mess with anyways.
Re:Generic Tools? (Score:2)
Re:Generic Tools? (Score:2, Informative)
Injecting packets into the connection (Score:5, Informative)
Connection tracking is a wonderful thing, and if you can flush out certain connections, this project wouldn't be necessary at at. Instead, there's no mechanism for aborting connections other than by injecting packets into a connection and getting both sides to abort.
This is probably a bad idea as well as RST packets don't have to be acknowledged (that's why they're RST, and not FIN). I might be completely wrong here, but this most likely leaves the connection in the tracking table alone to timeout on its own (which according to
And speaking of the timeouts, there are no sysctl adjustments possible. If you want to change the timeouts, you'd have to edit the kernel source and recompile. How's that for a giant pain?
Don't get me wrong, I like plenty of things about Netfilter/Iptables. But it's not "enterprise ready" yet.
Re:Injecting packets into the connection (Score:2)
ipchains (kernel 2.2) used to have a variable timeout for NAT, but I think they changed that for netfilter/iptables (kernel 2.4). because they improved something so "normal" connections got dropped when they were over, so the kernel's tables didn't fill up, even with a long timeout. With ipchains, I used to set the timeout to > 2 hours, so TCP keepalives would keep SSH sessions from being dropped. I don't have to do that
Dont' see it helping much (Score:2)
After a short while, the script kiddies will have new types of VPN software which periodically drop an d re-establish a connection.
Or they'll just tunnel over http or whatever. Sure, it will be slower and more laggy, but they won't care, because they're 133T.
Much better to invest your time in regular network monitoring and IDS. If you know what your systems are supposed to be doing, you'll know when they're doing something else.
Resetting TCP sessions (Score:2, Informative)
If the IDS 'sees' traffic it doesn't like, it sends out a RST packet to the sender, addressed as if it came from the receiver, and vice versa. So, to both parties in the transmission it looks like the other party sent out the reset packet.
The one downfall to this was that the MAC address used in the RST packet was FF:FF:FF:FF:FF:FF. So, all one had to do is to modify their drivers to ignore RST packets w
Re:SSH tunnels or VPNs - isn't that the same? (Score:5, Informative)
IPSec VPNs are designed to be "networks" that encrypt the data that traverses them. This data is between two or more real networks, not just individual hosts. These VPNs are usually configured to completely conceal the contents including source/destination IP addresses of the networks traversing the VPN. These VPNs being actual "networks" also carry network traffic such as routing information and can even be rigged up enough to carry other protocols such as IPX.
SSH on the other hand is primarily intended to encrypt sessions between two hosts, rather than networks as is the case with IPSec. While it is possible to configure an SSH tunnel to forward multiple ports and there for multiple sessions between the hosts, it is far more difficult to configure SSH tunnels to carry whole network traffic and I am not aware of any way to carry protocols besides IP.
HTTPS is used to encrypt individual web sessions between two hosts. It is not able to due portforwarding or caryy other network traffic. The similarity between HTTPS and SSH is that they both use SSL/TLS as their means of encryption.
So, three different protocols for three different uses with very little overlap in functionality.
Re:SSH tunnels or VPNs - isn't that the same? (Score:5, Interesting)
IPSEC also verifies the endpoints and uses preshared keys, so it's secure enough for joining two LANs. PPTP/MPPE is good enough for picking up your email and stuff, but because there's no endpoint authentication it's not considered really secure.
SSH itself isn't a VPN but you can create one by running (for example) PPP across it.
No... (Score:2)