Archive for the ‘Software tips/tricks’ Category

Detect DDoS Source & Destination IP Address with OURMON

Thursday, June 26th, 2008

We have OURMON running on one of network segment for quite some time, it is very helpful and resourceful when DDoS attack happened, especially to help our customer to find out which destination is targeted on the attack and from which sources. Below is the graph that we previously captured while running OURMON version 2.70.

OURMON Version 2.81

On the recent released of OURMON, the topn graphs didn’t show the traffic by Mbit/s instead of bit/s. The long no. is confusing when the NOC engineer is doing the monitoring(minimal 7 digits will show up). I have made some changes on omupdate.pl, one of OURMON script that generate html static page, to show extra value – Mbit/s. Our current OURMON graph looks something like below;

Below will show you how to add extra Mbit/s value on your OURMON Topn section;

edit omupdate.pl file

vi /usr/local/mrourmon/bin/omupdate.pl

On line 3137, add the code looks like below;


my $uappf = $items[$i+2];       # old hw app flags
my $uappl = $items[$i+3];       # app lower case
my $uapph = $items[$i+4];       # app upper case
my $bps = int(($items[$i+1] * 8)/30);
my $mbps = sprintf("%.2f", ($bps/1024)/1024); # convert bits to mbits
my $uaf = get_appflag($uappf, $uappl, $uapph);

this line of code my $mbps = sprintf(“%.2f”, ($bps/1024)/1024); is to declare the new variable $mbps and convert the bit/s value to Mbit/s by dividing 1024*1024.

Next is to display the value on the page, do something on line of code 3146;


"bits/sec: $bps, Mbits/sec: $mbps, "

Done, wait for a few second for the web page to refresh with extra Mbit/s value. Btw, you can remove bit/s if you want to, to save some extra space ;)

ssh client hang after a few minutes of inactivity

Wednesday, April 2nd, 2008

specify the parameter “ServerAliveInterval 60″ in /etc/ssh_config or /etc/ssh/ssh_config.

for more info, man ssh_config

Exim – anti-spam per domain setting

Tuesday, April 1st, 2008

acl_check_rcpt:
blah …
blah …
blah …
deny message = rejected as $sender_host_address is blacklisted in $dnslist_domain\n$dnslist_text
domains = domain-one.com : domain-two.com : domain-three.com
dnslists = sbl-xbl.spamhaus.org

blah …
blah …
blah …

reference link : http://www.exim-new-users.co.uk/content/view/65/39/

screen in FreeBSD default to csh as suppose to bash (preferred)

Monday, March 31st, 2008

After changing bash shell to a new user using chsh, screen needs ~/.bashrc for environment settings, which need “ln -s ~/.bash_profile ~/.bashrc”.

Downgrade package in Debian

Thursday, January 24th, 2008

 getthunderbird.png

For some reason, the recent Icedove (aka Thunderbird) version 20.0.0.9-3 in Debian does not work with the latest Enigmail version 0.95.6. No choice, got to downgrade it back to Icedove version 1.5. How ? No worries, apt is a flexible package manager, just “apt-get -t <distribution> install <package name>”.

e .g. apt-get -t unstable install icedove

Have fun !!!