Practical Secure Port Knocking
By John Graham-Cumming, November 01, 2004
Source Code Accompanies This Article. Download It Now.
Port knocking allows access to sensitive ports if you know the secret knock. John implements it using "Tumbler."
November, 2004: Practical Secure Port Knocking
my ($sec,$min,$hour,$mday,$mon,$year) = gmtime(time);
my ($my_port,$my_ip) = sockaddr_in($socket->sockname);
my $me = inet_ntoa($my_ip);
my $hash = sha256_hex("$year$mon$mday$hour$min:$me:$secret");
$socket->send( "TUMBLER1: $hash" );
Example 3: A script named "tumbler" sends the knock.