portknocking not work

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
faustf
Level 1
Level 1
Posts: 43
Joined: Thu Apr 27, 2017 7:54 pm

portknocking not work

Post by faustf »

hi guys i have a little problem with portknocking in port 22
i have a "server 192.168.1.106" with open ssh , i configure iptables like this

Code: Select all

sudo iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 5900 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 5800 -j ACCEPT
-A INPUT -j DROP
and i follow this tutorial
https://help.ubuntu.com/community/PortKnocking
and i use example 1
in client side i run a command

Code: Select all

 knock -v 192.168.1.106 7000 8000 9000
hitting tcp 192.168.1.106:7000
hitting tcp 192.168.1.106:8000
hitting tcp 192.168.1.106:9000
but after and before a command knock , if i run nmpa i have this answer

Code: Select all

Starting Nmap 6.40 ( http://nmap.org ) at 2018-02-01 21:51 CET
Nmap scan report for 192.168.1.106
Host is up.
All 1000 scanned ports on 192.168.1.106 are filtered

Nmap done: 1 IP address (1 host up) scanned in 201.30 seconds
and obviusly if i try to connect with ssh not connect

the log file is blank

anyone can help me ??? thankz at all
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: portknocking not work

Post by catweazel »

faustf wrote:port 22
Try port 2200. Ports below 1024 are protected in linux.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Locked

Return to “Networking”