Portknocking - Erfahrungen und Empfehlungen -HILFE, kein Doorman-Makefile

Rund um die Sicherheit des Systems und die Applikationen
tomotom
Posts: 330
Joined: 2006-09-22 13:37
 

Portknocking - Erfahrungen und Empfehlungen -HILFE, kein Doorman-Makefile

Post by tomotom »

Ich stehe vor der Frage ob und wie ich bestimmte Ports nur für bestimmte IPs öffnen kann. Denken tue ich besonders an ssh und ftp.


Wie sind Eure Erfahrungen mit Portknocking?

Was für tools setzt Ihr wozu ein und was für Erfahrungen habt Ihr damit gemacht? Welche tools sind empfehlenswert?
Last edited by tomotom on 2006-10-30 23:16, edited 1 time in total.
tommbutu
Posts: 70
Joined: 2005-11-23 00:56
 

Re: Portknocking - Erfahrungen und Empfehlungen

Post by tommbutu »

tomotom wrote:Ich stehe vor der Frage ob und wie ich bestimmte Ports nur für bestimmte IPs öffnen kann. Denken tue ich besonders an ssh und ftp.
also "bestimmte Ports nur für bestimmte IPs" und portknocking sind doch zwei verschiedene paar schuhe oder nicht. wenn es nur "bestimmte Ports nur für bestimmte IPs" sein soll reicht es doch ssh auf port xy und ip auf port yx zu setzen...für zweit genanntes gibt es http://www.portknocking.org <<< die kennst du schon?
tomotom
Posts: 330
Joined: 2006-09-22 13:37
 

Re: Portknocking - Erfahrungen und Empfehlungen

Post by tomotom »

tommbutu wrote: also "bestimmte Ports nur für bestimmte IPs" und portknocking sind doch zwei verschiedene paar schuhe oder nicht...
Gemeint sind ports für authentifizierte user IPs temporär öffnen. Portknocking wäre da eine Möglichkeit.

Vielleicht gibt es da auch etwas web basiertes: Ein User gibt sein Passwort und den freizugebenden Port ein und für seine IP wird der Port geöffnet so lange wie seine Sitzung dauert. Da ich weder Portknocking noch ähnliches zum öffnen von Ports verwendet habe frage ich mich was da empfehlenswert ist.
tomotom
Posts: 330
Joined: 2006-09-22 13:37
 

Re: Portknocking - Erfahrungen und Empfehlungen

Post by tomotom »

tomotom wrote: Gemeint sind ports für authentifizierte user IPs temporär öffnen. Portknocking wäre da eine Möglichkeit.
Hier habe ich das gefunden wonach ich gesucht habe:
http://de.gentoo-wiki.com/Port_Knocking.

Weiß jemand wie man unter windows 1 sek. vor ssh-login mit Putty automatisiert anklopft? :-)
Wie kann man die beiden Programme per script verbinden?
codc
Posts: 97
Joined: 2004-01-08 02:55
Location: Tübingen
 

Re: Portknocking - Erfahrungen und Empfehlungen

Post by codc »

tomotom wrote:
tomotom wrote: Gemeint sind ports für authentifizierte user IPs temporär öffnen. Portknocking wäre da eine Möglichkeit.
Hier habe ich das gefunden wonach ich gesucht habe:
http://de.gentoo-wiki.com/Port_Knocking.

Weiß jemand wie man unter windows 1 sek. vor ssh-login mit Putty automatisiert anklopft? :-)
Wie kann man die beiden Programme per script verbinden?
Kleine Batchdatei:

Code: Select all

.knockknock -v example.com 1234 5678 9111
.puttyputty -ssh user@example.com
Hab selber bei meinen Heimserver den sshd mit portknocking/iptables gesichert. Ich benutze da den knockd aus den Debian Paketen.

Den knock-Client für Windows findet man mit Google wenn ich das noch recht im Griff habe.

Ich hab damals eine Anleitung für Debian dazu geschrieben weil ich seinerzeit nichts im Netz gefunden habe. Den Link hab ich zwar glaube ich hier schon mal gepostet aber ...

http://www.kai-oesterreich.de/portknocking.html
tomotom
Posts: 330
Joined: 2006-09-22 13:37
 

Re: Portknocking - Erfahrungen und Empfehlungen -HILFE, kein Doorman-Makefile

Post by tomotom »

Hat jemand schon mal doorman unter debian sarge installiert?
http://doorman.sourceforge.net/

Leider klappt das mit dem makefile nicht. Ich habe schon diverse Pakete nachinstalliert aber leider klappts nicht. Auch in der Doku habe ich nicht brauchbares gefunden.

Fehler:

Code: Select all

doormand.o(.text+0x204e): In function `main':
/usr/src/doorman-0.81/doormand.c:1291: undefined reference to `prepare_guestlist'
collect2: ld returned 1 exit status
make[1]: *** [doormand] Fehler 1
make[1]: Leaving directory `/usr/src/doorman-0.81'
make: *** [all] Fehler 2
lord_pinhead
Posts: 774
Joined: 2004-04-26 15:57
 

Re: Portknocking - Erfahrungen und Empfehlungen -HILFE, kein Doorman-Makefile

Post by lord_pinhead »

Man kann bei Doormans knock.exe gleich das ssh Kommando abzusetzen mittels "knock.exe -r"ssh root@myhost" ....", also braucht man nicht unbedingt eine Batch, es reicht ein Programmlink.

@tomotom
Also bei mir lief das jetzt zum Test, was sagt dein configure durchlauf?
tomotom
Posts: 330
Joined: 2006-09-22 13:37
 

Re: Portknocking - Erfahrungen und Empfehlungen -HILFE, kein Doorman-Makefile

Post by tomotom »

Lord_Pinhead wrote:Man kann bei Doormans knock.exe gleich das ssh Kommando abzusetzen mittels "knock.exe -r"ssh root@myhost" ....", also braucht man nicht unbedingt eine Batch, es reicht ein Programmlink.
Z.Z. läuft bei mir der knockd als dep-paket und knock.exe. Da geht es glaube ich nur mit einer Batchdatei. Diese sieht bei mir jetzt so aus:

Code: Select all

start "" c:winntknock.exe -v 1.2.3.4 100 222 933
start "" I:ProgrammePuTTY.exe -load "1.2.3.4 "
exit
Lord_Pinhead wrote: @tomotom
Also bei mir lief das jetzt zum Test, was sagt dein configure durchlauf?
Tatsächlich interesseirt mich aber sehr der doorman weil mal da Gruppen vergeben ist und das ganze codiert übertragen wird. Leider klappt die Installation nicht. Mein configure sieht so aus:

Code: Select all

12:/usr/src/doorman-0.81# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking whether gcc needs -traditional... no
checking for an ANSI C-conforming const... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ANSI C... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking for flex... flex
checking for yywrap in -lfl... yes
checking lex output file root... lex.yy
checking whether yytext is a pointer... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for lsof... /usr/bin/lsof
checking netinet/in_systm.h usability... yes
checking netinet/in_systm.h presence... yes
checking for netinet/in_systm.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for netinet/tcp.h... yes
checking for netinet/udp.h... yes
checking pcap.h usability... yes
checking pcap.h presence... yes
checking for pcap.h... yes
checking pcap/pcap.h usability... no
checking pcap/pcap.h presence... no
checking for pcap/pcap.h... no
checking sys/cdefs.h usability... yes
checking sys/cdefs.h presence... yes
checking for sys/cdefs.h... yes
checking sys/sockio.h usability... no
checking sys/sockio.h presence... no
checking for sys/sockio.h... no
checking for MD5Init... no
checking for hmac_md5... no
checking for daemon... yes
checking for strsignal... yes
checking for library containing socket... none required
checking for library containing yywrap... -lfl
checking for library containing gethostbyname... none required
checking for library containing pcap_open_live... -lpcap
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands