Secure your server

VPS and dedicated server security tips. Preventing from attacks, ddos and more.

Secure your server

Postby Mark » Mon Dec 14, 2009 6:40 pm

Checking for formmail: :lol:


Form mail is used by hackers to send out spam email, by relay and injection methods. If you are using matts script or a version of it, you may be in jeopardy.
Command to find pesky form mails:
find / -name "[Ff]orm[mM]ai*"
CGIemail is also a security risk:
find / -name "[Cc]giemai*"
Command to disable form mails:
chmod a-rwx /path/to/filename
(a-rwx translates to all types, no read, write or execute permissions).
(this disables all form mail)
If a client or someone on your vps installs form mail, you will have to let them know you are disabling their script and give them an alternative.
Root kit Checker (rkhunter or chkrootkit)
Check for a root kits via a cron job, by doing this you will regularly check if your server is comprised, and you will be sent regular reports.
To install chkrootkit, login to the server as root and on the command line interface type:
cd /root/
wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz
tar xvzf chkrootkit.tar.gz
cd chkrootkit-0.47
make sense
To run chkrootkit, type the following on the CLI:
/root/chkrootkit-0.47/chkrootkit
To ensure the highest level of security setup a cronjob which emails you the results on a regular basis.

Setup Email on Root Login (to detect breaches)
If an unauthorized person gains access to root, you want to be notified - you can do so by doing the following while logged into root:
cd /root
vi .bash_profile
Add the following line:
echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | awk '{print $6}'`" your@email.com
Where your@email.com is your email address.
Save an exit vi: :wq
To change the SSH Legal Message (displayed when you login via SSH), edit /etc/motd to display the message you wish to show.

Securing WHM and cPanel:
By default cPanel/WHM is not setup securely and efficiently, so you will want to optimize the cPanel/WHM settings by doing the following:
Go to: Server Setup -> Tweak Settings
Under Domains tick:
• Prevent users from parking/adding common internet domains (hotmail.com, aol.com, etc)
Under Mail tick:
• Attempt to prevent pop3 connection floods
• Default catch-all/default address behavior for new accounts - set this to FAIL
Under System tick:
• Use jailshell as default on new accounts
Go to: Server Setup -> Tweak Security
• Enable php open_basedir protection
• Enable mod_userdir protection
• Disable compilers for unprivileged users
Go to: Server Setup -> Shell Fork Bomb Protection
• Enable shell bomb/memory protection
When creating reseller packages, be sure to:
• Disallow creation of packages with shell acces
• Disallow creation of packages with full root access
Go to: Service Configuration -> FTP Configuration
• Disable anonymous FTP access
Go to: Account functions -> Manage Shell Acess
• Disable shell access for all users (except yourself)
Go to: MySQL -> Manage Root Password
• Change Root Password for MySQL
Go to: Security -> Quick Security Scan for Trojan Horses, and make sure you don't have any of the following infected:
• /sbin/depmod
• /sbin/insmod
• /sbin/insmod.static
• /sbin/modinfo
• /sbin/modprobe
• /sbin/rmmod

Update OS and Software:
If you are running cPanel:
• Update cPanel: /scripts/upcp
• Update Apache: /scripts/easyapache
If you are not running cPanel:
• Update OS and software: yum upgrade

General OS Security (do not need to be running cPanel):
Restict SSH access:
For improved security
Mark
 
Posts: 124
Joined: Fri Dec 11, 2009 2:18 pm

Re: Secure your server

Postby Andrew11 » Tue Dec 15, 2009 9:11 am

Woot, so if I use this I won't have any more viagra e-mails coming in and junk mail? :P
Andrew11
 
Posts: 11
Joined: Thu Dec 10, 2009 3:13 pm

Re: Secure your server

Postby Mark » Tue Dec 15, 2009 1:39 pm

Hi,

As far I know you won't. But, I would not suggest to depend completely on above mentioned stuff. Many things has be keep updated in order to secure your server. :)
Mark
 
Posts: 124
Joined: Fri Dec 11, 2009 2:18 pm

Re: Secure your server

Postby Jhon Kelly » Sat Dec 19, 2009 5:31 am

If you are sending email, it is NOT secure, unless you have exchanged public / private Keys with the individual you are sending to. Did they send you a public key file to import into your email client? Probably not, and this is the ONLY way email would be secure.

Only web sites, over https, are secure.
If this person has told you to email your stuff, and it's "secure", they are LYING to you. It is not, it would be very easy to intercept this info, or for someone to even read it on your or their machine at a later date.

Sound like the person telling you this is confused and things because they have a secure web site for taking CC orders, that this some how relates to email. Stupid mistake.
Even if they encrypt their whole email server, you still have the link from your computer, across the whole Internet before it makes it there to worry about. Believe me, it's NOT secure then. I highly doubt this person knows what they are talking about. I'd bring it to the attention of their supervisor.
Jhon Kelly
 
Posts: 101
Joined: Fri Dec 18, 2009 9:32 am

Re: Secure your server

Postby michel jhon » Sat Dec 19, 2009 8:21 am

yes and no. you do have to have an ssl certificate for ssl to work, but if you create your own, it is not a publically trusted certificate. the person on the other end has to trust that you are who you say you are. you may say, but i am. that is correct, but I also could pretend to be you.
michel jhon
 
Posts: 4
Joined: Sat Dec 19, 2009 8:06 am

Re: Secure your server

Postby Beaten Rice » Mon Dec 21, 2009 10:11 am

If you're just wanting to make a new machine relatively safe on your network, run 'nmap -O localhost' to see what other machines can see. Disable anything you don't 'need' (could be as simple as chkconfig. Disable anything that doesn't use encrypted sockets (if that's important to you) - e.g. use ssh instead of telnet. Look at hosts.allow and hosts.deny and what you've configured as a gateway. Disable remote root logins.

Also, look at your users (by which I mean actually dig around /etc/passwd). Do you have any that don't have a secure password set and a shell specified? Check your nfs shares... Check for .rhosts files in home accounts. Have a dig around xinetd.conf - do you need all of those services?

It's endless. There's bound to be a checklist out there somewhere, but if the machine's secure 'enough', then that's fine. For example, in work I have full trust in my company's firewall, and none of my machines have anything worth worrying about on them (and the only people that have access are other code monkeys), so I open them right up - I can log in as root, telnet, etc. That's completely secure for this environment.
Beaten Rice
 
Posts: 51
Joined: Mon Dec 21, 2009 5:15 am

Re: Secure your server

Postby Jhon Kelly » Tue Dec 22, 2009 9:06 am

I want to sign up for BlueHost and in the features is says SSL Secure Server is included. Does that mean I'll have a shared SSL certificate? If not does BlueHost have shared SSL certificates? Are they included or cost more?
Jhon Kelly
 
Posts: 101
Joined: Fri Dec 18, 2009 9:32 am

Thanks you for your work.

Postby goxiviolley » Thu Jan 20, 2011 10:49 am

I love www.copahost.com! Here I always find a lot of helpful information for myself. Thanks you for your work.
Webmaster of http://loveepicentre.com and http://movieszone.eu
Best regards
goxiviolley
 
Posts: 1
Joined: Thu Jan 20, 2011 10:48 am
Location: USA

prescription drugs pharmacy

Postby RichardJP » Thu Jan 20, 2011 10:50 am

Read more about site and user permissions on this site at Wetpaint Central. ) Member since Jun 2 2010, 4 51 AM EDT .wiki.oracleaccountdrewjmartin
Buy ED Trial Pack in uk drm,
Buy Effexor pills quick delivery,
Buy Effexor Xr pills burroughs wellcome.
Buy Suhagra reviews alternative african black ant capsule,
Buy Tadacip online india cleaning,
Buy Tadalis SX online no prescription xanax phentermine online pharmacy carisoprodol.
Buy Kamagra online nasal spray,
Buy Kamagra Jelly online uk what is the best generic,
Buy Kamagra Jelly 100mg can you take everyday.
Buy Accutane online us moon flowers,
Buy Benzac uk cost private pay,
Buy Grifulvin online usa find free sites online computer.
Buy Ayurslim without prescription fuerteventura,
Buy Brafix no prescription texas bow hunting,
Buy Brahmi canada generic vidrin.
Buy Lamisil in usa negative effects of,
Buy Oxsoralen 20mg free samples,
Buy acticin canada men taking.
paris hilton Shoes
buying gifts
gift cards online
gift guide
retirement gift ideas
buy gift cards at discount
shoe stores Online
Buy Levitra USA
Buy Levitra uk
RichardJP
 
Posts: 1
Joined: Thu Jan 20, 2011 10:50 am
Location: Brazil

Man Down Alarm

Postby aidelangife » Wed Jan 26, 2011 5:44 am

aidelangife
 
Posts: 1
Joined: Wed Jan 26, 2011 5:44 am
Location: United Kingdom

Next

Return to Securing your server

Who is online

Users browsing this forum: No registered users and 1 guest

cron