証明書の発行されたTor Hidden Serviceを探してみた

Tor Hidden Serviceとは Tor Hidden Service(以下 “HS”)とは強固な匿名性を確保するツールTorを用いないとアクセスできないサービスのこと。 末尾が.onionで終わるドメイン名を持つ。 Tor は端末のIPアドレスを隠すことでサービス提供者の匿名性を向上させるツール。 SOCKSプロキシとして動作するため、SOCKSプロトコルのプロキシが対応していればHS自体は別にHTTPサーバでもメールでもSSHでも使える。 例: 自宅のラズパイを Tor Onion Service にして外から SSH 接続する Tor Hidden Service と証明書 さて、HSはTor Bundle Browser を用いれば簡単にアクセスが可能だ。 有名なHSはFacebookやThe New York Timesが挙げられる。 ここで気になるのが、これらHSがHTTPSを使っていることだ。 https://facebookcorewwwi.onion https://www.nytimes3xbfgragh.onion Facebook, hidden services, and https certs 上記リンクを参照してもらうとわかる通りHSでも証明書は使える(色々と議論が盛り上がったようだが…) 「どうせE2Eで暗号化されているし、PGPなり何なりの署名で検証できるしHTTPSの証明書いるか?」と思う部分もあるものの、表立って活動している企業や団体がHSでサッとなりすましではないことをを示すのには便利なのだろう。 そんな事情もあって一部HSでHTTPSが使われているが、このHTTPS通信で使用する証明書も例外なくCertificate Transparency(以下"CT")のログを残している。 ここでこんな考えが出てくる。 「もしかしてCTログを漁ればHTTPSのHSと紐づいている他のHSやサーバの情報を確認できるのでは?」 「✝️闇✝️のサービスのCTログとか発見して、それを元に色々と情報を確認できるのでは?」 と言うわけで早速crt.shで.onionドメインと紐づいている証明書を探してみた。 crt.sh でクエリかけてみた とりあえず%.onionでクエリをかけてみた。 https://crt.sh/?q=%25.onion めっちゃヒットするじゃん… 自作したcrt.shでクエリかけるツールでドメインを洗い出してみた. 自作したツール: crtsh $ ./crtsh -q %.onion -o | sort | uniq 結果はこちら gist パッと見た感じ普通の企業やら団体ばかりという感じ。 前述した通り「どうせE2Eで暗号化されているし、PGPなり何なりの署名で検証できるしHTTPSの証明書いるか?」と思っている人が存在している中で、企業でも何でもない人が証明書を取得するメリットがない。 証明書発行にはコストがかかるし、認証局に色々と情報を渡さないといけない。 そして何よりHSで大きいトラフィックを抱えているような✝️闇✝️のサービスなんかはそもそも証明書が発行されないだろう(推測) まとめ 証明書の発行されたTor Hidden Serviceを探してみた結果をまとめると以下の通りだ。 ...

December 3, 2019 · 1 min · 80 words · FAMASoon

GitHub Actionでマルチプラットフォームなテストをした

概要 【GitHub Actions】Go言語の自動テストからリリースまでを作ってみた と GitHub Actions for Go を参考にLinux, Mac, WindowsでGo言語製ツールをテストした。 あとGitHub Actionsのワークフロー構文も参考にした。 成果物は下記リンクを参照。 https://github.com/famasoon/crtsh/blob/master/.github/workflows/go_test.yml 内容は.github/workflows/go_test.ymlの中。 name: Run tests on multi environment on: [push, pull_request] jobs: test: strategy: matrix: go-version: [1.12.x, 1.13.x] platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: - name: Install Go uses: actions/setup-go@v1 with: go-version: ${{ matrix.go-version }} - name: Checkout code uses: actions/checkout@v1 - name: Get dependcies run: go get -v -t -d ./... - name: Test run: go test ./... 解説 name: ワークフローの名前 on: イベントの種類。今回はpushもしくはpull requestを検知しワークフローを開始する jobs: イベントを検知した時の一連のタスク strategy: 各ジョブごとに設定できる環境設定 matrix: Go言語の複数バージョンと複数プラットフォームを設定した。ワークフロー構文に詳細が書いてあるので要参照 runs-on: 実行するプラットフォームを書く。今回はmatrixに記入したプラットフォームを参照させた あとは各ステップの要点を書く ...

November 30, 2019 · 1 min · 116 words · FAMASoon

HackTheBox Walkthrough - Optim

About Optim Optim Nmap Port scan result # nmap -sV -sT -sC --script=vuln -oA nmap_result.txt 10.10.10.8 Starting Nmap 7.80 ( https://nmap.org ) at 2019-11-03 09:55 EST Stats: 0:06:29 elapsed; 0 hosts completed (1 up), 1 undergoing Script Scan NSE Timing: About 99.32% done; ETC: 10:01 (0:00:02 remaining) Stats: 0:14:57 elapsed; 0 hosts completed (1 up), 1 undergoing Script Scan NSE Timing: About 99.32% done; ETC: 10:10 (0:00:06 remaining) Nmap scan report for 10.10.10.8 Host is up (0.25s latency). Not shown: 999 filtered ports PORT STATE SERVICE VERSION 80/tcp open http HttpFileServer httpd 2.3 |_clamav-exec: ERROR: Script execution failed (use -d to debug) |_http-csrf: Couldn't find any CSRF vulnerabilities. |_http-dombased-xss: Couldn't find any DOM based XSS. | http-fileupload-exploiter: | |_ Couldn't find a file-type field. | http-method-tamper: | VULNERABLE: | Authentication bypass by HTTP verb tampering | State: VULNERABLE (Exploitable) | This web server contains password protected resources vulnerable to authentication bypass | vulnerabilities via HTTP verb tampering. This is often found in web servers that only limit access to the | common HTTP methods and in misconfigured .htaccess files. | | Extra information: | | URIs suspected to be vulnerable to HTTP verb tampering: | /~login [GENERIC] | | References: | http://www.mkit.com.ar/labs/htexploit/ | https://www.owasp.org/index.php/Testing_for_HTTP_Methods_and_XST_%28OWASP-CM-008%29 | http://www.imperva.com/resources/glossary/http_verb_tampering.html |_ http://capec.mitre.org/data/definitions/274.html |_http-server-header: HFS 2.3 |_http-stored-xss: Couldn't find any stored XSS vulnerabilities. | http-vuln-cve2011-3192: | VULNERABLE: | Apache byterange filter DoS | State: VULNERABLE | IDs: BID:49303 CVE:CVE-2011-3192 | The Apache web server is vulnerable to a denial of service attack when numerous | overlapping byte ranges are requested. | Disclosure date: 2011-08-19 | References: | https://www.tenable.com/plugins/nessus/55976 | https://www.securityfocus.com/bid/49303 | https://seclists.org/fulldisclosure/2011/Aug/175 |_ https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-3192 Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 1150.10 seconds Web browsing Accessed with browser ...

November 4, 2019 · 12 min · 2350 words · FAMASoon

About NSE scripts

What is NSE Network Script Engine(NSE) can be able to write for automation network scan. About NSE NSE is written by Lua. In Linux, Script locate /usr/local/share/nmap/scripts, and library locate /usr/local/share/nmap/nselib. How to enable NSE Add -sC option run default category NSE option. --script option run the specified directory or script is executed by NSE. Tutorial Run nmap with NSE $ nmap -sC example.com Result # nmap -sC example.com Starting Nmap 7.80 ( https://nmap.org ) at 2019-11-01 12:20 EDT Nmap scan report for example.com (93.184.216.34) Host is up (0.033s latency). Other addresses for example.com (not scanned): 2606:2800:220:1:248:1893:25c8:1946 Not shown: 996 filtered ports PORT STATE SERVICE 80/tcp open http |_http-title: Example Domain 443/tcp open https |_http-title: Example Domain | ssl-cert: Subject: commonName=www.example.org/organizationName=Internet Corporation for Assigned Names and Numbers/stateOrProvinceName=California/countryName=US | Subject Alternative Name: DNS:www.example.org, DNS:example.com, DNS:example.edu, DNS:example.net, DNS:example.org, DNS:www.example.com, DNS:www.example.edu, DNS:www.example.net | Not valid before: 2018-11-28T00:00:00 |_Not valid after: 2020-12-02T12:00:00 |_ssl-date: TLS randomness does not represent time | tls-alpn: | h2 |_ http/1.1 | tls-nextprotoneg: | h2 | http/1.1 |_ http/1.0 1119/tcp closed bnetgame 1935/tcp closed rtmp Nmap done: 1 IP address (1 host up) scanned in 14.74 seconds Run nmap with NSE espesially vuln script ...

November 1, 2019 · 2 min · 312 words · FAMASoon

HackTheBox Walkthrough - Legacy

This post is writeup of the HackTheBox machine created by ch4p. Nmsp Nmap result # nmap -sV -sC --script=vuln 10.10.10.4 Starting Nmap 7.80 ( https://nmap.org ) at 2019-10-28 12:27 EDT Nmap scan report for 10.10.10.4 Host is up (0.32s latency). Not shown: 997 filtered ports PORT STATE SERVICE VERSION 139/tcp open netbios-ssn Microsoft Windows netbios-ssn |_clamav-exec: ERROR: Script execution failed (use -d to debug) 445/tcp open microsoft-ds Microsoft Windows XP microsoft-ds |_clamav-exec: ERROR: Script execution failed (use -d to debug) 3389/tcp closed ms-wbt-server Service Info: OSs: Windows, Windows XP; CPE: cpe:/o:microsoft:windows, cpe:/o:microsoft:windows_xp Host script results: |_samba-vuln-cve-2012-1182: NT_STATUS_ACCESS_DENIED | smb-vuln-ms08-067: | VULNERABLE: | Microsoft Windows system vulnerable to remote code execution (MS08-067) | State: VULNERABLE | IDs: CVE:CVE-2008-4250 | The Server service in Microsoft Windows 2000 SP4, XP SP2 and SP3, Server 2003 SP1 and SP2, | Vista Gold and SP1, Server 2008, and 7 Pre-Beta allows remote attackers to execute arbitrary | code via a crafted RPC request that triggers the overflow during path canonicalization. | | Disclosure date: 2008-10-23 | References: | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-4250 |_ https://technet.microsoft.com/en-us/library/security/ms08-067.aspx |_smb-vuln-ms10-054: false |_smb-vuln-ms10-061: ERROR: Script execution failed (use -d to debug) | smb-vuln-ms17-010: | VULNERABLE: | Remote Code Execution vulnerability in Microsoft SMBv1 servers (ms17-010) | State: VULNERABLE | IDs: CVE:CVE-2017-0143 | Risk factor: HIGH | A critical remote code execution vulnerability exists in Microsoft SMBv1 | servers (ms17-010). | | Disclosure date: 2017-03-14 | References: | https://blogs.technet.microsoft.com/msrc/2017/05/12/customer-guidance-for-wannacrypt-attacks/ | https://technet.microsoft.com/en-us/library/security/ms17-010.aspx |_ https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0143 Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 50.41 seconds This machine have some RCE vuln. I will try to use MS08-067. ...

October 29, 2019 · 3 min · 594 words · FAMASoon

HackTheBox Walkthrough - lame

This post is writeup of the HackTheBox machine created by ch4p. Nmap Nmap result Starting Nmap 7.80 ( https://nmap.org ) at 2019-10-27 10:46 EDT Nmap scan report for 10.10.10.3 Host is up (0.29s latency). Not shown: 996 filtered ports PORT STATE SERVICE VERSION 21/tcp open ftp vsftpd 2.3.4 |_ftp-anon: Anonymous FTP login allowed (FTP code 230) | ftp-syst: | STAT: | FTP server status: | Connected to 10.10.14.15 | Logged in as ftp | TYPE: ASCII | No session bandwidth limit | Session timeout in seconds is 300 | Control connection is plain text | Data connections will be plain text | vsFTPd 2.3.4 - secure, fast, stable |_End of status 22/tcp open ssh OpenSSH 4.7p1 Debian 8ubuntu1 (protocol 2.0) | ssh-hostkey: | 1024 60:0f:cf:e1:c0:5f:6a:74:d6:90:24:fa:c4:d5:6c:cd (DSA) |_ 2048 56:56:24:0f:21:1d:de:a7:2b:ae:61:b1:24:3d:e8:f3 (RSA) 139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP) 445/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP) Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel Host script results: |_ms-sql-info: ERROR: Script execution failed (use -d to debug) |_smb-os-discovery: ERROR: Script execution failed (use -d to debug) |_smb-security-mode: ERROR: Script execution failed (use -d to debug) |_smb2-time: Protocol negotiation failed (SMB2) Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 75.41 seconds FTP Connected via FTP, but it is empty. ...

October 28, 2019 · 5 min · 999 words · FAMASoon

HackTheBox Walkthrough - Devel

This post is writeup of the HackTheBox machine created by ch4p. Nmap Quick port scan reveals FTP service and web server. # nmap -sC -sV 10.10.10.5 Starting Nmap 7.80 ( https://nmap.org ) at 2019-10-15 21:00 EDT Nmap scan report for 10.10.10.5 Host is up (0.28s latency). Not shown: 998 filtered ports PORT STATE SERVICE VERSION 21/tcp open ftp Microsoft ftpd | ftp-anon: Anonymous FTP login allowed (FTP code 230) | 03-18-17 02:06AM <DIR> aspnet_client | 03-17-17 05:37PM 689 iisstart.htm |_03-17-17 05:37PM 184946 welcome.png | ftp-syst: |_ SYST: Windows_NT 80/tcp open http Microsoft IIS httpd 7.5 | http-methods: |_ Potentially risky methods: TRACE |_http-server-header: Microsoft-IIS/7.5 |_http-title: IIS7 Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 37.17 seconds HTTP server Access to http://10.10.10.5 then displayed IIS 7 default screen. ...

October 16, 2019 · 6 min · 1188 words · FAMASoon

10進数表記のIPアドレスでwebサイトにアクセスする

はじめに なんとなくGitHubを漁っていたら面白そうなリポジトリを見つけた。 https://github.com/OsandaMalith/IPObfuscator 内容はIPアドレスを10進数や16進数、8進数に変換してwebサイトにアクセスするというもの。 バラバラの基数でも最終的にIPアドレスっぽくなればアクセスできるみたい。 そういえば10進数のIPアドレス表記を利用する攻撃活動もありましたね。 悪用ダメ絶対。 実装を見てみる https://github.com/OsandaMalith/IPObfuscator/blob/master/ip.c なるほど。 1バイトずつ読んで基数変換しているみたい。 実装してみた なんとなくGo言語で実装してみた https://github.com/famasoon/go-IPObfuscator すごく可読性の低いコードになってしまったので後々、修正する。 正直あまり実用性はない。 出力方法も書いておく。 $ git clone https://github.com/famasoon/go-IPObfuscator $ cd go-IPObfuscator $ go run main.go Enter IP Address: 222.165.163.91 http://3735397211 http://0xde.0xa5.0xa3.0x5b http://0336.0245.0243.0133 http://0x00000000de.0x00000000a5.0x00000000a3.0x000000005b http://00000000336.00000000245.00000000243.00000000133 http://0xde.0xa5.0xa3.91 http://0xde.0xa5.163.91 http://0xde.165.163.91 http://0336.0245.0243.91 http://0336.0245.163.91 http://0336.165.163.91 http://0xde.0xa5.41819 http://0336.0245.41819 http://0xde.0245.41819 http://0xde.10855259 http://0336.10855259 http://0xde.0xa5.0243.0133 http://0xde.0245.0243.0133 出力されたリンクを踏むとGoogle に飛ぶ。 結構、見た目を変えてもアクセスできるので奥が深い。 おわり

October 12, 2019 · 1 min · 54 words · FAMASoon

Container Registry に自分の作ったDockerイメージをpushする

https://cloud.google.com/container-registry/docs/pushing-and-pulling?hl=ja プライベートなDockerコンテナレジストリが欲しかったので使ってみた。 gcloudコマンドのセットアップを終える gcloud auth configure-dockerでDocker Registryの認証をする 下記コマンドでビルド済みのイメージ名にタグ付けをする $ docker tag [任意のイメージ名] gcr.io/[プロジェクトID]/[イメージ名]:[バージョン] 下記コマンドでContainer RegistryにDocker イメージを push $ docker push gcr.io/[プロジェクト名]/[イメージ名]:[バージョン] これで作ったDockerイメージのContainer Registryへpush完了

October 12, 2019 · 1 min · 23 words · FAMASoon

Create Binary Analysis VM

Create Binary Analysis VM I created VM for reverse engineering. This is the note at that time. Install Virtual Box To run VMs needs hypervisor. I choose the Virtual Box. Because, Virtual Box is easy to use and free. To install Virtual Box navigate to the this page. https://www.virtualbox.org/wiki/Downloads You choose the package for your system, and download it. Run the installer. If you are using the mac OS, you can install with this command too. ...

October 12, 2019 · 2 min · 244 words · FAMASoon