
네트워크를 스캔하여 DOUBLEPULSAR 임플란트에 감염된 Windows 시스템을 찾는 Python2 스크립트입니다.
저자: Luke Jennings ([email protected] - @jukelennings)
회사: Countercept (@countercept)
웹사이트: https://countercept.com
이것은 Shadow Brokers에 의해 유출된 DOUBLEPULSAR 임플란트의 SMB 및 RDP 버전의 존재 여부를 스캔하기 위한 python2 스크립트 세트입니다. 단일 IP 확인 및 멀티스레딩 지원이 포함된 파일 내 IP 목록을 지원합니다. SMB 버전은 또한 @zerosum0x0에 의해 리버스된 opcode 메커니즘의 지식을 바탕으로 제거를 위한 임플란트의 원격 제거를 지원합니다.
이것은 현재 이러한 익스플로잇이 공개되어 조직을 대상으로 사용되고 있음이 의심되는 상황에서 사람들이 자신의 네트워크에서 침해를 발견할 수 있도록 하기 위한 초기 릴리스입니다. 이 도구는 임플란트의 ping 명령을 재구현하여 인증 없이 원격으로 사용할 수 있으며, 시스템이 감염되었는지 여부를 확인할 수 있습니다. 임플란트의 SMB 및 RDP 버전을 모두 지원합니다.
모든 OS 버전이 테스트된 것은 아니며 일부는 현재 실패합니다. 예를 들어, 2012에서는 ACCESS_DENIED로 SMB 시퀀스를 거부합니다. 그러나 이 시스템은 ETERNALBLUE 익스플로잇에 취약하지 않으며 DOUBLEPULSAR 임플란트는 대상을 핑할 때 동일한 오류를 수신합니다. 따라서 특정 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 명령의 사용과 다양한 응답 사례를 감지하는 데 사용할 수 있는 세 가지 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