Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Linux Servers

Support::Linux Servers Support forum for Linux EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-17-2007, 08:34 AM
Teppen
Banned
 
Join Date: Jan 2002
Posts: 80
Default Linux & Unix hardening

Here are a few ways to harden your linux machines. A default linux install does NOT disable or enable these below why? Im not sure. Ive tested 12 linux distro's and had to reconfigure these on every one of those systems. By the way, for those using FreeBSD, these apply to you as well, only with different commands which will be typed below the linux commands. The only Unix OS that does configure all of them at default install is OpenBSD, everyone else needs to configure manually.

______FOR LINUX USERS________

1.)

Disable ICMP broadcast echo activity
Your sys. could be used as part of Smurf attack
----
sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1

2.)

Disable ICMP routing redirects
Stops attackers from messing with routing tables
----
sysctl -w net.ipv4.conf.all.accept_redirects=0
sysctl -w net.ipv6.conf.all.accept_redirects=0
sysctl -w net.ipv4.conf.all.send_redirects=0
sysctl -w net.ipv6.conf.all.send_redirects=0

3.)

Disable ICMP broadcast probes
Attacker might be able to reverse eng. some details of your net. infrastructure
---
You will have to block these with a packet filter like iptables.

4.)

Disable IP source routing
Stops attackers trying to spoof IP addresses, trusted internal hosts
----
sysctl -w net.ipv4.conf.all.accept_source_route=0
sysctl -w net.ipv4.conf.all.forwarding=0
sysctl -w net.ipv4.conf.all.mc_forwarding=0

5.)

Enforce sanity checking
----
sysctl -w net.ipv4.conf.all.rp_filter=1

6.)

Log & Drop "Martian" packets
Usually already dropped, but enable it just incase
----
sysctl -w net.ipv4.conf.all.log_martians=1

7.)

Make the system more resistant to SYN Flood attacks
----
sysctl -w net.ipv4.tcp_max_syn_backlog=1280
sysctl -w net.ipv4.tcp_syncookies=1

8.)

Add line "version ..." to the /etc/named.conf, within the "options{...}; block
----
options {
other options appear here....
version "VERSION NOT PROVIDED:;
};
----
Otherwise a would-be attacker could figure out your BIND version with:
----
$ dig @yourserver version.bind chaos txt


________FOR FreeBSD USERS__________

1.)

Disable ICMP broadcast echo activity
-----
sysctl -w net.inet.icmp.bmcastecho=0

2.)

Disable ICMP routing redirects
----
sysctl -w net.inet.ip.redirect=0
sysctl -w net.inet.ip6.redirect=0

3.)

Disable ICMP broadcast probes
Attacker might be able to reverse eng. some details of your net. infrastructure
----
sysctl -w net.inet.icmp.masqrepl=0

4.)

Disable IP source routing
----
sysctl -w net.inet.ip.sourceroute=0
sysctl -w net.inet.ip.accept_sourceroute=0

5.)

Enforce sanity check... dont know one for FreeBSD.

6.)

Log & Drop "Martian" packets... dont know one for FreeBSD.

7.)

Make the system more resistant to SYN Flood attacks
----
sysctl -w kern.ipc.somaxconn=1024
-
-
Hope someone finds this useful.
-
-Teppen
Reply With Quote
  #2  
Old 12-17-2007, 07:36 PM
gernblan
Discordant
 
Join Date: Aug 2006
Posts: 394
Default

Excellent post! Thank you!

Bummer he got banned though after posting something so useful, huh?
__________________
--
Keelyeh
Owner, ServerOp and Developer
Jest 4 Server
Linux (Jest3 runs on Fedora, our Dev servers usually run on Ubuntu and/or Gentoo), OC-12 Connection = Hella Fast
Reply With Quote
  #3  
Old 12-26-2007, 08:47 AM
John Adams
Demi-God
 
Join Date: Jul 2006
Posts: 1,552
Default

Yah, kinda weird, huh?
Reply With Quote
  #4  
Old 12-26-2007, 10:42 AM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

Eight more "pointless" posts - You now total 1365! You see? I'm watching you try to "out post" everyone too

Quote:
Originally Posted by John Adams View Post
Yah, kinda weird, huh?
Reply With Quote
  #5  
Old 12-28-2007, 06:52 AM
Sensu-Bean
Sarnak
 
Join Date: Jul 2004
Posts: 36
Default Concerning Teppen

Q: Why was Teppen banned?

A: Someone aquired his forum password and started messaging senior members with foul messages. Result teppen got banned. However, the real teppen didnt know what was going on until he was banned and tried to login. Teppen asked under a friends username for his password to be changed, and username unbanned, but was ignored.

A new years resolution Id like to see is Teppen unbanned and given a new password, perhaps even a posted message saying hey sorry about the misunderstanding, welcome back! But who knows, in the end its all up to the person who banned him. Mattmeck tells me Angelox is a "really great guy" so I guess we'll just have to wait it out.

Teppen might have lost his username, but he is still on the forums. Ban one username, ban another, ban them all. If a person has friends then no amount of bans will stop a person who has been devoted to the community since 2002. Friendship is power. Although, Teppen misses his old username. And PEQ members miss Senzo's quest submissions. Might want to give Teppen a chance.

Sensu-Bean
Reply With Quote
  #6  
Old 12-29-2007, 03:29 AM
Sensu-Bean
Sarnak
 
Join Date: Jul 2004
Posts: 36
Default Section 9

I thought I would add a few sections to this tutorial. If anyone can further help out by adding to this tutorial please do.

9.)

UDP Flood Countermeasures (Linux)

-Some new distro's already have these commented out by default.
-Edit your /etc/inetd.conf placing # infront of all lines below.
-If #'s already exist, then your distro already performed this.

#echo stream tcp nowait root internal
#echo dgram udp wait root internal
#discard stream tcp nowait root internal
#discard dgram udp wait root internal
#daytime stream tcp nowait root internal
#daytime dgram udp wait root internal
#chargen stream tcp nowait root internal
#chargen dgram udp wait root internal
#time stream tcp nowait root internal
#time dgram udp wait root internal

At cmd line restart inetd after you make changes:

# killall -HUP inetd
Reply With Quote
  #7  
Old 12-30-2007, 10:59 PM
sfisque
Hill Giant
 
Join Date: Oct 2006
Posts: 248
Default

some general good security tasks for hardening:

1) turn off telnet and ftp in inetd.

2) set up keypair authentication for ssh access.

3) once you have keypairs set up, turn off password authentication in sshd.

4) configure sendmail to use the access database, and update it regularly to reduce the strain from spammers.

5) update hosts.allow and hosts.deny in /etc to restrict remote access (ssh uses these files also, just like inetd).

== sfisque
Reply With Quote
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 On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:10 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3