Solusi 1:
Saya mengalami masalah yang sama. Anda dapat menyelesaikannya dengan cara ini:
# Removes the old package
yum erase nc
# Manually downloads the working package from the Official Repository
wget http://vault.centos.org/6.6/os/x86_64/Packages/nc-1.84-22.el6.x86_64.rpm
# Installs the package
rpm -iUv nc-1.84-22.el6.x86_64.rpm
Harap diperhatikan bahwa paket ini untuk x86_64
(64-bit). Jika Anda membutuhkan i386
(32-bit), yang benar adalah:
wget http://vault.centos.org/6.6/os/i386/Packages/nc-1.84-22.el6.i686.rpm
Solusi 2:
Versi khusus netcat ini memiliki bug. Sampai ada perbaikan untuk itu, satu-satunya hal yang dapat Anda lakukan adalah menurunkan versi ke versi sebelumnya - sudo yum remove nc-1.84-24.el6.x86_64; sudo yum install nc-1.84-22.el6.x86_64
harus melakukan trik.
Solusi 3:
Menjawab pertanyaan:
- YA, downgrade diperlukan agar nc dapat mendengarkan. Dan untuk komentar lainnya:
a) -p tidak seharusnya digunakan saat dalam mode mendengarkan. dari halaman manual nc:
-l Digunakan untuk menentukan bahwa nc harus mendengarkan koneksi masuk daripada memulai koneksi ke host jarak jauh. Merupakan kesalahan untuk menggunakan opsi ini bersamaan dengan opsi -p, -s, atau -z.
b) downgrade dapat dilakukan dalam satu langkah, perintah yum downgrade bekerja dengan url ke paket:
$ rpm -q nc
nc-1.84-24.el6.x86_64
$ nc -l 12345 #Although the syntax is correct, the command fails
nc: Protocol not available
$ nc -l -p 12345 #attempt to run with incorrect syntax
usage: nc [-46DdhklnrStUuvzC] [-i interval] [-p source_port]
[-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_version]
[-x proxy_address[:port]] [hostname] [port[s]]
$ sudo yum downgrade http://vault.centos.org/6.6/os/x86_64/Packages/nc-1.84-22.el6.x86_64.rpm #shortcut to downgrade
...
Setting up Downgrade Process
nc-1.84-22.el6.x86_64.rpm | 57 kB 00:00
Examining /var/tmp/yum-root-Iq4yc7/nc-1.84-22.el6.x86_64.rpm: nc-1.84-22.el6.x86_64
Resolving Dependencies
--> Running transaction check
---> Package nc.x86_64 0:1.84-22.el6 will be a downgrade
---> Package nc.x86_64 0:1.84-24.el6 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================
Package Arch Version Repository Size
==============================================================================================================
Downgrading:
nc x86_64 1.84-22.el6 /nc-1.84-22.el6.x86_64 109 k
Transaction Summary
==============================================================================================================
Downgrade 1 Package(s)
Total size: 109 k
Is this ok [y/N]: y
...
Removed:
nc.x86_64 0:1.84-24.el6
Installed:
nc.x86_64 0:1.84-22.el6
Complete!
$ nc -l -p 12345 #attempt to run with incorrect syntax
usage: nc [-46DdhklnrStUuvzC] [-i interval] [-p source_port]
[-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_version]
[-x proxy_address[:port]] [hostname] [port[s]]
$ nc -l 12345 # try to listen again
^C
$#nc successully opens a socket on 12345. had to stop it with ctrl+C