Skip to content

Commit

Permalink
Print message when connections are received in relay servers (#1792)
Browse files Browse the repository at this point in the history
* Printing a message when a WebDav request was received in HTTPRelayServer at NTLMRelayX (PROPFIND method)

* Opportunistic enhancement: showing listening ports for SMBRelayServer and WCFRelayServer
  • Loading branch information
gabrielg5 authored Aug 16, 2024
1 parent 9eb25b3 commit f70e362
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions impacket/examples/ntlmrelayx/servers/httprelayserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ def do_OPTIONS(self):
return

def do_PROPFIND(self):

LOG.info('HTTPD(%s): Client requested path: %s' % (self.server.server_address[1], self.path.lower()))

proxy = False
if (".jpg" in self.path) or (".JPG" in self.path):
content = b"""<?xml version="1.0"?><D:multistatus xmlns:D="DAV:"><D:response><D:href>http://webdavrelay/file/image.JPG/</D:href><D:propstat><D:prop><D:creationdate>2016-11-12T22:00:22Z</D:creationdate><D:displayname>image.JPG</D:displayname><D:getcontentlength>4456</D:getcontentlength><D:getcontenttype>image/jpeg</D:getcontenttype><D:getetag>4ebabfcee4364434dacb043986abfffe</D:getetag><D:getlastmodified>Mon, 20 Mar 2017 00:00:22 GMT</D:getlastmodified><D:resourcetype></D:resourcetype><D:supportedlock></D:supportedlock><D:ishidden>0</D:ishidden></D:prop><D:status>HTTP/1.1 200 OK</D:status></D:propstat></D:response></D:multistatus>"""
Expand Down
2 changes: 1 addition & 1 deletion impacket/examples/ntlmrelayx/servers/smbrelayserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,6 @@ def _start(self):
self.server.server_close()

def run(self):
LOG.info("Setting up SMB Server")
LOG.info("Setting up SMB Server on port %s" % self.server.server_address[1])
self._start()

4 changes: 2 additions & 2 deletions impacket/examples/ntlmrelayx/servers/wcfrelayserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,13 @@ def __init__(self, config):
self.server = None

def run(self):
LOG.info("Setting up WCF Server")

if self.config.listeningPort:
wcfport = self.config.listeningPort
else:
wcfport = 9389 # ADWS

LOG.info("Setting up WCF Server on port %s" % wcfport)

# changed to read from the interfaceIP set in the configuration
self.server = self.WCFServer((self.config.interfaceIp, wcfport), self.WCFHandler, self.config)

Expand Down

0 comments on commit f70e362

Please sign in to comment.