Showing posts with label system hardening. Show all posts
Showing posts with label system hardening. Show all posts

Monday, July 18, 2011

create a list of all packages

#!/bin/sh

/bin/rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n' 2>&1 \
| /bin/sort > /var/log/rpmpkgs

The idea would be to take a sha1 hash of this file and then check it periodically to be sure that the package list has not changed.

Wednesday, June 22, 2011

oracle linux links

http://www.oracle.com/us/technologies/linux/index.htm
http://www.oracle.com/us/technologies/linux/unbreakable-enterprise-kernel-ds-173416.pdf
http://www.oracle.com/us/technologies/linux/ubl-edison-066204.pdf
http://public-yum.oracle.com/

Wednesday, April 14, 2010

loop-aes-utils, smbfs and Ubuntu

The following was experienced on Ubuntu Desktop 9.10

if you install loop-aes-utils, and then install smbfs, the cryptoloop.ko is removed from the kernel.

`mount` will give you errors like:

ioctl: LOOP_SET_STATUS: Invalid argument, requested cipher or key length (256 bits) not supported by kernel


`modprobe loop` will give you:

FATAL: Module loop not found


well, not sure what the whole story is, but the following fixes it.

`modprobe cryptoloop`

Tuesday, March 23, 2010

remove serverbeach backdoor

when you lease a server from ServerBeach, they install a backdoor on your server. Here's how to remove it when you choose CentOS or similar redhat type system.

service sbadm stop
chkconfig --del sbadm
rm -f /etc/ssh/.sbadm_config
rm -f /usr/sbin/sbadm
rm -rf /usr/local/webmin-*
rm -f /etc/init.d/sbadm

Wednesday, November 11, 2009

host firewall for the mac

#!/bin/sh
#fwrules

IPFW='/sbin/ipfw -q'

$IPFW -f flush
$IPFW add 2000 allow ip from any to any via lo*
$IPFW add 2010 deny log ip from 127.0.0.0/8 to any in
$IPFW add 2020 deny log ip from any to 127.0.0.0/8 in
$IPFW add 2030 deny log ip from 224.0.0.0/3 to any in
$IPFW add 2040 deny log tcp from any to 224.0.0.0/3 in
$IPFW add 2050 allow log tcp from any to any out
$IPFW add 2060 allow tcp from any to any established
$IPFW add 12190 deny log tcp from any to any


Then apply it to the firewall

# sudo ipfw list
# chmod 600 ./rules
# sudo ipfw ./rules

Friday, August 14, 2009

slowloris ddos aversion

use Nginx and openBSD/pf to protect Apache.
http://nginx.net/

here's some configuration help.
https://calomel.org/nginx.html

Tuesday, August 11, 2009

Slowloris DDOS prevention

#!/bin/sh

LIMIT=100

COMMAND='netstat -n | egrep '\''tcp.*[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*:(80|443)[ ]*[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*:[0-9]*[ ]*ESTABLISHED
'\'' | awk -F'\''[ \t:]+'\'' '\''{ print $6 }'\'''

eval $COMMAND | sort | uniq -c | while read numconn ip
do
if [ $numconn -gt $LIMIT ]
then
echo "Check ASAP and renable this cron." | mail -s "IP $ip - ($numconn) went over $LIMIT connections on `hostname`" me@someemailaddress.com

sed -i 's/\(^\*.*this_script.sh*\)/#\1/g' /etc/crontab
# /sbin/iptables -I INPUT -s $ip -j DROP
fi
done

Monday, June 8, 2009

Set up SNMP v3 on Cisco IOS

conf t
snmp-server group group_name v3 priv
snmp-server group group_name v3 priv read secure_ro write secure_rw access 5
snmp-server view secure_ro internet included
snmp-server view secure_rw mgmt included
snmp-server user snmp_user iksecure v3 auth md5 auth_password priv des56 priv_password

access-list 5 permit host x.x.x.x
access-list 5 deny any log


show snmp group
show snmp user

Tuesday, December 16, 2008

Change runlevel Settings for a Group of Services

The following command changes all services set to run at runlevel 5 and sets them to off.
chkconfig --list | grep 5:on | awk '{ print $1 }' | \
while read LINE; do chkconfig --level 12345 $LINE off; done