Completed

Linux Script

Need to write a simple shell script ( Ubuntu/CentOS) that is ran using crontab, idea is to scan for number of connections per ip, if it exceeds specified limit, run command to block that IP in our firewall.

Functions:

1. run netstat -atun | awk '{print $5}' | cut -d: -f1 | sed -e '/^$/d' |sort | uniq -c | sort -n

2. scan number of connections and IP addresses

sample output:

2 [login to view URL]

2 [login to view URL]

3 [login to view URL]

5 [login to view URL]

5 [login to view URL]

5 [login to view URL]

6 [login to view URL]

6 [login to view URL]

8 [login to view URL]

9 0.0.0.0

10 [login to view URL]

12 [login to view URL]

22 [login to view URL]

22 [login to view URL]

24 [login to view URL]

24 [login to view URL]

60 [login to view URL]

370 [login to view URL]

450 [login to view URL]

Threshhold limit in conf is for ex 200 that means the last 2 ips should be blocked using command:

csf -d [login to view URL]

csf -d 450 175.137.180

use sendmail to email this event (only if block was done)

Must work without bugs/crashing/memory leaks etc, at end of script it must be terminated.

Skills: Linux, Shell Script, C Programming, UNIX, Ubuntu

See more: linux script mysql sync, dash linux script, linux script manager users, linux script error handling, linux script probleme, linux script replace string file, linux script update database, linux script imagemagick, html2pdf linux script, tag cloud script need script tag pictures, linux script backup lto, linux script transferring files sftp, linux script setting server, linux script download email attachments, read the numbers and decide what the next number should be 15 14 13 12 11 10 9

About the Employer:
( 0 reviews ) Ajax, Canada

Project ID: #21701231

Awarded to:

bindmission

Hello Hope you are doing well. I have 7 years of experience in Linux and shell scripting. I can handle this project. Regards VishnuLal*

$50 USD in 1 day
(117 Reviews)
6.0

5 freelancers are bidding on average $92 for this job

iridescent2x15

Hi I am software engineer and have done many programming and technical projects. Send me more details about your application so that we can negotiate the price accordingly. Thank you

$300 USD in 7 days
(41 Reviews)
5.8
martini002

Hello, I'm a software engineer & linux sysadmin. I can do this, I used CSF before for DDoS attacks from haters, I lost my script but I can recreate it for you. It will work safetly but can't guarantee the memory and C More

$50 USD in 7 days
(7 Reviews)
3.6
finest2019

I have read your proposal carefully. So I think my skill is suitable for your job. I have been working within this job for almost 9 years. I guarantee I will do it perfectly on time as an expert. thanks for your regard More

$30 USD in 2 days
(4 Reviews)
2.9
wangxiangyu1231

Hi... I have read your brief and can understand your requirement. I am Linux script expert especially I worked as a firewall management developer on large company. I am sure I can complete your job definitely. Let's di More

$30 USD in 7 days
(1 Review)
1.7