Menu

Port knocking basic usage

Christophe GARCIA

Port knocking client - Basic usage

Creating the client

Available constructors for this port knocking client is as simple as possible and only needs the address of the server that will be knocked !

PortKnockingClient pk = new PortKnockingClient("pkserver.domain.com");

Prepare and dial the secret

Target TCP/UDP ports :
pk.addOpenUdpPort(2222);
pk.addOpenTcpPort(3333);
Sleep a bit ;o) :
pk.addSleep();        // default = 100ms
pk.addSleep(1000);    // custom length sleep. Here = 1000ms = 1s
Dial the secret :
pk.doSecret();

Complete example

Example 1
PortKnockingClient pk = new PortKnockingClient("pkserver.domain.com");

pk.addOpenUdpPort(2222);
pk.addOpenTcpPort(3333);
pk.addOpenUdpPort(4444);

pk.doSecret();
Example 2
PortKnockingClient pk = new PortKnockingClient("pkserver.domain.com");

pk.addOpenUdpPort(2222);
pk.addSleep();
pk.addOpenTcpPort(3333);
pk.addSleep(1000);
pk.addOpenUdpPort(4444);

pk.doSecret();