LoginSignup
0
0

More than 3 years have passed since last update.

telnet コマンドの代替としての StreamRelay.NET.exe

Posted at

telnet コマンドの代替としての StreamRelay.NET.exe

ver3.5.2.0 より、TelnetLib.dll を同梱して、「-RemoteProxy」オプションに telnet スキームを新設した。


スキームの仕様

仕様はこんな感じ

telnet://≪ユーザ名≫:≪パスワード≫@/≪コマンド1≫/≪コマンド2≫...?≪オプション≫

≪コマンドn≫ は、ログイン後に自動発行するコマンドの羅列。


スキームのオプション

≪オプション≫は、以下を用意した(ver3.5.2.1)

NTLM
NTLM認証をする
user=≪プロンプトメッセージ≫
既定は「login:」を監視して、その後にユーザ名を送信するが、この文字列を変更できる
pass=≪プロンプトメッセージ≫
既定は「password:」を監視して、その後にパスワードを送信するが、この文字列を変更できる

使用例

単純に、「192.0.2.4:23」のTelnetサーバに「ユーザ名=user、パスワード=password」で接続するには

StreamRelay.NET.exe -LocalPort 0 -RemotePort 23 -RemoteHost 192.0.2.4 -RemoteProxy telnet://user:password@/

こんな感じ。

単純に、「192.0.2.4:23」のTelnetサーバに「ユーザ名=user、パスワード=password」で接続して、直後に「dir」「ipconfig」を実行させたい場合は、

StreamRelay.NET.exe -LocalPort 0 -RemotePort 23 -RemoteHost 192.0.2.4 -RemoteProxy telnet://user:password@/dir/ipconfig

こんな感じ。

単純に、「192.0.2.4:23」のTelnetサーバに「ユーザ名=user、パスワード=password」で接続して、直後に「dir」「ipconfig」を実行させて切断したい場合は、

StreamRelay.NET.exe -LocalPort 0 -RemotePort 23 -RemoteHost 192.0.2.4 -RemoteProxy telnet://user:password@/dir/ipconfig/exit

こんな感じ。

一応、TelnetLib.dll には NTLM認証もあるので、、

StreamRelay.NET.exe -LocalPort 0 -RemotePort 23 -RemoteHost 192.0.2.4 -RemoteProxy telnet:///dir/ipconfig?NTLM

でできるかも知れない。(開発環境ではうまく動作しない)

対象のTelnetサーバのログインプロンプトが「user:」でパスワードプロンプトが「passphrase:」の場合は、

StreamRelay.NET.exe -LocalPort 0 -RemotePort 23 -RemoteHost 192.0.2.4 -RemoteProxy telnet://user:password@/dir/ipconfig/exit?user=user:&pass=passphrase:

こんな感じ。


目次へ戻る

目次というか最初の一歩

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