LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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
 
LinkBack Search this Thread
Old 07-02-2003, 11:48 PM   #1
cristi1979
Member
 
Registered: Jun 2003
Posts: 71

Rep: Reputation: 15
Angry big problems


I found out that a user who has an account on my network was running a ftp server from his home directory.
I was having VERY HIGH uploads and there was no room for downloads.
How can i stop this from happening again?

thank you in advance.

sorry for my bad english...
 
Old 07-03-2003, 06:59 AM   #2
phoeniXflame
Member
 
Registered: Feb 2003
Location: Somewhere, UK
Distribution: Slack, OpenBSD, Debian, SuSE
Posts: 189

Rep: Reputation: 30
restrict bg processes ? filter traffic to your shell boxes to only allow incomming ssh traffic on port 22 (or whatever port you use) ? shoot the user in question ?
 
Old 07-03-2003, 01:15 PM   #3
unixvillian
LQ Newbie
 
Registered: Jun 2003
Location: Pittsburgh, PA
Distribution: Slackware
Posts: 12

Rep: Reputation: 0
cristi1979, why not set user Quotas...
 
Old 07-03-2003, 06:08 PM   #4
cristi1979
Member
 
Registered: Jun 2003
Posts: 71

Original Poster
Rep: Reputation: 15
Quote:
shoot the user in question ?


how i can restrict the background processes?

The filters will not help me very much. If he knows how to start a ftp server in the background on a high port on my server, i think he knows how to bypass my filters...

and quotas are not a solution because the binarys of the ftp server were under 1MB...
 
Old 07-03-2003, 07:58 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 21,610
Blog Entries: 47

Rep: Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413
how i can restrict the background processes?
Run a daemon for that. Search Freshmeat.net

The filters will not help me very much.
What phoeniXflame means is you should block anyone from trying to set up a connection with any port except TCP/22. Incoming requests for a TCP connection have the SYN flag set, so that should be easy using a restrictive default policy of "DROP" and only allowing SYN's and related traffic for TCP/22.

If he knows how to start a ftp server in the background on a high port on my server, i think he knows how to bypass my filters.
Patch your server with the kernel patches from grsecurity.net, then you can deny any user setting up server and/or client sockets.

and quotas are not a solution because the binarys of the ftp server were under 1MB.
Using user quota's should work, it doesn't look for transfer size but used diskspace and files.
 
Old 07-03-2003, 09:05 PM   #6
cristi1979
Member
 
Registered: Jun 2003
Posts: 71

Original Poster
Rep: Reputation: 15
thank you.

what i meant with quota was that the guy was copying files from my server and not save them here. We have a large amount of movies here, so i believ he was copying movies. So, because of his uploads we run out of bindwith.
 
Old 07-03-2003, 09:16 PM   #7
angelrod
Member
 
Registered: Oct 2002
Location: Mexico
Distribution: RedHat 9.0 and SuSE 8.1
Posts: 229

Rep: Reputation: 30
move the movies to an other location and lock the user at one directory. And if you donīt need the ftp service, take it down and only alloy ssh. Also, why a normal user does have the privileges to start services and stuff??
 
Old 07-04-2003, 12:42 AM   #8
cristi1979
Member
 
Registered: Jun 2003
Posts: 71

Original Poster
Rep: Reputation: 15
Quote:
Also, why a normal user does have the privileges to start services and stuff??
i relly don't know. I am new on the administration of a linux server. He only had access to a normal ftp account. He WAS locket on the home directory. This is why he started a new ftp server.

Is there a way to stop users from having access to start programs?
 
Old 07-04-2003, 01:41 AM   #9
Robert0380
Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 46
where i worked he had hubs before we went to switches and uploads
(kazaa, morpheous...etc) killed the network connections in certain
buildings so we just physically unplugged a user until we could contact
em and tell em to stop or else their connection would not be restored.
 
Old 07-04-2003, 08:34 AM   #10
phoeniXflame
Member
 
Registered: Feb 2003
Location: Somewhere, UK
Distribution: Slack, OpenBSD, Debian, SuSE
Posts: 189

Rep: Reputation: 30
Quote:
Originally posted by cristi1979
The filters will not help me very much. If he knows how to start a ftp server in the background on a high port on my server, i think he knows how to bypass my filters...
a monkey with half a brain could start an ftp server on a high port in the background, if this particular box is only used for shell access for customers etc. etc. then all you have to do is drop all incomming connections APART from those which are aimed at port 22 and which are either NEW or RELATED,ESTABLISHED that way even if he does manage to run a server, no-one else will be able to connect to it, heres a little script that would do it ....

Code:
IPTABLES=/usr/sbin/iptables

# Flush tables and setup default rules
$IPTABLES -F
$IPTABLES --delete-chain
$IPTABLES -P INPUT DROP
$IPTABLES -P OUTPUT DROP
$IPTABLES -P FORWARD DROP

# INPUT
# Accept established connections
$IPTABLES -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Allow incomming SSH connections
$IPTABLES -A INPUT -p tcp --dport 22 -m state --state NEW -j ACCEPT

# Log and drop everything else
$IPTABLES -A INPUT -j LOG --log-prefix "Incomming packet dropped: "
$IPTABLES -A INPUT -j DROP

# OUTPUT
# Accept established connections
$IPTABLES -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Log and drop everything else
$IPTABLES -A OUTPUT -j LOG --log-prefix "Outgoing packet dropped: "
$IPTABLES -A OUTPUT -j DROP
that should do it, if you need to allow any other incomming connections (if you run an httpd or something) just add a rule similar to the SSH one detailed above, hope that helped
 
Old 07-04-2003, 08:44 AM   #11
xscousr
Member
 
Registered: Jul 2003
Location: Toronto
Distribution: Redhat
Posts: 89

Rep: Reputation: 15
if he has done what you describe he has no doubt broken any security/usage policy that you have in effect (you do have one don't you?)

Delete the account.

Lock the box down with the suggestions above and move on.
 
Old 07-04-2003, 02:48 PM   #12
cristi1979
Member
 
Registered: Jun 2003
Posts: 71

Original Poster
Rep: Reputation: 15
thank you for the script phoeniXflame.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Big O, Big Omega, and Big Theta oulevon Programming 7 05-26-2010 07:18 AM
Dual Boot Problems...big problems Goonie Linux - General 19 12-09-2006 04:44 PM
HELP ?! 2 Big problems and a medium one nykey Linux - Newbie 4 11-22-2003 09:17 AM
Big Problems! Help please! TheShemeta Slackware 1 11-04-2003 10:58 AM
2 big problems... Txlyo Linux - Newbie 24 10-16-2003 03:31 AM


All times are GMT -5. The time now is 05:18 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration