
ネットワークをスキャンしてDOUBLEPULSARインプラントに感染したWindowsシステムを検出するPython2スクリプト。
著者: Luke Jennings ([email protected] - @jukelennings)
会社: Countercept (@countercept)
ウェブサイト: https://countercept.com
Shadow Brokers によって公開された DOUBLEPULSAR インプラントの SMB 版と RDP 版の両方の存在を確認するために、IP アドレスのリストをスキャンする Python2 スクリプト群です。単一 IP のチェックと、ファイル内の IP リストをマルチスレッドでチェックする機能に対応しています。SMB バージョンでは、@zerosum0x0 によってリバースエンジニアリングされたオペコード機構の知識を活用して、インプラントのリモートアンインストールによる修復もサポートしています。
これは早期リリースであり、これらのエクスプロイトが野放しとなり、間違いなく組織を標的にするために使用されている現在、ユーザーがネットワーク上の侵害を発見できるようにすることを目的としています。認証なしでリモートから使用できるインプラントの ping コマンドを再実装し、システムが感染しているかどうかを判断します。インプラントの SMB 版と RDP 版の両方がサポートされています。
すべての OS バージョンがテストされているわけではなく、一部は現在失敗します。たとえば、2012 では SMB シーケンスが ACCESS_DENIED で拒否されます。ただし、このシステムは ETERNALBLUE エクスプロイトに対して脆弱ではなく、DOUBLEPULSAR インプラントもターゲットへの ping を試みると同じエラーを受け取ります。したがって、特定の Windows バージョンに対するエラーは、システムが侵害されていないことを示している可能性があります。
root@kali:~# python detect_doublepulsar_smb.py --ip 192.168.175.128
[-] [192.168.175.128] No presence of DOUBLEPULSAR SMB implant
root@kali:~# python detect_doublepulsar_smb.py --ip 192.168.175.128
[+] [192.168.175.128] DOUBLEPULSAR SMB IMPLANT DETECTED!!!
root@kali:~# python detect_doublepulsar_rdp.py --file ips.list --verbose --threads 1
[*] [192.168.175.141] Sending negotiation request
[*] [192.168.175.141] Server explicitly refused SSL, reconnecting
[*] [192.168.175.141] Sending non-ssl negotiation request
[*] [192.168.175.141] Sending ping packet
[-] [192.168.175.141] No presence of DOUBLEPULSAR RDP implant
[*] [192.168.175.143] Sending negotiation request
[*] [192.168.175.143] Server chose to use SSL - negotiating SSL connection
[*] [192.168.175.143] Sending SSL client data
[*] [192.168.175.143] Sending ping packet
[-] [192.168.175.143] No presence of DOUBLEPULSAR RDP implant
[*] [192.168.175.142] Sending negotiation request
[*] [192.168.175.142] Sending client data
[*] [192.168.175.142] Sending ping packet
[+] [192.168.175.142] DOUBLEPULSAR RDP IMPLANT DETECTED!!!
root@kali:~# python2 detect_doublepulsar_smb.py --ip 192.168.175.136 --uninstall
[+] [192.168.175.136] DOUBLEPULSAR SMB IMPLANT DETECTED!!! XOR Key: 0x7c3bf3c1
[+] [192.168.175.136] DOUBLEPULSAR uninstall successful
# target network (adapt this to your network)
NETWORKRANGE=192.168.33.0/24
# install the required scanning tools
brew install masscan || apt-get install masscan
git clone https://github.com/countercept/doublepulsar-detection-script.git
cd doublepulsar-detection-script
# scan open ports
masscan -p445 $NETWORKRANGE > smb.lst
masscan -p3389 $NETWORKRANGE > rdp.lst
# clean the list of IPs
sed -i "s/^.* on //" smb.lst
sed -i "s/^.* on //" rdp.lst
# check vulnerabilities on the hosts who have the service open
python detect_doublepulsar_smb.py --file smb.lst
python detect_doublepulsar_rdp.py --file rdp.lst
# Or, if you have the python netaddr library
python detect_doublepulsar_smb.py --net 192.168.0.1/24
このリポジトリには、SMB ping ユーティリティが使用する未実装の SESSION_SETUP Trans2 コマンドの使用と、さまざまな応答ケースを検出するために使用できる 3 つの Snort シグネチャも含まれています。効果的な攻撃検出のためにシグネチャに依存することは推奨しませんが(簡単にバイパスされるため)、これらのルールは非常に特異的であり、これらのエクスプロイトとインプラントを変更せずに再利用する新たな脅威グループに対してある程度の検出能力を提供するはずです。
https://www.countercept.com/our-thinking/analyzing-the-doublepulsar-kernel-dll-injection-technique/
https://zerosum0x0.blogspot.co.uk/2017/04/doublepulsar-initial-smb-backdoor-ring.html