2012
12.26

Attacken vom Kippo-Honeypot an BlockList reporten

Wenn man einen SSH-Honeypot wie z.B. den Kippo einsetzt (gute Anleitung zur Installation), aber die Attacken nicht reportet, kann man dies z.B. mit einem weiteren Fail2Ban-Filter tun.

Dazu einfach die Datei /etc/fail2ban/filter.d/kippo.conf mit folgendendem Inhalt erstellen:


# Fail2Ban configuration file
#
# Author: Martin Schiftan
#
# $Revision: 1 $
#

[Definition]

_daemon = sshd

# Option:  failregex
# Notes.:  regex to match the password failures messages in the logfile. The
#          host must be matched by a group named "host". The tag "<HOST>" can
#          be used for standard IP/hostname matching and is only an alias for
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
# Values:  TEXT
#
failregex = (.*),<HOST>\]login attempt(.*)

# Option:  ignoreregex
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
# Values:  TEXT
#
ignoreregex =

oder selbst anpassen/erstellen 🙂

Und dann in der /etc/fail2ban/jail.conf  folgendes hinzufügen:


[kippo]

enabled = true
port    = ssh
filter  = kippo
logpath  = /home/kippo/log/kippo.log
maxretry = 4

Der Pfad zur Logdatei muss natürlich angepasst werden.

Nach einem Fail2ban neustart, meldet dann Fail2Ban die Logfiles von den Logins am Kippo-SSH-Honeypot an BlockList.de und wird als normale SSH-Attacke verarbeitet.

BlockList selbst kann das Datum aus den Logdateien korrekt parsen. Das Logging muss in der kippo.cfg natürlich aktiviert sein.
Damit BlockList die Reports richtig zuweisen kann, ist eine korrekte Konfiguration von Fail2Ban nötig (Absender-/Empfänger-Adresse, action_mwl)
wie hier beschrieben.
Man kann sich natürlich auch ein eigenes Skript schreiben, was z.B. vom Kippo oder anderen Honeypot ausgelöst wird und die Logfiles reportet.

-google-ads-
2012
12.23

China was for 12/2012 Top-Spam-Country

The month is not complete, but you can see, that in the Statistics, that China was really Number 1:

Country: Numbers:
CN 22717
RU 7005
BR 6927
IN 6054
US 4901
UA 3730
DE 3496
AR 3045
ES 2765
PE 2627

The Network AS4837 (CHINA169-BACKBONE CNCGROUP China169 Backbone) and the Network AS4134 (CHINANET-BACKBONE No.31,Jin-rong Street) was so heavy and all Abuse-Contacts does not Work (no MX-Records, no A-Records….), so we send the Reports to security.at.apnic.net. But there was a fight against Windmills.

When you know, that your Website/Server has no Users from China, you can block the complete IP-Range/AS-Network.

-google-ads-
2012
12.07

Use BlockList.de with DenyHost

When you use DenyHost and not Fail2Ban, you can use BlockList.de with a small Plugin (Script) without fail2ban.

Download the Script or add a new .SH-File on your System like /usr/share/denyhosts/DenyHosts/blocklist.de-reporting.sh with the following Code:

<code>

#!/bin/bash
SENDERMAIL='fail2ban@DEINE-DOMAIN'
DESTINATIONMAIL='fail2ban@blocklist.de'
SSHLOG='/var/log/auth.log'

if [ -z $1 ]; then
echo "IP-Adresse nicht uebergeben...." ;
exit;
fi
IP=$1

LOGS=`grep $IP $SSHLOG | tail -n 50`

TEXT="sended from denyhost Plugin

Lines containing IP$IP:
$LOGS

Regards,
Fail2Ban"

SENDE=`echo "$TEXT" | mail -s "[Fail2Ban] ssh: banned $IP" -r $SENDERMAIL $DESTINATIONMAIL`

</code>

Change the SENDERMAIL to your Address whith the same Address that you have add on blocklist.de under your Server-Profil.

Then edit the /etc/denyhosts.conf and add the Script in the PLUGIN_DENY like this:

PLUGIN_DENY=/usr/share/denyhosts/DenyHosts/blocklist.de-reporting.sh

restart denyhost and you send the Logfiles from SSH-Attacks to blocklist and we can report them.

 

-google-ads-
Translate »