ui: show some more important information and checks

This commit is contained in:
Dobin
2024-05-01 22:30:53 +01:00
parent 3e6c1e06cf
commit c372d348ce
6 changed files with 52 additions and 10 deletions
+9 -2
View File
@@ -86,10 +86,18 @@
<!-- Row 3: exe and shellcode info -->
<div class="col-2">
x64: {{ is_64 }} / Dotnet: {{ is_dotnet}} <br>
{% if is_64 %}
x64: {{ is_64 }}
{% else %}
<span class="text-danger">x64: {{ is_64 }}</span>
{% endif %}
/ Dotnet: {{ is_dotnet}} <br>
.text: {{ code_sect_size}} <br>
.rodata: {{ data_sect_size}}
(max: {{ data_sect_largest_gap_size}}) <br>
{% if not has_rodata_section %}
<span class="text-danger">No .rodata section</span> <br>
{% endif %}
{% if unresolved_dlls|length > 0 %}
<br>
@@ -129,7 +137,6 @@
</select>
</div>
</div>
</form>
+8 -2
View File
@@ -19,8 +19,14 @@ def index():
@views.route("/exes/<exe_name>")
def exe_view(exe_name):
path = "{}/{}".format(PATH_EXES, exe_name)
superpe = SuperPe(path)
# TODO
filepath = "{}{}".format(PATH_EXES, exe_name)
if not os.path.exists(filepath):
filepath = "{}{}".format(PATH_EXES_MORE, exe_name)
if not os.path.exists(filepath):
return "File not found: {}".format(exe_name)
superpe = SuperPe(filepath)
return render_template('exe.html',
superpe=superpe,
+15 -4
View File
@@ -71,15 +71,25 @@ def project(name):
# when we selected an input file
if project.settings.inject_exe_in != "" and os.path.exists(project.settings.inject_exe_in):
superpe = SuperPe(project.settings.inject_exe_in)
#if not superpe.is_64():
# # return 500
# return "Error: Binary {} is not 64bit".format(project.settings.inject_exe_in), 500
is_64 = superpe.is_64()
is_dotnet = superpe.is_dotnet()
if superpe.is_dll():
exports = superpe.get_exports_full()
code_sect_size = superpe.get_code_section().Misc_VirtualSize
data_sect_size = superpe.get_section_by_name(".rdata").virt_size
exehost = ExeHost(project.settings.inject_exe_in)
exehost.init()
data_sect_largest_gap_size = exehost.get_rdata_relocmanager().find_largest_gap()
if superpe.get_section_by_name(".rdata") != None:
data_sect_size = superpe.get_section_by_name(".rdata").virt_size
else:
logger.warn("No .rdata section found in {}".format(project.settings.inject_exe_in))
has_rodata_section = superpe.has_rodata_section()
if has_rodata_section:
exehost = ExeHost(project.settings.inject_exe_in)
exehost.init()
data_sect_largest_gap_size = exehost.get_rdata_relocmanager().find_largest_gap()
unresolved_dlls = pe.dllresolver.unresolved_dlls(superpe)
@@ -120,6 +130,7 @@ def project(name):
data_sect_largest_gap_size=data_sect_largest_gap_size,
payload_len=payload_len,
unresolved_dlls=unresolved_dlls,
has_rodata_section=has_rodata_section,
has_remote=has_remote,
)