mirror of
https://github.com/dobin/SuperMega
synced 2026-06-03 01:27:11 +00:00
feature: web: save project
This commit is contained in:
@@ -19,8 +19,12 @@
|
|||||||
|
|
||||||
<form method="POST" enctype="multipart/form-data" action="/add_project">
|
<form method="POST" enctype="multipart/form-data" action="/add_project">
|
||||||
|
|
||||||
|
|
||||||
<div class="row row-cols-lg-auto g-3">
|
<div class="row row-cols-lg-auto g-3">
|
||||||
|
|
||||||
|
<input type="text" name="project_name" class="hidden form-control" value="{{project_name}}"
|
||||||
|
placeholder="Projekt" aria-label="PROJECTNAME" aria-describedby="basic-addon1">
|
||||||
|
|
||||||
<select class="form-select" name="shellcode" aria-label="SHELLCODE">
|
<select class="form-select" name="shellcode" aria-label="SHELLCODE">
|
||||||
{% for shellcode in shellcodes %}
|
{% for shellcode in shellcodes %}
|
||||||
<option value="{{shellcode}}"
|
<option value="{{shellcode}}"
|
||||||
@@ -80,6 +84,8 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<button class="btn btn-primary" type="submit" value="save">Save</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
+11
-9
@@ -63,7 +63,6 @@ def project(name):
|
|||||||
|
|
||||||
@views.route("/add_project", methods=['POST', 'GET'])
|
@views.route("/add_project", methods=['POST', 'GET'])
|
||||||
def inject():
|
def inject():
|
||||||
|
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
config.load()
|
config.load()
|
||||||
settings = Settings()
|
settings = Settings()
|
||||||
@@ -89,14 +88,18 @@ def inject():
|
|||||||
inject_style = request.form['inject_style']
|
inject_style = request.form['inject_style']
|
||||||
settings.inject_style = InjectStyle[inject_style]
|
settings.inject_style = InjectStyle[inject_style]
|
||||||
|
|
||||||
print(str(settings))
|
if storage.get_project(project_name) != None:
|
||||||
|
project = storage.get_project(project_name)
|
||||||
project = Project(project_name, settings)
|
project.settings = settings
|
||||||
project.settings = settings
|
else:
|
||||||
storage.add_project(project)
|
project = Project(project_name, settings)
|
||||||
|
project.settings = settings
|
||||||
|
settings.project_name = project_name
|
||||||
|
storage.add_project(project)
|
||||||
storage.save_data()
|
storage.save_data()
|
||||||
return render_template('project_add_post.html')
|
return redirect("/project/{}".format(project_name), code=302)
|
||||||
else:
|
|
||||||
|
else: # GET
|
||||||
exes = []
|
exes = []
|
||||||
for file in os.listdir("app/upload/exe"):
|
for file in os.listdir("app/upload/exe"):
|
||||||
exes.append(file)
|
exes.append(file)
|
||||||
@@ -124,7 +127,6 @@ def inject():
|
|||||||
#start(settings)
|
#start(settings)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@views.route("/build")
|
@views.route("/build")
|
||||||
def build():
|
def build():
|
||||||
exes = []
|
exes = []
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ logger = logging.getLogger("Project")
|
|||||||
|
|
||||||
class Project():
|
class Project():
|
||||||
def __init__(self, settings: Settings):
|
def __init__(self, settings: Settings):
|
||||||
|
self.name: str = ""
|
||||||
self.settings: Settings = settings
|
self.settings: Settings = settings
|
||||||
self.payload: Payload = Payload(self.settings.payload_path)
|
self.payload: Payload = Payload(self.settings.payload_path)
|
||||||
self.exe_host: ExeHost = ExeHost(self.settings.inject_exe_in)
|
self.exe_host: ExeHost = ExeHost(self.settings.inject_exe_in)
|
||||||
|
|||||||
Reference in New Issue
Block a user