forked from p15670423/monkey
Agent: Add unit tests for log4shell ldap server tree
This commit is contained in:
parent
dcc68914bd
commit
eb10bdaa4e
|
@ -0,0 +1,13 @@
|
|||
from pathlib import Path
|
||||
|
||||
from infection_monkey.exploit.log4shell_utils.ldap_server import EXPLOIT_RDN, Tree
|
||||
|
||||
|
||||
def test_java_code_base_url(tmp_path):
|
||||
ip = "172.10.20.30"
|
||||
port = 9999
|
||||
|
||||
tree = Tree(ip, port, tmp_path)
|
||||
ldif_path = Path(tree.path) / f"{EXPLOIT_RDN}.ldif"
|
||||
with open(ldif_path, "r") as exploit_dit:
|
||||
assert f"javaCodeBase: http://{ip}:{port}/" in exploit_dit.read()
|
Loading…
Reference in New Issue