Tuesday, September 27, 2016

Increase Swap Size in Linux

The free -m command shows that the swap memory in your current server.

We can increase 4GB of swap size now.

Create Swap file using below command

touch /swapfile

Use the following command to create 4GB of swap file.

# dd if=/dev/zero of=/swapfile bs=1M count=4096
# mkswap /swapfile

Now the swap file is created.

activate /swapfile file swap space now.
# swapon /swapfile

Add entry on /etc/fstab file to activate after Linux system reboot.

# vi /etc/fstab
/swapfile swap    swap    defaults        0 0

save and close the file.

Now check your swap space now.

# free -m

In order to delete swap.

Run “swapoff /swapfile” command
Remove the entry from /etc/fstab file
Remove /swapfile  file (using rm command)
 

Monday, September 19, 2016

FASTNETMON DDOS ANALYZER TOOL

Install FastNetMon Tool on CentOS 6,7 and Debian 6,7,8 and Ubuntu,Fedora and Gentoo
FastNetMon Tool is DDoS monitoring tool. You can Download & Install using below steps :
(1) cd /tmp
(2) mkdir fastnetmon
(3) cd fastnetmon
(4)wget https://raw.githubusercontent.com/pavel-odintsov/fastnetmon/master/src/fastnetmon_install.pl -Ofastnetmon_install.pl
(5) intall it using command : perl fastnetmon_install.pl
If you are trying using other user than root try to install using :
sudo perl fastnetmon_install.pl

while installing it will track information about the computer/server where you are installing are like cpu,distro,os type. if you dont want to share those information try install it with below command :
perl fastnetmon_install.pl –do-not-track-me
or
sudo perl fastnetmon_install.pl –do-not-track-me

as installtion completes follow below steps

(1) wget https://raw.githubusercontent.com/pavel-odintsov/fastnetmon/master/src/notify_about_attack.sh -O/usr/local/bin/notify_about_attack.sh
(2) chmod 755 /usr/local/bin/notify_about_attack.sh
open above file in editor and add the mail id where you want to get mails for attack notifications.
(3) vi /usr/local/bin/notify_about_attack.sh
add mail id at “email_notify”
(4) run the service of fastnetmon using command : systemctl start fastnetmon.service

To enable fastnetmon on server startup use below
/opt/fastnetmon/fastnetmon –daemonize

Note : If something goes wrong, please check logs: tail -f /var/log/fastnetmon.log