-
Notifications
You must be signed in to change notification settings - Fork 32
/
cve-2019-0708.py
47 lines (33 loc) · 1.15 KB
/
cve-2019-0708.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# _*_ coding: utf-8 _*_
"""
auth: bigger.wing
version: v1.0
function: cve-2019-0708漏洞检测
usage:
note: 借助于poc做检测, 3389_hosts为IP地址清单,0708detector.exe为poc
"""
import os
import subprocess
from multiprocessing.dummy import Pool as ThreadPool
current_abs_path = os.path.abspath(__file__)
current_abs_path_dir = os.path.dirname(current_abs_path)
poc = os.path.abspath(current_abs_path_dir) + '/0708detector.exe'
hosts_file = os.path.abspath(current_abs_path_dir) + '/3389_hosts'
def cve_2019_0708(ip, port='3389'):
command = poc + ' -t ' + ip + ' -p ' + port
result = subprocess.getoutput(command)
# print(command, '\n', result)
if 'WARNING: SERVER IS VULNERABLE' in result:
result = '%s 存在CVE-2019-0708漏洞' % ip
else:
result = '%s 不存在CVE-2019-0708漏洞' % ip
print(result)
if __name__ == '__main__':
rdp_hosts = []
with open(hosts_file, 'r') as f:
data = f.readlines()
for x in data:
ip = x.strip()
rdp_hosts.append(ip)
pool = ThreadPool(20)
pool.map(cve_2019_0708, rdp_hosts)