Skip to content

Commit

Permalink
fixed issue where default_response is needed for external/generate_ag…
Browse files Browse the repository at this point in the history
…ent (#333)
  • Loading branch information
Cx01N authored Apr 23, 2022
1 parent d7213bb commit 62d891e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions empire/server/listeners/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def default_response(self):
"""
Returns an IIS 7.5 404 not found page.
"""
return render_template("default.html")
return open(f"{self.template_dir }/default.html", "r").read()

def validate_options(self):
"""
Expand Down Expand Up @@ -872,8 +872,8 @@ def start_server(self, listenerOptions):
proxy = self.options["Proxy"]["Value"]
proxyCreds = self.options["ProxyCreds"]["Value"]

template_dir = self.mainMenu.installPath + "/data/listeners/templates/"
app = Flask(__name__, template_folder=template_dir)
self.template_dir = self.mainMenu.installPath + "/data/listeners/templates/"
app = Flask(__name__, template_folder=self.template_dir)
self.app = app

# Set HTTP/1.1 as in IIS 7.5 instead of /1.0
Expand Down
4 changes: 2 additions & 2 deletions empire/server/listeners/http_com.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def default_response(self):
"""
Returns an IIS 7.5 404 not found page.
"""
return render_template("default.html")
return open(f"{self.template_dir }/default.html", "r").read()

def validate_options(self):
"""
Expand Down Expand Up @@ -652,7 +652,7 @@ def start_server(self, listenerOptions):
port = listenerOptions["Port"]["Value"]
stagingKey = listenerOptions["StagingKey"]["Value"]

template_dir = self.mainMenu.installPath + "/data/listeners/templates/"
self.template_dir = self.mainMenu.installPath + "/data/listeners/templates/"
app = Flask(__name__, template_folder=template_dir)
self.app = app

Expand Down
4 changes: 2 additions & 2 deletions empire/server/listeners/http_malleable.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def default_response(self):
"""
Returns an IIS 7.5 404 not found page.
"""
return render_template("default.html")
return open(f"{self.template_dir }/default.html", "r").read()

def validate_options(self):
"""
Expand Down Expand Up @@ -1385,7 +1385,7 @@ def start_server(self, listenerOptions):
log.setLevel(logging.ERROR)

# initialize flask server
template_dir = self.mainMenu.installPath + "/data/listeners/templates/"
self.template_dir = self.mainMenu.installPath + "/data/listeners/templates/"
app = Flask(__name__, template_folder=template_dir)
self.app = app

Expand Down

0 comments on commit 62d891e

Please sign in to comment.