Aktuelles
Digital Eliteboard - Das Digitale Technik Forum

Registriere dich noch heute kostenlos, um Mitglied zu werden! Sobald du angemeldet bist, kannst du auf unserer Seite aktiv teilnehmen, indem du deine eigenen Themen und Beiträge erstellst und dich über deinen eigenen Posteingang mit anderen Mitgliedern unterhalten kannst! Zudem bekommst du Zutritt zu Bereichen, welche für Gäste verwehrt bleiben

Registriere dich noch heute kostenlos, um Mitglied zu werden! Sobald du angemeldet bist, kannst du auf unserer Seite aktiv teilnehmen, indem du deine eigenen Themen und Beiträge erstellst und dich über deinen eigenen Posteingang mit anderen Mitgliedern unterhalten kannst! Zudem bekommst du Zutritt zu Bereichen, welche für Gäste verwehrt bleiben

fail2ban für CCcam installieren

    Nobody is reading this thread right now.
AW: Howto: fail2ban für CCcam installieren

Ich hab gerade bemerkt das die "illegal user" noch nicht von fail2ban gefiltert werden...
"illegal user" sind jene die entweder garkeine Fline haben oder zb ein falsches Password angeben...

jail.conf:
Code:
[cccam_illegal]
enabled = true
port = 12000
filter = cccam-illegal
logpath = /var/log/syslog
bantime = 1800
maxretry = 10
filter.d/cccam-illegal.conf:
Code:
[Definition]
failregex = CCcam: illegal user .* from <HOST>
ignoreregex =

versteh nicht ganz!
was soll man da jetzt machen???
sorry bin a fail2ban newbie
 
AW: Howto: fail2ban für CCcam installieren

was ich nicht ganz versteh! ich habe ja das fail2ban über ipc installiert!
da ist ja dann schon eine jail.conf drin!
muss ich jetzt da drin alles löschen und nur das eintragen was im 1.post geschrieben steht, oder muss ich das aus dem ersten post am ende der datei dazuschreiben??
 
AW: Howto: fail2ban für CCcam installieren

kukst du

# Fail2Ban configuration file.
#
# This file was composed for Debian systems from the original one
# provided now under /usr/share/doc/fail2ban/examples/jail.conf
# for additional examples.
#
# To avoid merges during upgrades DO NOT MODIFY THIS FILE
# and rather provide your changes in /etc/fail2ban/jail.local
#
# Author: Yaroslav O. Halchenko <debian@onerussian.com>
#
# $Revision: 281 $
#

# The DEFAULT allows a global definition of the options. They can be override
# in each jail afterwards.

[DEFAULT]

# "ignoreip" can be an IP address, a CIDR mask or a DNS host
ignoreip = 192.168.178.27 192.168.178.25
bantime = 43200
maxretry = 3

# "backend" specifies the backend used to get files modification. Available
# options are "gamin", "polling" and "auto".
# yoh: For some reason Debian shipped python-gamin didn't work as expected
# This issue left ToDo, so polling is default backend for now
backend = polling

#
# Destination email address used solely for the interpolations in
# jail.{conf,local} configuration files.
destemail = root@localhost

#
# ACTIONS
#

# Default banning action (e.g. iptables, iptables-new,
# iptables-multiport, shorewall, etc) It is used to define
# action_* variables. Can be overriden globally or per
# section within jail.local file
banaction = iptables-multiport

# email action. Since 0.8.1 upstream fail2ban uses sendmail
# MTA for the mailing. Change mta configuration parameter to mail
# if you want to revert to conventional 'mail'.
mta = sendmail

# Default protocol
protocol = tcp

#
# Action shortcuts. To be used to define action parameter

# The simplest action to take: ban only
action_ = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s]

# ban & send an e-mail with whois report to the destemail.
action_mw = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s]
%(mta)s-whois[name=%(__name__)s, dest="%(destemail)s", protocol="%(protocol)s]

# ban & send an e-mail with whois report and relevant log lines
# to the destemail.
action_mwl = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s]
%(mta)s-whois-lines[name=%(__name__)s, dest="%(destemail)s", logpath=%(logpath)s]

# Choose default action. To change, just override value of 'action' with the
# interpolation to the chosen action shortcut (e.g. action_mw, action_mwl, etc) in jail.local
# globally (section [DEFAULT]) or per specific section
action = %(action_)s

#
# JAILS
#

# Next jails corresponds to the standard configuration in Fail2ban 0.6 which
# was shipped in Debian. Enable any defined here jail by including
#
# [SECTION_NAME]
# enabled = true

#
# in /etc/fail2ban/jail.local.
#
# Optionally you may override any other parameter (e.g. banaction,
# action, port, logpath, etc) in that section within jail.local

[cccam_signaturefailed]
enabled = true
port = 12000
filter = cccam-signature
logpath = /var/log/daemon.log
bantime = 1800
maxretry = 10

[cccam_badcommand]
enabled = true
port = 12000
filter = cccam-command
logpath = /var/log/daemon.log
bantime = 1800
maxretry = 10

[cccam_doublelogin]
enabled = true
port = 12000
filter = cccam-login
logpath = /var/log/daemon.log
bantime = 1800
maxretry = 10

[cccam_illegal]
enabled = true
port = 12000
filter = cccam-illegal
logpath = /var/log/syslog
bantime = 1800
maxretry = 10


[ssh]

enabled = true
port = ssh
filter = sshd
logpath = /var/log/auth.log
maxretry = 6
bantime = 43200

# Generic filter for pam. Has to be used with action which bans all ports
# such as iptables-allports, shorewall
[pam-generic]

enabled = false
# pam-generic filter can be customized to monitor specific subset of 'tty's
filter = pam-generic
# port actually must be irrelevant but lets leave it all for some possible uses
port = all
banaction = iptables-allports
port = anyport
logpath = /var/log/auth.log
maxretry = 6

[xinetd-fail]

enabled = false
filter = xinetd-fail
port = all
banaction = iptables-multiport-log
logpath = /var/log/daemon.log
maxretry = 2


[ssh-ddos]

enabled = true
port = ssh
filter = sshd-ddos
logpath = /var/log/auth.log
maxretry = 6

#
# HTTP servers
#

[apache]

enabled = true
port = http,https
filter = apache-auth
logpath = /var/log/apache*/*error.log
maxretry = 6

# default action is now multiport, so apache-multiport jail was left
# for compatibility with previous (<0.7.6-2) releases
[apache-multiport]

enabled = false
port = http,https
filter = apache-auth
logpath = /var/log/apache*/*error.log
maxretry = 6

[apache-noscript]

enabled = false
port = http,https
filter = apache-noscript
logpath = /var/log/apache*/*error.log
maxretry = 6

[apache-overflows]

enabled = false
port = http,https
filter = apache-overflows
logpath = /var/log/apache*/*error.log
maxretry = 2

#
# FTP servers
#

[vsftpd]

enabled = false
port = ftp,ftp-data,ftps,ftps-data
filter = vsftpd
logpath = /var/log/vsftpd.log
# or overwrite it in jails.local to be
# logpath = /var/log/auth.log
# if you want to rely on PAM failed login attempts
# vsftpd's failregex should match both of those formats
maxretry = 6


[proftpd]

enabled = true
port = ftp,ftp-data,ftps,ftps-data
filter = proftpd
logpath = /var/log/proftpd.log
maxretry = 6


[wuftpd]

enabled = false
port = ftp,ftp-data,ftps,ftps-data
filter = wuftpd
logpath = /var/log/auth.log
maxretry = 6


#
# Mail servers
#

[postfix]

enabled = false
port = smtp,ssmtp
filter = postfix
logpath = /var/log/mail.log


[couriersmtp]

enabled = false
port = smtp,ssmtp
filter = couriersmtp
logpath = /var/log/mail.log


#
# Mail servers authenticators: might be used for smtp,ftp,imap servers, so
# all relevant ports get banned
#

[courierauth]

enabled = false
port = smtp,ssmtp,imap2,imap3,imaps,pop3,pop3s
filter = courierlogin
logpath = /var/log/mail.log


[sasl]

enabled = false
port = smtp,ssmtp,imap2,imap3,imaps,pop3,pop3s
filter = sasl
logpath = /var/log/mail.log


# DNS Servers


# These jails block attacks against named (bind9). By default, logging is off
# with bind9 installation. You will need something like this:
#
# logging {
# channel security_file {
# file "/var/log/named/security.log" versions 3 size 30m;
# severity dynamic;
# print-time yes;
# };
# category security {
# security_file;
# };
# }
#
# in your named.conf to provide proper logging

# Word of Caution:
# Given filter can lead to DoS attack against your DNS server
# since there is no way to assure that UDP packets come from the
# real source IP
[named-refused-udp]

enabled = false
port = domain,953
protocol = udp
filter = named-refused
logpath = /var/log/named/security.log

[named-refused-tcp]

enabled = false
port = domain,953
protocol = tcp
filter = named-refused
logpath = /var/log/named/security.log
 
AW: Howto: fail2ban für CCcam installieren

@The_Patcher: das fail2ban.sh vom IPC ergängzt nur die Einträge für CCcam in der jail.conf ... Das Script hat nicht eine komplette jail.conf drinnen :)

In /etc/fail2ban/jail.conf stehen die Regeln drin auf die fail2ban zu achten hat und welche Filter verwendet werden sollen bzw steht dort " enabled = true " wenn die jeweilige Überwachung an sein soll bzw " enabled = false " wenn sie aus sein soll... (den dortigen "port =" Eintrag musst du auch noch auf deinen gesetzten CCcam SERVER LISTEN PORT einstellen)
In den Filter Dateien steht wiederum drin auf welchen Logeintrag er zu achten hat um die entsprechende Aktion auszulösen...

Öffne in deinem Fall also die Datei /etc/fail2ban/jail.conf und such dort nach nem ' cccam ' Eintrag: nano /etc/fail2ban/jail.conf ... strg+w -> cccam
Wenn dort dann schon die Regelung für zb cccam_badcmd , cccam_login und cccam_sign drin stehen, kannst du dadrunter den fehlenden für cccam_illegal dazu eintragen :)
Und dann brauchst du fail2ban nurnoch neu starten: /etc/init.d/fail2ban restart
Ob fail2ban überhaupt was macht siehst du in dem jeweiligen Log, zb: tail -f /var/log/fail2ban.log
(abbrechen mit strg+c)
 
AW: Howto: fail2ban für CCcam installieren

wie ist das eigentlich ?? Im ersten post wird als Logpath bei cccam signature, badcommand und doublelogin die daemon.log genannt!
Bei der jail vom ipc server ist aber syslog eingertragen!
welche datei ist nur richtig??
oder ich das wurst?
 
AW: Howto: fail2ban für CCcam installieren

Naja das ist von System zu System unterschiedlich, jenachdem wie es eingestellt ist... Manche haben die daemon.log zb aus, aber in der syslog landet es auf jedenfall...

Kannste bei dir ja mal prüfen: grep "CCcam:" /var/log/* | tr ":" " " | awk '{print $1}' >/tmp/1 ; nano /tmp/1

Dann werden dir haltn paa mehr Zeilen angezeigt, deswegen ne Umleitung in /tmp/1 damit du dort mit strg+v/y durchblättern kannst und dann siehst warscheinlich einmal /var/log/daemon.log , /var/log/syslog und /var/log/debug
CCcam ist nen daemon - damits überhaupt ins syslog schreibt wird CCcam im verbose/debug-modus gestartet und wenn man das debug log an hat, landet es da auch nochmal weils ja im vorbose bzw debug mode läuft um überhaupt auswerten/überwachen zu können was CCcam so tut...
 
AW: Howto: fail2ban für CCcam installieren

hi hab da ein problem, immer wenn ich in der jail.local was ändere bekomme ich diese meldung


Code:
2011-03-16 18:40:10,990 fail2ban.actions.action: ERROR  iptables -N fail2ban-vsftpd
iptables -A fail2ban-vsftpd -j RETURN
iptables -I INPUT -p tcp -m multiport --dports ftp,ftp-data,ftps,ftps-data -j fail2ban-vsftpd returned 200

Es scheint ein Problem mit der Regelung für vsftpd zu geben...
Gib die Zeilen die dort im Log stehen einfach manuell mal ein, nacheinander:
iptables -N fail2ban-vsftpd
iptables -A fail2ban-vsftpd -j RETURN
iptables -I INPUT -p tcp -m multiport --dports ftp,ftp-data,ftps,ftps-data -j fail2ban-vsftpd

Dann wird da genauer stehen warum das nicht funtzn will - das kannste dann beheben oder den vsftpd Eintrag in der jail.conf auf " enabled = false " stellen


PS: manche VPS's zb erlauben die Nutzung von iptables nicht
 
AW: Howto: fail2ban für CCcam installieren

So habe es installiert nach Post 1 das sind meine Ausgaben,(Debian 6 Uptodate CCcam 2.2.1)sollte fail2ban wenn einer gebannt wurde nicht mehr zur CCcam durchlassen???
Anhand meiner Ausgabe von Fail2ban ist User 800 gebant,aber in der CCcam Log kommt der User 800 immernoch an port 12000 an und wurde nicht wirklich gebannt???
 
Zuletzt bearbeitet:
AW: Howto: fail2ban für CCcam installieren

lol zunächst park sowas in
Code:
 und [SPOILER] damits die Seite hier nich überläd...

Als nächstes hast du in deinem Log [B]einige Fehlermeldungen[/B] die du auch beachten solltest:

[code]
2011-03-17 10:39:35,412 fail2ban.actions.action: ERROR iptables -N fail2ban-cccam_signaturefailed
iptables -A fail2ban-cccam_signaturefailed -j RETURN
iptables -I INPUT -p tcp -m multiport --dports 12000 -j fail2ban-cccam_signaturefailed returned 200
2011-03-17 10:39:35,440 fail2ban.actions.action: ERROR iptables -N fail2ban-ssh
iptables -A fail2ban-ssh -j RETURN
iptables -I INPUT -p tcp -m multiport --dports ssh -j fail2ban-ssh returned 200
2011-03-17 10:39:35,453 fail2ban.actions.action: ERROR iptables -N fail2ban-cccam_illegal
iptables -A fail2ban-cccam_illegal -j RETURN
iptables -I INPUT -p tcp -m multiport --dports 12000 -j fail2ban-cccam_illegal returned 200
2011-03-17 10:44:07,823 fail2ban.actions.action: CRITICAL Unable to restore environment

Also solange die Errors kommen wird er nicht viel ausrichten können... Auch wenn er das vllt ins Log schreibt weil fail2ban funktioniert, nur iptables wirft nen error zurück...

Um herraus zu finden wieso/weshalb/warum, guck mal bitte den einen Post vor deinem an...(ich wiederhole mich arg ungern)
 
AW: Howto: fail2ban für CCcam installieren

Es scheint ein Problem mit der Regelung für vsftpd zu geben...
Gib die Zeilen die dort im Log stehen einfach manuell mal ein, nacheinander:
iptables -N fail2ban-vsftpd
iptables -A fail2ban-vsftpd -j RETURN
iptables -I INPUT -p tcp -m multiport --dports ftp,ftp-data,ftps,ftps-data -j fail2ban-vsftpd

Dann wird da genauer stehen warum das nicht funtzn will - das kannste dann beheben oder den vsftpd Eintrag in der jail.conf auf " enabled = false " stellen


PS: manche VPS's zb erlauben die Nutzung von iptables nicht
Das habe ich natürlich gemacht bevor ich gepostet habe,hat nichts angegeben ist immer nur zur 2 Zeile gesprungen,wie gesagt hab mich an post 1 gehalten!
 
AW: Howto: fail2ban für CCcam installieren

...bitte auch nicht das Zitiern was dadrüber bereits steht....


Wenn du das manuell eingegeben hast, kann er zu keiner Zeile springen...

Du musst angemeldet sein, um Bilder zu sehen.


Hast du es genau so auch mal eingegeben?

Dann siehst du da warscheinlich die gleiche meldung wie auf dem Screenshot - BaNaNaBeck hat den ersten Post vorhin aber bereits auf mein Wunsch hin nochmals verbessert also prüf das nochmal...
 
AW: Howto: fail2ban für CCcam installieren

Ich Prüfe es nochmal und meld mich heute Abend;)
 
AW: Howto: fail2ban für CCcam installieren

@feissmaik
Ich habe die Scripts von Banna....
letzte Änderung um 00:14 glaub ich...jetzt steht 12:25?
Werde es Andern und dann berichten
 
AW: Howto: fail2ban für CCcam installieren

hallo danke für deine antwort, das komische ist das ich auf meinem vserver ändern kann wie ich will und es geht immer, ändere ich auf meinem lokalen server ( beide server debian 6.0) gibts immer diese oder eine andere z.b.
den gleichen text nur halt mit cccam_signature oder cccam_badcommand.
werde jetzt aber nochmal testen, übrigens iptables nutze ich gar nicht.

Es scheint ein Problem mit der Regelung für vsftpd zu geben...
Gib die Zeilen die dort im Log stehen einfach manuell mal ein, nacheinander:
iptables -N fail2ban-vsftpd
iptables -A fail2ban-vsftpd -j RETURN
iptables -I INPUT -p tcp -m multiport --dports ftp,ftp-data,ftps,ftps-data -j fail2ban-vsftpd

Dann wird da genauer stehen warum das nicht funtzn will - das kannste dann beheben oder den vsftpd Eintrag in der jail.conf auf " enabled = false " stellen


PS: manche VPS's zb erlauben die Nutzung von iptables nicht


habe jetzt einfach mal einen restart gemacht (vorher gings, nachdem ich die configs vom versver kopiert habe) bekomme ich jetzt die meldung für ssh, hab dann mal die zeilen eingegeben

Code:
root@debian ~ > iptables -N fail2ban-ssh
iptables: Chain already exists
 
Zuletzt bearbeitet:
Zurück
Oben