Back to rankings

WithSecureLabs/doublepulsar-detection-script

Python

A python2 script for sweeping a network to find windows systems compromised with the DOUBLEPULSAR implant.

security-scannersecurity-toolscounterceptdoublepulsarscript
Star Growth
Stars
1k
Forks
309
Weekly Growth
Issues
8
6008001k
Apr 2017May 2020Jun 2023Jul 2026
ArtifactsPyPIpip install doublepulsar-detection-script
README

Author: Luke Jennings (luke.jennings@countercept.com - @jukelennings)

Company: Countercept (@countercept)

Website: https://countercept.com

A set of python2 scripts for sweeping a list of IPs for the presence of both SMB and RDP versions of the DOUBLEPULSAR implant that was released by the Shadow Brokers. Supports both single IP checking and a list of IPs in a file with multi-threading support. The SMB version also supports the remote uninstall of the implant for remediation, which was helped by knowledge of the opcode mechanism reversed by @zerosum0x0.

This is an early release in the interests of allowing people to find compromises on their network now that these exploits are in the wild and no doubt being used to target organizations. It re-implements the ping command of the implant, which can be used remotely without authentication, in order to determine if a system is infected or not. Both SMB and RDP versions of the implant are supported.

Not all OS versions have been tested and some currently fail. For example, 2012 will reject the SMB sequence with ACCESS_DENIED. However, this system is not vulnerable to the ETERNALBLUE exploit and the DOUBLEPULSAR implant receives the same error when trying to ping a target. Therefore, it is possible that errors against certain windows versions may be indicative that the system is not compromised.

Usage

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

Scanning your network

# 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

Snort

This repository also contains three Snort signatures that can be used for detecting the use of the unimplemented SESSION_SETUP Trans2 command that the SMB ping utility uses and different response cases. While we do not condone the reliance on signatures for effective attack detection, due to how easily they are bypassed, these rules are highly specific and should provide some detection capability against new threat groups reusing these exploits and implants without modification.

More info

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

Related repositories
projectdiscovery/nuclei

Nuclei is a fast, customizable vulnerability scanner powered by the global security community and built on a simple YAML-based DSL, enabling collaboration to tackle trending vulnerabilities on the internet. It helps you find vulnerabilities in your applications, APIs, networks, DNS, and cloud configurations.

GoGo ModulesMIT Licensecve-scannersubdomain-takeover
docs.projectdiscovery.io/tools/nuclei
29.9k3.6k
CISOfy/lynis

Lynis - Security auditing tool for Linux, macOS, and UNIX-based systems. Assists with compliance testing (HIPAA/ISO27001/PCI DSS) and system hardening. Agentless, and installation optional.

ShellGNU General Public License v3.0shelllinux
cisofy.com/lynis/
16k1.6k
zaproxy/zaproxy

The ZAP by Checkmarx Core project

JavaMavenApache License 2.0zapzap-development
zaproxy.org
15.4k2.6k
future-architect/vuls

Agent-less vulnerability scanner for Linux, FreeBSD, Container, WordPress, Programming language libraries, Network devices

GoGo ModulesGNU General Public License v3.0vulsvulnerability-scanners
vuls.io
12.2k1.2k
wpscanteam/wpscan

WPScan WordPress security scanner. Written for security professionals and blog maintainers to test the security of their WordPress websites. Contact us via contact@wpscan.com

RubyRubyGemsOtherwordpresswpscan
wpscan.com/wordpress-cli-scanner
9.7k1.3k
PyCQA/bandit

Bandit is a tool designed to find common security issues in Python code.

PythonPyPIApache License 2.0linterbandit
bandit.readthedocs.io
8.2k795
jakejarvis/awesome-shodan-queries

🔍 A collection of interesting, funny, and depressing search queries to plug into shodan.io 👩‍💻

Creative Commons Zero v1.0 Universalshodaninfosec
jarv.is/notes/shodan-search-queries/
7.6k1k
lintsinghua/DeepAudit

DeepAudit:人人拥有的 AI 黑客战队,让漏洞挖掘触手可及。国内首个开源的代码漏洞挖掘多智能体系统。小白一键部署运行,自主协作审计 + 自动化沙箱 PoC 验证。支持 Ollama 私有部署 ,一键生成报告。支持中转站。​让安全不再昂贵,让审计不再复杂。

PythonPyPIGNU Affero General Public License v3.0aibug-detection
6.7k821
GhostTroops/scan4all

Official repository vuls Scan: 15000+PoCs; 23 kinds of application password crack; 7000+Web fingerprints; 146 protocols and 90000+ rules Port scanning; Fuzz, HW, awesome BugBounty( ͡° ͜ʖ ͡°)...

GoGo ModulesBSD 3-Clause "New" or "Revised" Licenseattackauto
scan4all.51pwn.com
6.1k719
k8gege/Ladon

Ladon大型内网渗透扫描器,PowerShell、Cobalt Strike插件、内存加载、无文件扫描。含端口扫描、服务识别、网络资产探测、密码审计、高危漏洞检测、漏洞利用、密码读取以及一键GetShell,支持批量A段/B段/C段以及跨网段扫描,支持URL、主机、域名列表扫描等。网络资产探测32种协议(ICMP\NBT\DNS\MAC\SMB\WMI\SSH\HTTP\HTTPS\Exchange\mssql\FTP\RDP)或方法快速获取目标网络存活主机IP、计算机名、工作组、共享资源、网卡地址、操作系统版本、网站、子域名、中间件、开放服务、路由器、交换机、数据库、打印机等,大量高危漏洞检测模块MS17010、Zimbra、Exchange

C#MIT Licensescannerportscan
k8gege.org/Ladon/
5.3k881
microsoft/ApplicationInspector

A source code analyzer built for surfacing features of interest and other characteristics to answer the question 'What's in the code?' quickly using static analysis with a json based rules engine. Ideal for scanning components before use or detecting feature level changes.

C#MIT Licensestatic-analysissoftware-characterization
4.4k367
toolswatch/blackhat-arsenal-tools

Official Black Hat Arsenal Security Tools Repository

GNU General Public License v3.0blackhatarsenal
toolswatch.org/category/arsenal/
4k1.1k