Mein Server hat Ports gescannt von dritten

NacKteOmA

New Member
Also ich habe einen Server bei Hetzner und nutze diesen NUR für Gameserver. Ich hab heute von Hetzner eine E-Mail erhalten das eine Person beschwerde eingelegt hat, weil von meiner IP die Ports dieser Person gescannt wurden. Ich bin allerdings grade ratlos wie dieses geschehen konnte.

Mein Server:
Debian ETCH (minimalinstallation)
Kernel 2.6.24.7 (Leistungstechnisch für Gameserver optimiert)
Dienste: Gameserver+vsFTP+DebianGrundinstalltion, kein Apache, E-Mail Dienst oder sonstiges

Könnt ihr mir ratschläge geben wie ich die Lücke wodurch der Angreifer wohl reingelangt ist, finden kann?

Ich würde mich freuen wenn ihr mir helfen könntet. Natürlich haben meine Dienste ihren eigenen User und werden nicht als root gestartet und Passwort der anderen User stimmt nicht mit den root Passwort überein.

Mit freundlichen Grüßen
NacKteOmA :)
 
Hi,

hilfreich wären Logauszüge oder sonst was so können wir nur raten ob dein Passwort zu einfach war oder sonst etwas also durchsuche einmal deine Logs nach auffälligen Einträgen.

Grüße
 
Welche dieser Log wären aufschlussreich?

Code:
/var/log/auth.log
/var/log/daemon.log
/var/log/dpkg.log
/var/log/faillog
/var/log/fontconfig.log
/var/log/installer/syslog
/var/log/kern.log
/var/log/lastlog
/var/log/lpr.log
/var/log/mail.log
/var/log/syslog
/var/log/user.log
/var/log/uucp.log
/var/log/vsftpd.log

Mein Passwort besteht soweit immer aus groß/kleinbuchstaben und zahlen, meine passwörter ähneln sich mit den die man z.b. von generierten Programmen zuschicken lässt, wenn man z.B. ein neu generiertes Passwort zugeschickt lässt.
 
Also in der auth.log finde ich soweit was beunruhigendes

Code:
Sep 23 12:06:29 Debian-40-etch-32-minimal sshd[31060]: Failed password for invalid user diavola from 60.248.170.146 port 2779 ssh2
Sep 23 12:06:32 Debian-40-etch-32-minimal sshd[31064]: Invalid user dragostea from 60.248.170.146
Sep 23 12:06:32 Debian-40-etch-32-minimal sshd[31064]: (pam_unix) check pass; user unknown
Sep 23 12:06:32 Debian-40-etch-32-minimal sshd[31064]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60-248-170-146.hinet-ip.hinet.net
Sep 23 12:06:34 Debian-40-etch-32-minimal sshd[31064]: Failed password for invalid user dragostea from 60.248.170.146 port 2471 ssh2
Sep 23 12:06:37 Debian-40-etch-32-minimal sshd[31068]: Invalid user me from 60.248.170.146
Sep 23 12:06:37 Debian-40-etch-32-minimal sshd[31068]: (pam_unix) check pass; user unknown
Sep 23 12:06:37 Debian-40-etch-32-minimal sshd[31068]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60-248-170-146.hinet-ip.hinet.net
Sep 23 12:06:39 Debian-40-etch-32-minimal sshd[31068]: Failed password for invalid user me from 60.248.170.146 port 1951 ssh2
Sep 23 12:06:42 Debian-40-etch-32-minimal sshd[31072]: Invalid user my from 60.248.170.146
Sep 23 12:06:42 Debian-40-etch-32-minimal sshd[31072]: (pam_unix) check pass; user unknown
Sep 23 12:06:42 Debian-40-etch-32-minimal sshd[31072]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60-248-170-146.hinet-ip.hinet.net
Sep 23 12:06:44 Debian-40-etch-32-minimal sshd[31072]: Failed password for invalid user my from 60.248.170.146 port 2615 ssh2
Sep 23 12:06:47 Debian-40-etch-32-minimal sshd[31076]: Invalid user time from 60.248.170.146
Sep 23 12:06:47 Debian-40-etch-32-minimal sshd[31076]: (pam_unix) check pass; user unknown
Sep 23 12:06:47 Debian-40-etch-32-minimal sshd[31076]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60-248-170-146.hinet-ip.hinet.net
Sep 23 12:06:49 Debian-40-etch-32-minimal sshd[31076]: Failed password for invalid user time from 60.248.170.146 port 2818 ssh2
Sep 23 12:06:52 Debian-40-etch-32-minimal sshd[31080]: Invalid user clock from 60.248.170.146
Sep 23 12:06:52 Debian-40-etch-32-minimal sshd[31080]: (pam_unix) check pass; user unknown
Sep 23 12:06:52 Debian-40-etch-32-minimal sshd[31080]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60-248-170-146.hinet-ip.hinet.net
Sep 23 12:06:55 Debian-40-etch-32-minimal sshd[31080]: Failed password for invalid user clock from 60.248.170.146 port 2392 ssh2
Sep 23 12:06:58 Debian-40-etch-32-minimal sshd[31084]: Invalid user hacker from 60.248.170.146
Sep 23 12:06:58 Debian-40-etch-32-minimal sshd[31084]: (pam_unix) check pass; user unknown
Sep 23 12:06:58 Debian-40-etch-32-minimal sshd[31084]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60-248-170-146.hinet-ip.hinet.net
Sep 23 12:07:00 Debian-40-etch-32-minimal sshd[31084]: Failed password for invalid user hacker from 60.248.170.146 port 1580 ssh2

Da versucht jemand sich mit diversen User nach Zufallsprinzip einzuloggen.


syslog

Code:
Sep 22 18:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[25961]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 22 18:44:19 Debian-40-etch-32-minimal -- MARK --
Sep 22 19:04:19 Debian-40-etch-32-minimal -- MARK --
Sep 22 19:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[25966]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 22 19:44:19 Debian-40-etch-32-minimal -- MARK --
Sep 22 20:04:19 Debian-40-etch-32-minimal -- MARK --
Sep 22 20:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[25969]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 22 20:44:19 Debian-40-etch-32-minimal -- MARK --
Sep 22 21:04:19 Debian-40-etch-32-minimal -- MARK --
Sep 22 21:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[25972]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 22 21:44:19 Debian-40-etch-32-minimal -- MARK --
Sep 22 22:04:19 Debian-40-etch-32-minimal -- MARK --
Sep 22 22:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[26919]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 22 22:44:19 Debian-40-etch-32-minimal -- MARK --
Sep 22 23:04:19 Debian-40-etch-32-minimal -- MARK --
Sep 22 23:16:10 Debian-40-etch-32-minimal kernel: UDP: short packet: From 77.205.128.114:27005 49320/55 to 78.46.73.133:27015
Sep 22 23:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[26922]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 22 23:44:19 Debian-40-etch-32-minimal -- MARK --
Sep 23 00:04:19 Debian-40-etch-32-minimal -- MARK --
Sep 23 00:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[26925]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 23 00:27:44 Debian-40-etch-32-minimal kernel: UDP: bad checksum. From 71.113.187.151:50252 to 78.46.73.133:15631 ulen 33
Sep 23 00:44:19 Debian-40-etch-32-minimal -- MARK --
Sep 23 01:04:19 Debian-40-etch-32-minimal -- MARK --
Sep 23 01:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[26929]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 23 01:44:19 Debian-40-etch-32-minimal -- MARK --
Sep 23 02:04:19 Debian-40-etch-32-minimal -- MARK --
Sep 23 02:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[28070]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 23 02:44:20 Debian-40-etch-32-minimal -- MARK --
Sep 23 03:04:20 Debian-40-etch-32-minimal -- MARK --
Sep 23 03:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[28073]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 23 03:44:20 Debian-40-etch-32-minimal -- MARK --
Sep 23 04:04:20 Debian-40-etch-32-minimal -- MARK --
Sep 23 04:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[28117]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 23 04:44:20 Debian-40-etch-32-minimal -- MARK --
Sep 23 05:04:20 Debian-40-etch-32-minimal -- MARK --
Sep 23 05:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[28240]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 23 05:44:20 Debian-40-etch-32-minimal -- MARK --
Sep 23 06:04:20 Debian-40-etch-32-minimal -- MARK --
Sep 23 06:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[28243]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 23 06:25:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[28247]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))
Sep 23 06:25:05 Debian-40-etch-32-minimal syslogd 1.4.1#18: restart.
Sep 23 06:44:20 Debian-40-etch-32-minimal -- MARK --
Sep 23 07:04:20 Debian-40-etch-32-minimal -- MARK --
Sep 23 07:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[29709]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 23 07:41:29 Debian-40-etch-32-minimal kernel: UDP: short packet: From 77.196.105.247:27005 49320/46 to 78.46.73.133:27015
Sep 23 08:04:20 Debian-40-etch-32-minimal -- MARK --
Sep 23 08:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[29712]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 23 08:44:20 Debian-40-etch-32-minimal -- MARK --
Sep 23 09:04:20 Debian-40-etch-32-minimal -- MARK --
Sep 23 09:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[29715]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 23 09:44:20 Debian-40-etch-32-minimal -- MARK --
Sep 23 10:04:20 Debian-40-etch-32-minimal -- MARK --
Sep 23 10:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[30398]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 23 10:44:20 Debian-40-etch-32-minimal -- MARK --
Sep 23 11:04:20 Debian-40-etch-32-minimal -- MARK --
Sep 23 11:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[30401]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 23 11:44:21 Debian-40-etch-32-minimal -- MARK --
Sep 23 12:04:21 Debian-40-etch-32-minimal -- MARK --
Sep 23 12:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[31089]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 23 12:44:21 Debian-40-etch-32-minimal -- MARK --
Sep 23 13:04:21 Debian-40-etch-32-minimal -- MARK --
Sep 23 13:17:01 Debian-40-etch-32-minimal /USR/SBIN/CRON[31191]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

Hier ist nur der log Eintrag von Sep 23 00:27:44 den ich nicht zuordnen kann.
 
Hm sieht soweit normal aus in der Syslog der Fehler kommt von den Gameservern kann manchmal passieren ist also nicht weiter schlimm. Gegen die Loginversuche solltest du mal fail2ban ansehen das blockiert so etwas. Hat jemand anders noch Zugriff zu deinem Server? Freunde oder so?
 
Nein, NUR ich. In den Logs kann ich auch immer sehr gut auseinander halten wer ich war und wer ich nicht war, da ich nur von zuhause am root arbeite und eine feste IP besitze.

Ich werde ich mal bei der Person melden und nachfragen um welche Uhrzeit die Ports gescannt wurden und werde dann mal genau um die Uhrzeit in die Logs schauen und davor.

die FAQ German zu fail2ban hab ich mir gerade angeschaut, scheint ein recht nützliches Programm zu sein und danke schonmal für diesen Tipp :)

Mir ist noch eingefallen ich hatte mal mtr (siehe Netzwerkdiagnose und Report an Hetzner - Hetzner DokuWiki) installiert, ich weiß nicht ob dies ding vllt. auch in der Lage ist Ports zu scannen oder wurde vllt. vom dritten ein Floodping an die Person geschickt die sich beschwert hat und die Person die sich beschwert hat es vllt. falsch gewertet hat?
 
Nur mal eine Frage wie willst du die Person fragen oO Hat Hetzner dir gesagt wer sich da beschwert hat? Das wäre mir aber sehr neu.
 
Eine weitere Möglichkeit:
-sI <zombie host[:probeport]>
Idlescan: This advanced scan method allows for a truly blind TCP port scan of
the target (meaning no packets are sent to the target from your real IP
address). Instead, a unique side-channel attack exploits predictable "IP
fragmentation ID" sequence generation on the zombie host to glean information
about the open ports on the target. IDS systems will display the scan as com*
ing from the zombie machine you specify (which must be up and meet certain
criteria). I wrote an informal paper about this technique at http://www.inse*
cure.org/nmap/idlescan.html .

Besides being extraordinarily stealthy (due to its blind nature), this scan
type permits mapping out IP-based trust relationships between machines. The
port listing shows open ports from the perspective of the zombie host. So you
can try scanning a target using various zombies that you think might be
trusted (via router/packet filter rules). Obviously this is crucial informa*
tion when prioritizing attack targets. Otherwise, you penetration testers
might have to expend considerable resources "owning" an intermediate system,
only to find out that its IP isn't even trusted by the target host/network you
are ultimately after.

You can add a colon followed by a port number if you wish to probe a particu*
lar port on the zombie host for IPID changes. Otherwise Nmap will use the
port it uses by default for "tcp pings".
-D <decoy1 [,decoy2][,ME],...>
Causes a decoy scan to be performed which makes it appear to the remote host
that the host(s) you specify as decoys are scanning the target network too.
Thus their IDS might report 5-10 port scans from unique IP addresses, but they
won't know which IP was scanning them and which were innocent decoys. While
this can be defeated through router path tracing, response-dropping, and other
"active" mechanisms, it is generally an extremely effective technique for hid*
ing your IP address.
 
Ja, Hetzner hat mir den E-Mail verkehr zwischen Hetzner und der beschwerdenen Person mitgeschickt, in der ich auch die E-Mail Adresse sehe. Ist daran etwas auszusetzen?

@LinuxAdmin leider ist mein Englisch nicht das beste und ich verstehe davon nur ein bruch teil :(
 
LinuxAdmin meint dass vielleicht jemand nur deine IP gefaked hat was via NMAP kein Problem ist ... Man kann als SourceIP auch 127.0.0.1 eintragen das muss also nicht dein Server gewesen sein.

Naja find ich nen bisschen komisch von Hetzner da die normal nicht die Leute mitschicken die einen verpfiffen haben auch um diese zu schützen aber gut vielleicht bei solchen Kleinigkeiten schon.
 
Ja, Hetzner hat mir den E-Mail verkehr zwischen Hetzner und der beschwerdenen Person mitgeschickt, in der ich auch die E-Mail Adresse sehe. Ist daran etwas auszusetzen?

Naja ich denke es geht schon bisschen gegen Datenschutz diese Die mitzuteilen... es sei denn es wurde drauf hingewiesen das die Email-Adresse weitergeleitet wurde.

Nach deutschem Recht zumindestens ist aber PortScanning legal.

Laut deinen Logs ist SO nix auffälliges zu finden.
 
So ich habe nun erstmal den SSH Bruteforcer ausgesperrt indem ich seine IP in die iptables eingetragen habe. Ich habe mal nach diesen hinet.net gegoggelt und folgendes gefunden -> HINET.net address range - Antispam e.V.

Wäre es ratsam diese IP Bereiche zu sperren aufgrund von Spam/Hacker Angriffen aus diesen Netz? Was meinen die dort mit die IP ist "merkfrei" "merkbefreit"? Ok es sind dort auch eher der Asiatische IP Raum, aber inwiefern ist es sicher das Spam/Angriffe aus diesem Netz kam (könnte ja jeder jede IP dort empfehlen)?
 
Last edited by a moderator:
Anstatt alle IPs mühsam einzeln zu sperren würde ich dir fail2ban wie vorher schon erwähnt empfehlen und gleichzeitig würde ich eventuell den SSH Port verlagern was 90% der Standard Bruteforce Attacken aussperrt und im Zusammenhang mit fail2ban bist du dann schon mal ganz gut abgesichert.

Grüße
 
An den Port habe ich auch schon gedacht, fail2ban werden ich auf jedenfall drauf hauen. Allerdings könnte ich z.b. meine andere Server damit noch besser Schützen z.b. gegen Spam Mails wenn die tatsächlich zu einen guten teil aus diesen IP bereichen kommen (auch wenn ich dafür z.b. spamassain nutze was gut klappt).
 
Also habe mich heute mal dran gesetzt und wollte fail2ban installieren, allerdings fehlen dazu die paket phyton und phyton-central, phyton-central benötigt erstmal phyton, phyton benötigt aber auch wieder paket die ich nicht installiert habe, da waren so 1-2 libs dabei und nach ein paar anderen. Jetzt erahne ich erstmal das es immer so weiter geht.

Ich möchte jetzt nicht für jeden kleines ding da ne .deb runterladen. apt-get kannte soweit keins dieser Pakete (so viel habe ich bisher noch nicht mit apt-get gearbeitet, weil ich debian nur für diesen root nutze), kann ich weitere sourcequellen für apt-get eintragen damit er diesen kennt und ich die pakete via apt-get install paket installieren kann bzw. gibt es für sollche pakete überhaupt ne gute sourcequelle die mit atp arbeitet?
 
So ich hab nun ne weitere Sourcequelle hinzugefügt, ich hoffe mal ich hab das soweit das die quelle und meinen optionen dazu ok sind.

source.list - habe dieses hinzugefügt
Code:
deb      http://ftp.de.debian.org/debian/ etch main non-free contrib
deb-src  http://ftp.de.debian.org/debian/ etch main non-free contrib

Danach war Fail2Ban installieren kein Problem. Ich hab Fail2Ban so konfiguriert, nach einen HowTo, ist das soweit ok oder wie habt ihr es konfiguriert?

fail2ban.conf
Code:
# Fail2Ban configuration file
#
# Author: Cyril Jaquier
#
# $Revision: 412 $
#

[Definition]

# Option:  loglevel
# Notes.:  Set the log level output.
#          1 = ERROR
#          2 = WARN
#          3 = INFO
#          4 = DEBUG
# Values:  NUM  Default:  3
#
loglevel = 3

# Option:  logtarget
# Notes.:  Set the log target. This could be a file, SYSLOG, STDERR.
# Values:  STDERR SYSLOG file  Default:  /var/log/fail2ban.log
#
logtarget = /var/log/fail2ban.log

# Option: socket
# Notes.: Set the socket file. This is used to communication with the
#         daemon.
# Values: FILE  Default:  /tmp/fail2ban.sock
#
socket = /tmp/fail2ban.sock

maxfailures = 3
bantime = 900
ignoreip = xxx.xxx.xxx.xxx <- hier steht meine festeIP

[SSH]
enabled = true
logfile = /var/log/auth.log
port = 22
timeregex = S{3}s{1,2}d{1,2} d{2}:d{2}:d{2}
timepattern = %%b %%d %%H:%%M:%%S
failregex = : (?:(?:Authentication failure|Failed [-/w+]+) for(?: [iI](?:llegal|nvalid) user)?|[Ii](?:llegal|nvalid) user|ROOT LOGIN REFUSED) .*(?: from|FROM) (?:::f{4,6}:)?(?PS*)
 
Wenn Du noch nicht viel mit apt-get gearbeitet hast, wie hälst Du dann Deinen
Server aktuell? Mit aptitude? Selber-kompilieren? Oder garnicht?

Ich meine, z.b. VSFTP wurde vor nicht allzu langer Zeit gefixt.
 
Es war damit eher gemeint, das ich im umgang noch nicht so vertieft damit war. Nicht das ich es nicht kenne oder nicht nutze, aber die sourcelist die von Hetzner drauf war, war eher mehr als dürftig.
 
Back
Top