我正在尝试让netcat在端口4444上进行侦听,但似乎无法正常工作。我正在检查是否使用nmap打开了端口,但是它没有接好它,我也不知道为什么。我已经尝试了各种端口,没有任何喜悦。
这是我的终端机的副本,因此您可以看到我在做什么和尝试过的事情:
#iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
# nmap localhost -p 4444
Starting Nmap 5.61TEST4 ( http://nmap.org ) at 2012-07-31 16:37 BST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00019s latency).
Other addresses for localhost (not scanned): 127.0.0.1
PORT STATE SERVICE
4444/tcp closed krb524
Nmap done: 1 IP address (1 host up) scanned in 0.10 seconds
# nc -l 4444 &
[1] 1951
# nmap localhost -p 1-65535
Starting Nmap 5.61TEST4 ( http://nmap.org ) at 2012-07-31 16:42 BST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0000070s latency).
Other addresses for localhost (not scanned): 127.0.0.1
Not shown: 65532 closed ports
PORT STATE SERVICE
22/tcp open ssh
7337/tcp open unknown
33507/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 1.37 seconds
# ps -e | grep nc
12 ? 00:00:00 sync_supers
1156 tty1 00:00:00 ck-launch-sessi
1232 tty1 00:00:00 dbus-launch
1274 ? 00:00:00 klauncher
1951 pts/2 00:00:00 nc
-lp
我相信该语法来自霍比特人的原始版本。从BSD派生的版本禁止-p
与with一起使用-l
。许多人不支持-e
。始终检查安装的手册页或-h
选项输出。