Whos Online

Joomla

We have 238 guests and 0 members online

    Forums

    We have 19 guests and 0 members online

      Tags

      android (7) anonymity (9) ant (10) apache (54) apple (7) atv (18) australia (8) bernardet (7) bombardier (7) book (7) browser (10) business (8) caliber30 (61) canon (9) cedricwalter (6) checklist (9) chrome (6) classpath (6) collection (7) continuousbuild (24) design (13) designpattern (23) desktop (7) development (28) DIY (9) download (6) draganflyer5 (9) dslr (14) eclipse (30) ek4 (8) electronic (18) enfrancais (66) event (6) FAQ (6) figures (13) firefox (20) firmware (7) flash (9) flickr (6) framework (12) fud (9) game (19) gaming (6) google (66) gpl (8) gps (9) hacking (23) hdtv (7) hollidays (15) homecinema (14) homepage (20) howto (65) innoveo (7) iphone (6) italy (10) itsatrap (8) java (73) javascript (11) joke (11) joomla (214) joomla15 (33) joomlacloud (7) junit (9) kde (10) kyosho (62) links (17) linux (121) LittleBigPlanet (16) mambo (18) manual (8) manurhin (9) maps (6) maven (35) mediacenter (9) microsoft (52) modding (10) module (16) morespeed (16) motor (8) motorcycle (13) myhomepage (14) mysql (14) nas (14) neogeo (20) opencomment (27) opensource (61) opensuse (10) oss (7) p2p (7) patch (32) pc (12) pdf (8) php (25) picasa (7) plugin (65) privacy (9) projector (11) protection (7) ps3 (42) publicity (9) quad (18) raptor30 (7) rchelicopter (161) references (6) review (32) robot (9) robotic (7) rss (8) safety (8) scooter (29) security (61) securityimage (8) securityimage3 (6) securityimage4 (21) securityimage5 (19) securityimages (14) securityimages5 (6) server (17) simulator (8) smugmug (12) snk (16) software (31) sony (38) spammer (7) statistics (13) storage (7) subversion (6) suse (12) switzerland (7) teamcity (15) testing (9) thundertiger (20) tips (31) tomcat (7) tomtom (7) translatetofrench (8) trip (17) troubleshooting (7) tutorial (9) upgrade (15) vespa (10) video (17) vintage (8) watercooling (9) web2.0 (26) windows (14) xbmc (7) xbox (10) zurich (16) zürich (11)

      My status
      Facebook Digg LinkedIn MySpace Twitter Playstation network Xbox Live
      Digg Del.icio.us Reddit Simpy StumbleUpon Ask Facebook Slashdot Backflip Spurl MisterWong Netvouz Diigo Segnalo RawSugar Shadows Google Furl Newsvine Yahoo Technorati Live Blogmarks Netscape Fark Wink LinkaGoGo Bibsonomy FeedMe Magnolia Blue Tailrank Del.irio.us Y PlugIM SpotBack LinkSwarm

      Donation

      Thank You for supporting my work
      Click Here to make a donation

      Gallery

      Implement SSH port knocking on OpenSuSE Print E-mail
      User Rating: / 0
      PoorBest 
      Friday, 03 July 2009 21:02

      port.knocking.ssh.linux

      Port Knocking is a technique to secure services behind a firewall until a specific knock sequence is given. Once that sequence is given, the IP address that initiated the knock may be allowed to access the service for a short period of time. A knocking server listens to all traffic on an Ethernet (or PPP) interface, looking for special "knock" sequences of port-hits. A client makes these port-hits by sending a TCP (or UDP) packet to a port on the server.

      This is a bit paranoid, but it add another layer of security, an attacker will have either to try all ports combinations or know the secret combination (knock) to be able to connect to your SSH daemon for example.

      First, you’ll have to be sure to have a port knocking client, or you will be kick out forever of your own server!

      Define the secret knocking sequence

      I will take the default sequence of knockd as an example

      1. 2222:udp
      2. 3333:tcp
      3. 4444:udp
      4. .. but you can add more port and not follow any pattern like above.

      Install a Knocking server on OpenSuSE

      As root of course

      # zypper se knockd

      Change the configuration file

      # vi /etc/knockd.conf 

      Below is the default content

      [options]
              UseSyslog

      [opencloseSSH]
              sequence      = 2222:udp,3333:tcp,4444:udp
              seq_timeout   = 15
              tcpflags      = syn,ack
              start_command = /usr/sbin/iptables -I INPUT 1 -s %IP% -p tcp --dport ssh -j ACCEPT
              cmd_timeout   = 10
              stop_command  = /usr/sbin/iptables -D INPUT -s %IP% -p tcp --dport ssh -j ACCEPT

      Which is quite readable:

      • A wrong knock expire after 15 seconds
      • A successful knock, open for 10 seconds the firewall. The daemon will open a hole for the knocking %IP% source on port 22 (ssh), plenty of time for you to connect!
      • start_command add an IPTABLE rule in the firewall to allow the connection while
      • stop_command  close the connection

      Starting the daemon

      Check first if there is not any conflicting ssh rules

      # iptables -L | grep ssh

      Start the server

      # rcknockd start

      and monitor the logs file

      # tail -f /var/log/knockd.log

      You can now install a knock client..

      Install a knocking client under windows

      I’ll use the command line client, put the following in a .bat or .sh file

      knock.exe -v myserverIP 2222:udp 3333:tcp 4444:udp

      then run it once. You now have 10 second to open a ssh session with either Putty

      PuTTY is an SSH and telnet client, developed originally by Simon Tatham for the Windows platform. PuTTY is open source software that is available with source code and is developed and supported by a group of volunteers.

      You can download PuTTY here.

      or Cygwin ssh.

      Cygwin is a Linux-like environment for Windows. It consists of two parts:

      • A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing substantial Linux API functionality.
      • A collection of tools which provide Linux look and feel.

      And under  the iPhone?

      Luckily there is a FREE application for that!  iPhone Knock Client

       

      port.knocking.iphone

      Tags See All Tags Add New Tag...

      Please Enter New Tags Separated By Comma's
        Or Close

      linux  security  ssh 



      Comments
      Add New Search RSS
      +/-
      Write comment
      Name:
      Email:
       
      Website:
      Title:
      UBBCode:
      [b] [i] [u] [url] [quote] [code] [img] 
       
       
      :):grin;)8):p:roll:eek:upset:zzz:sigh:?:cry
      :(:x
       
      Please input the anti-spam code that you can read in the image.
      Last Updated on Friday, 03 July 2009 19:03
       

      Top 200 Tags

      Want to put your ad banner here, contact us