Hundreds of windows scripts and softwares can be used to launch a brute force SSH attack to your SSH ports. These brute force attacks can easily send a combination of username and password pairs into your SSH port on automatic mode or on scheduled time period.
Most alarming feature of these kind of scripts and program malwares is that brute force details like username and password, can automatically be fed and supplied from millions of possible usernames and passwords pairs using a large base of dictionary file. The dictionary is widely available from internet and is compiled to have the most commonly used username and password combinations consisting of standard english names, numbers and special character combinations to provide a higher ratio of successful brute force SSH attack.
There are a lot of ways to handle SSH brute force attacks. One approach is by using Blockhosts rpm package.
Blockhosts scans log files for matching signatures. Blockhosts keeps track of records of how many times an attacking host failed to login via SSH and other ports before dropping the attacker to deny host file or blackhole file list. In other words, blockhost offers an automatic blocking of abusive IPs against specific daemon service like SSH ports, FTP ports and the like.
BlockHosts Installation
Blockhosts is not currently supported by Fedora repos. Download blockhosts rpm here and install it using rpm package installer.
# rpm -ivh BlockHosts-2.4.0-1.noarch.rpm
BlockHosts Setup and Configuration
Backup and modify /etc/blockhosts.cfg
Blockhosts would work by default configuratoin. Blockhosts installed its configuration file to
/etc/blockhosts.cfg
However, the most important line from /etc/blockhosts.cfg is the threshold value.
Blockhosts Threshold
This is the trigger point by blockhosts where the process of blocking abusive host would then be triggered.
COUNT_THRESHOLD = 7
Remember to remove comment characters # when modifying blockhosts configuration value.
Blockhosts Deny File
This could be either /etc/hosts.allow or /etc/hosts.deny files and can be configured with the similar setup line.
HOSTS_BLOCKFILE = "/etc/hosts.deny"
Blockhosts Deny Line
When blockhosts blocks an abusive IP, it drops the current IP to blockhosts deny file followed by SSH recognized line like
HOST_BLOCKLINE = ["ALL: ", " : deny"]
Accept as default.
Blockhosts Age Threshold
The main blockhosts program feature is to lessen the paranoid level of blocking hosts permanently. An optional threshold value measured in number of hours can be specified. This value can unblock and release the abusive IP addresses from the blackhole list or deny file.
AGE_THRESHOLD = 12
The above line leaves an abusive host or IP to blocked list for 12 hours quarantine time.
Blockhosts Whitelist and Blacklist Labels
Identity excemptions using black and white list is also featured by blockhosts. A black and white list enlistment for multiple hosts can be done by using the below configuration lines.
WHITELIST = [ "127.0.0.1", "10\.0\.0\..*", ]
BLACKLIST = [ "192.168.10.1", "10\..*", ]
BlockHosts Monitored Log Files
Specify here the log files that blockhosts needs to monitor from
LOGFILES = [ "/var/log/secure", "/var/log/vsftpd.log", ]
Log file(s) can be separated by comma.
Blockhosts Alerts and Email Notification
You can edit the blockhosts mail feature for alerts and email notifications.
MAIL = True
NOTIFY_ADDRESS = 'root@localhost.localdomain'
Lastly, edit your blockhosts deny file. You can refer to block host deny file.
# nano -w /etc/hosts.deny
Alternatively, if you specify the same deny host file of /etc/hosts.allow
# nano -w /etc/hosts.allow
Append the below lines into your blockhosts deny file.
#---- BlockHosts Additions
#---- BlockHosts Additions
Save and exit.
Blockhosts package supports blocking hosts based from failed attempts on ports by daemon services like OpenSSH, ProFTPd, VsFTPd, Pure-FTPd and more. For more installation help, you can view Blockhosts help file.
# nano -w /usr/share/doc/BlockHosts-2.4.0/INSTALL
Execute Blockhosts Binary
# blockhosts.py --verbose
The above line scans your blockhost log files for possible brute force attack and failed authentication logins. If found, abusive hosts and IP addresses would be enlisted to blockhosts deny file.
Blockhosts Crontab Scheduling
By regularly checking your system logs for possible abusive hosts, you can schedule a regular blockhosts check
Say, every 10 minutes check interval
*/10 * * * * /usr/bin/blockhosts.py > /dev/null 2>&1
The above line executes blockhosts phyton binary to check and monitor its log files for possible abusive script kiddies and port attacks. More info here.
All is done.
Subscription
Categories
- HowTos (612)
- Linux Devices (40)
- Linux Diggs (620)
- Linux News (1541)
- Linux Videos (24)
Recent Posts
Blog Archive
-
▼
2008
(2301)
-
▼
July
(297)
- How To Kill Application Process ID (PID) The Faste...
- How To Install Fedora 9 From The Internet
- How To Install PHP5 and Apache HTTP Server
- How To Display The Number of Processors in Linux
- How To Prevent Alt+F1 and Alt+F2 TTY Console Login...
- How To Install Text-based File Manager
- How To Delete Linux Files Older Than 360 days
- How To Install VirtualBox on Fedora 9
- HowTo: Delete All Thumbs.db Recursively
- HowTo: Delete All Thumbs.db Recursively
- 10 Cool Open Source Easter Eggs
- KDE 4.1 rocks the desktop
- 10 Cool Open Source Easter Eggs
- KDE 4.1 rocks the desktop
- Roku's Netflix Player: a hands-on review
- PostPath cracked Exchange protocols for Postfix-ba...
- Yahoo, HP, Intel Give Ivory Towers a Stairway to t...
- Portugal Rings Up Big Order for Intel's Classmate PCs
- SSD vs. SATA RAID: A Performance Benchmark
- Roku's Netflix Player: a hands-on review
- PostPath cracked Exchange protocols for Postfix-ba...
- Yahoo, HP, Intel Give Ivory Towers a Stairway to t...
- Portugal Rings Up Big Order for Intel's Classmate PCs
- Floating Point Math in Bash
- SSD vs. SATA RAID: A Performance Benchmark
- How To Mount Remote Folder Location Via SSHFS
- How To Protect SSH From Multiple and Parallel Coor...
- How To Enable IP Forwarding in Linux
- spell check text file from terminal
- spell check text file from terminal
- How To Allow and Deny SSH Access To Specific Users
- Customer demand adds Linux to industrial computer ...
- Is OpenSolaris in hot water?
- Anatomy of the Linux file system
- Linux development on the PS 3 More than a toy - pa...
- Quotes from Bill Gates, Steve Jobs and Linus Torvalds
- Under Pressure, ISP Admits Secret Web Snooping in ...
- Open Web Foundation to Play Freedom Cop for Net Specs
- Customer demand adds Linux to industrial computer ...
- Is OpenSolaris in hot water?
- Anatomy of the Linux file system
- Linux development on the PS 3 More than a toy - pa...
- Quotes from Bill Gates, Steve Jobs and Linus Torvalds
- Installing Applications on Linux
- Under Pressure, ISP Admits Secret Web Snooping in ...
- Open Web Foundation to Play Freedom Cop for Net Specs
- Microsoft Becomes Just a Little More Like Apple
- Tux3, a Versioning Filesystem
- Anatomy of Linux loadable kernel modules
- Shuttleworth: Microsoft Does Not Want War
- The Open Call
- Google Gadgets for Linux -- Almost There
- Cloud Computing: When Computers Really Do Rule
- Consoles Sell Like Hotcakes, Yahoo Cuts a Deal, Sy...
- Microsoft Becomes Just a Little More Like Apple
- Tux3, a Versioning Filesystem
- Anatomy of Linux loadable kernel modules
- Shuttleworth: Microsoft Does Not Want War
- The Open Call
- Google Gadgets for Linux -- Almost There
- Cloud Computing: When Computers Really Do Rule
- Consoles Sell Like Hotcakes, Yahoo Cuts a Deal, Sy...
- How To Install Adobe Flash Player 10 in Fedora
- How To Add and Install Alternative Liberation Fonts
- Digg it: Top 1 Supercomputer is powered by Fedora
- How To Send System Message To FTP Clients via TCP ...
- Intel Switches From Ubuntu To Fedora For Mobile Linux
- Intel Switches From Ubuntu To Fedora For Mobile Linux
- How To Create Separate SSH Log File for Specific S...
- How To Allow and Deny SSH Access To Selected Hosts...
- Fedora 10 - Friends, Freedom, Features, and First
- Fedora 10 - Friends, Freedom, Features, and First
- The Mess That is Linux Volume Management
- Are We About to Witness a Real OS X virus?
- Security is No Secret
- Enterprise Storage Solution Using Nand Flash and ZFS
- Shuttleworth Sets Bar For Linux 'Beyond Apple'
- Why We Still Need the iPhone App Black Market
- DragonFly BSD 2.0 Released
- Interview with Mandriva's KDE Developer Helio Castro
- Mandriva and PTech Announce Low-cost Desktop
- The Coco Bidet and Toilet Technology
- The Mess That is Linux Volume Management
- Are We About to Witness a Real OS X virus?
- Security is No Secret
- Enterprise Storage Solution Using Nand Flash and ZFS
- Shuttleworth Sets Bar For Linux 'Beyond Apple'
- Why We Still Need the iPhone App Black Market
- DragonFly BSD 2.0 Released
- Interview with Mandriva's KDE Developer Helio Castro
- Mandriva and PTech Announce Low-cost Desktop
- The Coco Bidet and Toilet Technology
- Automatix Comes to Fedora 9 - FedoMATIX
- Automatix Comes to Fedora 9 - FedoMATIX
- #1 Supercomputer in the World Runs Fedora
- #1 Supercomputer in the World Runs Fedora
- How To Install An Extremely Fast, Lightweight, But...
- How To Bypass DNS Log Monitoring By Your ISP
- Veteran developer ditches Microsoft for open source
- Why not learn a little language while you work, Am...
-
▼
July
(297)
Thursday, July 24, 2008
How To Stop and Block Script Kiddies Attacking Your SSH Port
Subscribe to:
Post Comments (Atom)
ILoveTux - howtos and news | About | Contact | TOS | Policy
0 comments:
Post a Comment