The complete solaris administration

http://www.akadia.com/services/solaris_tips.html

Read On »

ip-blocker-3-perl-ddos

#!/usr/bin/perl
$| = 1;
my $port = 80;
my $total = 0;
my $IP_LIMIT = 90;              # upper limit of httpd connections
my $LOGF = “/tmp/ddos.log”;     # file used to log ips
my $EMAIL = ‘root’;
my $DELAY = 60;
my $TIMEF = ‘/tmp/time_file’;
open FD, “+>>$LOGF” or die “$!”;
select FD;
open( CMD, “netstat -an|” );
while (<CMD>) {
chomp;
($proto, undef, undef, $local_addr, $remote_addr, undef) = split(/ +/, $_, 5);
($local_ip, $local_port) = split( /:/, $local_addr );
($remote_ip, $remote_port) = split( /:/, $remote_addr );
next if $remote_ip =~ /0.0.0.0/;
next if $remote_ip =~ /192.168.0.1/;    #our ip
next …

Read On »

ip-blocker-1 for ddos

#!/bin/bash
for ((  n = 0 ;  n <= 29;  n++  ))
do
netstat -plan|grep :80|awk {‘print $5′}|cut -d: -f 1|sort|uniq -c|sort -nk 1
netstat -plan|grep :80|awk {‘print $5′}|cut -d: -f 1|sort|uniq -c|sort -nk 1 | awk ‘{ if ( $1 > 35 ) print   $2
}’ > /tmp/blockedip
for i in `cat /tmp/blockedip`
do
printf ” \t\t\t\033[1;34m  $i \033[0m \n \n";
CHECK_IF_LOCALIP=0;
/sbin/ifconfig | grep $i > /dev/null;
if [ $? -ne $CHECK_IF_LOCALIP ]
then
{
FLAG=0;
grep $i /etc/sysconfig/iptables | grep DROP  > /dev/null;
if [ $? -ne $FLAG ]
then
printf “\033[1;35m \t\tBLOCKING ALL CONNECTIONS …

Read On »

apt-get mirrors for debian

Alternate apt-get mirrors.
add the following in the file /etc/apt/sources.list
# main sources
#
deb http://debian.intergenia.de/debian/ sarge main contrib non-free
#deb-src http://debian.intergenia.de/debian/ sarge main contrib non-free
# non-us
#
deb http://debian.intergenia.de/debian-non-US/ sarge/non-US main contrib non-free
#deb-src http://debian.intergenia.de/debian-non-US/ sarge/non-US main contrib non-free
# security
#
deb http://debian.intergenia.de/debian-security/ sarge/updates main contrib non-free
#deb-src http://debian.intergenia.de/debian-security/ sarge/updates main contrib non-free
# Plesk
#deb http://autoinstall.plesk.com/debian PSA_8.0.1/
# PHP5
#deb http://people.debian.org/~dexter php5 sarge
deb http://dotdeb.netmirror.org/ stable all
deb-src http://dotdeb.netmirror.org/ stable all

Read On »

 Page 1 of 8  1  2  3  4  5 » ...  Last »