-
+
+
diff --git a/app/templates/project_add_get.html b/app/templates/project_add_get.html
index 6f12d40..27ef977 100644
--- a/app/templates/project_add_get.html
+++ b/app/templates/project_add_get.html
@@ -68,7 +68,6 @@
-
diff --git a/app/views.py b/app/views.py
index e692353..1fe92f4 100644
--- a/app/views.py
+++ b/app/views.py
@@ -2,15 +2,12 @@ from flask import Blueprint, current_app, flash, request, redirect, url_for, ren
from werkzeug.utils import secure_filename
import os
import logging
-import io
from typing import List, Tuple
-from datetime import date
from pygments import highlight
from pygments.lexers import CLexer, NasmLexer, DiffLexer, HexdumpLexer
from pygments.formatters import HtmlFormatter
import difflib
from ansi2html import Ansi2HTMLConverter
-import pickle
from config import config
from model.settings import Settings
@@ -66,7 +63,7 @@ def project(name):
@views.route("/add_project", methods=['POST', 'GET'])
-def inject():
+def add_project():
if request.method == 'POST':
settings = Settings()
@@ -135,47 +132,18 @@ def inject():
@views.route("/start_project", methods=['POST', 'GET'])
def start_project():
#project_name = request.args.get('project_name')
- project_name = request.form['project_name']
+ project_name = request.form.get('project_name')
+ try_start = request.form.get('try_start')
+ if try_start != None:
+ try_start = True
+ else:
+ try_start = False
project = storage.get_project(project_name)
+ project.settings.try_start_final_infected_exe = try_start
start(project.settings)
return redirect("/project/{}".format(project_name), code=302)
-@views.route("/build")
-def build():
- exes = []
- for file in os.listdir("app/upload/exe"):
- exes.append(file)
-
- shellcodes = []
- for file in os.listdir("app/upload/shellcode"):
- shellcodes.append(file)
-
- sourcestyles = [(color.name, color.value) for color in SourceStyle]
- allocstyles = [(color.name, color.value) for color in AllocStyle]
- decoderstyles = [(color.name, color.value) for color in DecoderStyle]
- execstyles = [(color.name, color.value) for color in ExecStyle]
- injectstyles = [(color.name, color.value) for color in InjectStyle]
-
- return render_template('build.html',
- exes=exes,
- shellcodes=shellcodes,
- sourcestyles=sourcestyles,
- allocstyles=allocstyles,
- decoderstyles=decoderstyles,
- execstyles=execstyles,
- injectstyles=injectstyles,
- )
-
-
-@views.route("/files")
-def files():
- log_files = get_logfiles()
- return render_template('files.html',
- log_files=log_files
- )
-
-
def get_logfiles():
log_files = []
id = 0
@@ -184,13 +152,11 @@ def get_logfiles():
for file in os.listdir(f"{logs_dir}/"):
if file.startswith("."):
continue
- print("Handle: ", file)
with open(os.path.join(f"{logs_dir}/", file), "r") as f:
if file.endswith(".bin"):
continue
data = f.read()
- print("FILE: {}".format(file))
if 'main_c' in file:
data = highlight(data, CLexer(), HtmlFormatter(full=False))
elif '_asm_' in file:
@@ -203,11 +169,9 @@ def get_logfiles():
elif '.ascii' in file:
data = conv.convert(data, full=False)
elif '.txt' in file:
- # skip it
- continue
+ continue # skip it
elif '.hex' in file:
- print("-> hex")
- continue
+ continue # skip it
#data = escape(data)
#data = highlight(data, HexdumpLexer(), HtmlFormatter(full=False))
elif '.log' in file:
diff --git a/log.py b/log.py
index 3953923..8154515 100644
--- a/log.py
+++ b/log.py
@@ -65,4 +65,7 @@ def setup_logging():
list_handler.setFormatter(CustomFormatter())
root_logger.addHandler(ch)
- root_logger.addHandler(list_handler)
\ No newline at end of file
+ root_logger.addHandler(list_handler)
+
+def clear_log():
+ log_messages.clear()
diff --git a/model/project.py b/model/project.py
index dd480b6..7e39676 100644
--- a/model/project.py
+++ b/model/project.py
@@ -12,6 +12,7 @@ logger = logging.getLogger("Project")
class Project():
def __init__(self, settings: Settings):
self.name: str = ""
+ self.comment: str = ""
self.settings: Settings = settings
self.payload: Payload = Payload(self.settings.payload_path)
self.exe_host: ExeHost = ExeHost(self.settings.inject_exe_in)
diff --git a/pe/derbackdoorer.py b/pe/derbackdoorer.py
index 1cd2177..6732083 100644
--- a/pe/derbackdoorer.py
+++ b/pe/derbackdoorer.py
@@ -216,8 +216,6 @@ Trailing {sect_name} bytes:
for ins in trampoline.split(';'):
logger.info(f'\t{ins.strip()}')
- logger.info('')
-
return (trampoline, addrOffset)
@@ -245,7 +243,7 @@ Trailing {sect_name} bytes:
self.compiledTrampoline = encoding
self.compiledTrampolineCount = count
- logger.info('Successfully backdoored entry point with jump/call to shellcode')
+ logger.debug('Successfully backdoored entry point with jump/call to shellcode')
return instr.address
return 0
diff --git a/pe/superpe.py b/pe/superpe.py
index 905e7a4..c1ac007 100644
--- a/pe/superpe.py
+++ b/pe/superpe.py
@@ -178,8 +178,6 @@ class SuperPe():
if self.arch == 'x64':
imageBaseRelocType = SuperPe.IMAGE_REL_BASED_DIR64
- logger.info('Adding new relocations to backdoored PE file...')
-
relocsSize = self.pe.OPTIONAL_HEADER.DATA_DIRECTORY[SuperPe.IMAGE_DIRECTORY_ENTRY_BASERELOC].Size
relocsIndex = self.getSectionIndexByDataDir(SuperPe.IMAGE_DIRECTORY_ENTRY_BASERELOC)
addr = self.pe.OPTIONAL_HEADER.DATA_DIRECTORY[SuperPe.IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress
diff --git a/web.py b/web.py
index b72163b..441abc1 100644
--- a/web.py
+++ b/web.py
@@ -3,11 +3,13 @@
import os
import argparse
from flask import Flask
+import logging
from app.views import views
from log import setup_logging, writelog
if __name__ == "__main__":
+ logging.getLogger('werkzeug').setLevel(logging.ERROR)
setup_logging()
parser = argparse.ArgumentParser()
parser.add_argument('--listenip', type=str, help='IP to listen on', default="0.0.0.0")