LinuxにNetCatをインストールする



Install Netcat Linux



簡単な説明:

ネットワークツールの中でも「スイスアーミーナイフ」として定評のあるNetCat(以下、nc)は、N年間使用した後も手元にあります。短くてパワフルなので(これは非常に適しているので、一部の人はそれを約10Kに変更し、機能は低下しません)。
TCPまたはUDPプロトコルを使用してネットワーク接続を介してデータを読み書きするためのシンプルで便利なツール。これは、他のプログラムやスクリプトから直接簡単に駆動できる安定したバックドアツールとして設計されています。

インストール方法1:yumインストール

yum install -y netcat
または
yum install -y nc



インストール方法2:コンパイルしてインストールする

1.ダウンロード

https://download.csdn.net/download/z1941563559/10577879

2. Linuxサーバーにアップロードし、解凍します

netcat-0.7.1.tar.gzが配置されているディレクトリに移動し、次のコマンドを実行します。
tar -zxvf netcat-0.7.1.tar.gz -C / usr / local /



3.netcatをコンパイルしてインストールします

解凍したディレクトリに入る
cd /usr/local/netcat-0.7.1/

コマンドを実行して、コンパイルしてインストールします。
[root @ xxxxx netcat-0.7.1]#。/ configure –prefix = / usr / local / netcat

アウト違うエラー アウトナウ間違ったエラーの下で:
画像



エラーの原因はgccコンパイラがないことです。yumを使用してgccをインストールできます。
[root @ xxxxx netcat-0.7.1] #yum install -y gcc

再びそれを行う
[root @ xxxxx netcat-0.7.1]#。/ configure –prefix = / usr / local / netcat

コンパイルしてインストールする
[root @ xxxxx netcat-0.7.1] #make && make install

コンパイルして正常にインストールし、netcatディレクトリに入ります。
[root @ xxxxx netcat-0.7.1] #cd / usr / local / netcat
[root @ xxxxx netcat] #ll
合計16
drwxr-xr-x。 2ルートルート4096Aug 1 20:40 bin
drwxr-xr-x。 2ルートルート4096Aug 120:40情報
drwxr-xr-x。 3ルートルート4096Aug 120:40男
drwxr-xr-x。 3ルートルート4096Aug 120:40共有

注意この場所/usr/lまたはcl/nですtct-0.7.1/段階いつソースコードテキストピースアン服装作る値するテキストピースはい/usr/lまたはcl/nですtctこのできる意志/usr/lまたはcl/nですtct-0.7.1/削除を除いて 注:この場所/ usr / local / netcat − 0.7.1 /フェーズコードをソースコードするときテキストピース、テキストピースのメリットを生む服はい/ usr / local / netcat、これはできますTo will / usr / local / netcat − 0.7.1 /削除を除く

4.環境変数を構成します

[root @ xxxxx netcat] #vi / etc / profile

export NETCAT_HOME=/usr/local/netcat export PATH=$PATH:$NETCAT_HOME/bin

構成ファイルをリロードします。
[root @ xxxxx netcat] #source / etc / profile

5.インストールが成功したかどうかをテストします

nc –help
またはnetcat--help

インストールが成功した場合の影響:

[root@xxxxx netcat]# nc --help GNU netcat 0.7.1, a rewrite of the famous networking tool. Basic usages: connect to somewhere: nc [options] hostname port [port] ... listen for inbound: nc -l -p port [options] [hostname] [port] ... tunnel to somewhere: nc -L hostname:port -p port [options] Mandatory arguments to long options are mandatory for short options too. Options: -c, --close close connection on EOF from stdin -e, --exec=PROGRAM program to exec after connect -g, --gateway=LIST source-routing hop point[s], up to 8 -G, --pointer=NUM source-routing pointer: 4, 8, 12, ... -h, --help display this help and exit -i, --interval=SECS delay interval for lines sent, ports scanned -l, --listen listen mode, for inbound connects -L, --tunnel=ADDRESS:PORT forward local port to remote address -n, --dont-resolve numeric-only IP addresses, no DNS -o, --output=FILE output hexdump traffic to FILE (implies -x) -p, --local-port=NUM local port number -r, --randomize randomize local and remote ports -s, --source=ADDRESS local source address (ip or hostname) -t, --tcp TCP mode (default) -T, --telnet answer using TELNET negotiation -u, --udp UDP mode -v, --verbose verbose (use twice to be more verbose) -V, --version output version information and exit -x, --hexdump hexdump incoming and outgoing traffic -w, --wait=SECS timeout for connects and final net reads -z, --zero zero-I/O mode (used for scanning) Remote port number can also be specified as range. Example: '1-1024'