Life is fun and easy!
不正IP報告数
Okan Sensor
ページへ戻る
− Links
印刷
SecurityTool/masscan/mac
の編集 ::
UJP
tech_regist2
:
SecurityTool
/
masscan
/
mac
の編集
SecurityTool/masscan/mac の編集
詳細な入力項目を表示
ページタイトル
( 空白で自動設定 )
:
ページ並び順
( 0-9 小数可 標準:1 )
:
ページ別名
(複数は[
改行
]で区切る)
:
ページ内容:
*macosでmasscanを使ってみる [#ne0dc2c4] **はじめに [#q31018c6] IoTなどもあるので自分のネットワーク上に何が存在しているかわからない今日この頃.ネットワークスキャンのMasscanを使って,「ネットワーク上に存在している何か」を探してみようと思う. MasscanはIPv4の指定したアドレス空間を高速にスキャンするために作成されたツールの1つで,調査目的で使えるということで攻撃者も使うツールとして知られる. つまり,使い方を間違えれば,自分自身が攻撃者として扱われる可能性もあるので,慎重に使わなければならないツールであることに注意する. **インストール [#o6d4d6ac] 今回もHomeBrewでインストール. まずは情報を確認. $ brew info masscan🆑 masscan: stable 1.0.5 (bottled), HEAD TCP port scanner, scans entire Internet in under 5 minutes https://github.com/robertdavidgraham/masscan/ Not installed From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/masscan.rb ==> Options --HEAD Install HEAD version ==> Analytics install: 274 (30 days), 861 (90 days), 3,435 (365 days) install-on-request: 274 (30 days), 856 (90 days), 3,388 (365 days) build-error: 0 (30 days) $ 1年で3435インストールというのは,多いいのか少ないのか. 気にせずインストールしてみる. $ brew install masscan🆑 Updating Homebrew... ==> Auto-updated Homebrew! Updated Homebrew from a1939cfe7 to 99a8f15fb. Updated 2 taps (homebrew/core and homebrew/cask). ==> New Formulae cargo-c devdash monolith postgresql@11 ==> Updated Formulae nss ✔ cstore_fdw fluxctl gwyddion maxwell pgroonga pspg streamlink wget ✔ dcos-cli gcc@6 haproxy n pgrouting restic stunnel awscli eslint gcc@8 helmfile navi phpmyadmin salt temporal_tables babel evince gitleaks juju nsd postgis scipy terrahub cfn-lint exploitdb glooctl libpq paket postgresql simple-scan wal2json citus file-roller goreleaser libpqxx pgloader proftpd sn0int yelp-tools ==> Downloading https://homebrew.bintray.com/bottles/masscan-1.0.5.high_sierra.bottle.tar.gz ######################################################################## 100.0% ==> Pouring masscan-1.0.5.high_sierra.bottle.tar.gz 🍺 /usr/local/Cellar/masscan/1.0.5: 5 files, 284.6KB $ 問題なく完了. **masscanを使って80番ポートをスキャン [#d6f8028e] まず簡単に使って見る. ポート80番(HTTP)でlocalhostをスキャン. $ /usr/local/bin/masscan -p80 127.0.0.1🆑 FAIL: en0: You don't have permission to capture on that device ((cannot open BPF device) /dev/bpf0: Permission denied) [hint] need to sudo or run as root or something [hint] I've got some local priv escalation 0days that might work adapter[en0].init: failed $ root権限が必要だそうだ. sudoして実行する. $ sudo /usr/local/bin/masscan -p80 127.0.0.1🆑 Password:🆑 Starting masscan 1.0.4 (http://bit.ly/14GZzcT) at 2019-11-24 11:24:55 GMT -- forced options: -sS -Pn -n --randomize-hosts -v --send-eth Initiating SYN Stealth Scan Scanning 1 hosts [1 port/host] $ localhost(127.0.0.1)なので1台見つかったとされる. **セグメント全体をスキャンして見る [#o1ced429] 0番ポートから65535ポートまでを指定してセグメト全体を指定. $ date;sudo /usr/local/bin/masscan -p0-65535 192.168.20.1/24;date🆑 日 11 24 20:27:07 JST 2019 Starting masscan 1.0.4 (http://bit.ly/14GZzcT) at 2019-11-24 11:27:08 GMT -- forced options: -sS -Pn -n --randomize-hosts -v --send-eth Initiating SYN Stealth Scan Scanning 256 hosts [65536 ports/host] Discovered open port 62078/tcp on 192.168.20.126 Discovered open port 62078/tcp on 192.168.20.103 Discovered open port 62078/tcp on 192.168.20.108 Cwaiting several seconds to exit... saving resume file to: paused.conf 月 11 25 01:13:45 JST 2019 $ 5時間かかっても終わらないので,停止してみた. 次に,自分自身1台だけと対象を絞って,0番ポートから65535ポートで調べて見る. $ date;sudo /usr/local/bin/masscan -p0-65535 192.168.20.32;date🆑 月 11 25 22:47:29 JST 2019 Password: Starting masscan 1.0.4 (http://bit.ly/14GZzcT) at 2019-11-25 13:47:33 GMT -- forced options: -sS -Pn -n --randomize-hosts -v --send-eth Initiating SYN Stealth Scan Scanning 1 hosts [65536 ports/host] 月 11 25 22:58:41 JST 2019 $ 1台だけでも11分程度かかっている模様. そしてこのあと大問題が・・・・ **ルータが停止した [#ee897a20] セグメント全体をスキャンしていても問題なかったから,localhostをスキャンしても問題ないだろうと思ったけれど,それが大きな間違いでルータに負荷をかけてしまった模様.ルータがハングアップした. セグメント全体をスキャンといっても40%位までだったので,ローカルをスキャンするところまでいってないわけだから,偶然,問題発生にヒットしなかったことになる. 使い方を間違えるとダウンさせてしまうという例かな.実験環境でよかった.ふぅ...
編集の要約:
Q & A 認証:
ページ更新時は次の質問にお答えください。(プレビュー時は必要ありません)
Q:
日本の首都は?(漢字で)
A:
お名前:
タイムスタンプを変更しない
テキスト整形のルールを表示する
[1]
添付ファイル
[2]
:
Links list
(This host) = http://www.ujp.jp
(This host)
/modules/tech_regist2/?cmd=edit&help=true&page=SecurityTool%2Fmasscan%2Fmac
(This host)
/modules/tech_regist2/?plugin=attach&pcmd=list&refer=SecurityTool%2Fmasscan%2Fmac