-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/lief15 #111
Feature/lief15 #111
Conversation
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prabhu testing results are as expected testing against various rust, dotnet, and go binaries. No issues to report. Nice work!
Thanks @timmyteo. Could you do retest once more, since pushed some commits since your review. |
@@ -451,7 +452,7 @@ def process_pe_resources(parsed_obj): | |||
"has_manifest": rm.has_manifest, | |||
"has_string_table": rm.has_string_table, | |||
"has_version": rm.has_version, | |||
"manifest": (rm.manifest.replace("\\xef\\xbb\\xbf", "") if rm.has_manifest else None), | |||
"manifest": (rm.manifest.replace("\\xef\\xbb\\xbf", "").removeprefix("\ufeff") if rm.has_manifest else None), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removes the byte order mark
blint/binary.py
Outdated
"verification_flags": str(parsed_obj.verify_signature()).replace( | ||
"VERIFICATION_FLAGS.", "" | ||
), | ||
"verification_flags": str(parsed_obj.verify_signature()).split(".")[-1], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplifies the flag by only containing the last part.
@@ -561,11 +560,7 @@ def parse_pe_symbols(symbols): | |||
if not symbol: | |||
continue | |||
try: | |||
if symbol.section_number <= 0: | |||
section_nb_str = str(lief.PE.SYMBOL_SECTION_NUMBER(symbol.section_number)).rsplit( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was always erroring out for me so removed it.
@@ -1113,6 +1106,12 @@ def add_pe_metadata(exe_file: str, metadata: dict, parsed_obj: lief.PE.Binary): | |||
if e["name"] == "ntoskrnl.exe": | |||
metadata["is_driver"] = True | |||
break | |||
rdata_section = parsed_obj.get_section(".rdata") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this, we are able to catch more bundled .go and .dll files.
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Noticed that cdxgen sbom is missing evidence with research profile. This needs to be investigated separately. cc: @aryan-rajoria |
@prabhu I retested against the main branch, which now has this feature branch merged. No issues to report and test cases passed as expected. |
Thank you so much! |
Updated to lief 0.15.1
https://lief.re/doc/stable/changelog.html
By parsing .rdata and .text section, we can identify more capabilities. Example below is a go binary bundled inside a PE binary. Samples here.