久々に設定してみた
必要なもの
udp:53を開けておく
iptables -A INPUT -p udp -m state --state NEW,RELATED,ESTABLISHED --dport 53 -j ACCEPT
dns2tcp導入,これはserver, client両方を含んでいるので,利用するPCのserver, client両方に導入する.
$ sudo apt install dns2tcp
適当なサブドメインをNSで設定しておく
dns2tcp IN NS example.com.
server側の設定
$ cat ~/.dns2tcpdrc listen = <HOSTIPADDRESS> port = 53 user=dns2tcp chroot = /var/tmp/dns2tcp/ pid_file = /var/run/dns2tcp.pid domain = dns2tcp.example.com key = oopsoops resources = ssh:127.0.0.1:22
で,とりあえずこんな感じで起動.
$ sudo dns2tcpd -F -f ~/.dns2tcpdrc
client側設定
$ cat ~/.dns2tcprc domain = dns2tcp.example.com resource = ssh local_port = 8022 key = oopsoops debug_level=3
で,clientを起動する
$ dns2tcpc
これでserver側の22とclientの8022が繋がってssh出来るようになる
$ ssh user@localhost -p 8022
これでWeb閲覧をしたい場合は,-D でDynamic port fowarding するなどする.
$ ssh user@localhost -p 8022 -D 8080
socks5で 127.0.0.1:8080 な感じでいいはず
超えられるのを確認したSSID
越えられなかったSSID
Famima_Wi-Fi は dnstunnel.example.com
みたいな名前は通さない(名前解決できない)のを確認.同じドメインでwwwなどは通った.
少なくとも dnstunnel
というサブドメインはブラックリストに入っているよう.
$ dns2tcpc -d3 No DNS given, using 127.0.1.1 (first entry found in resolv.conf) debug level 3 Debug socket.c:233 Create socket for dns : '127.0.1.1' Listening on port : 22222 When connected press enter at any time to dump the queue Debug session.c:46 Request challenge Debug requests.c:146 Sending dns id = 0x12ed Debug requests.c:95 Query is AAAAAGitAA.=auth.dnstunnel.example.com len 38 Error requests.c:202 Auth error = Server failure
$ dig dnstunnel.example.com ; <<>> DiG 9.11.5-P4-5.1ubuntu2-Ubuntu <<>> dnstunnel.example.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 9752 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;dnstunnel.example.com. IN A ;; Query time: 26 msec ;; SERVER: 127.0.1.1#53(127.0.1.1) ;; WHEN: 金 9月 05 20:29:29 JST 2019 ;; MSG SIZE rcvd: 50
http://standards-oui.ieee.org/oui/oui.txt
$ wget http://standards-oui.ieee.org/oui/oui.txt $ grep -A3 -i ^000000 oui.txt 000000 (base 16) XEROX CORPORATION M/S 105-50C WEBSTER NY 14580 US
/usr/share/nmap/nmap-mac-prefixes ( nmap-common pkg )
$ sudo apt install nmap $ grep 000000 /usr/share/nmap/nmap-mac-prefixes 000000 Xerox
コメント