Repository navigation
PortEx 6.0.0
PortEx 6 has a new signature scanner, parses and verifies Authenticode signatures, and adds a structure map with a new visualization engine. It requires Java 17.
Breaking changes
- Java 17 or higher. PortEx 5.0.8 stays available on Maven Central for Java 8.
- No more Guava.
maybe...methods and other getters returnjava.util.Optionalinstead of the GuavaOptional. Guava is no longer a transitive dependency. - New signature scanner API.
MatchedSignatureis nowSignatureMatch, and the five signature getters ofPEDataare replaced bygetSignatureMatches(LocationKind...). - Signature names lose their outer brackets,
[NSIS]is nowNSIS. This also applies to anomaly and reversing hint texts. - New report format for signatures.
ReportCreator.peidReport()is nowsignatureReport(), and matches are printed asArmadillo v4.x at entrypoint+0x0 (file offset 0x1a9f5, 190 bytes).
The migration guide lists the replacement for every removed class and method.
Signature scanner
- One database format for all signatures, described in SIGNATURES.md: byte patterns and strings, several patterns per signature, and conditions on sections, imports, exports, resources, version info and .NET metadata.
- Signatures match at locations: entry point, sections, overlay, resources, exports, MS-DOS header and stub, Rich header, debug data, certificate table, .NET metadata, the whole file or its end.
- some signatures converted from Detect It Easy
- Faster: a scanner compiles its database once and is immutable and thread-safe, whereas PortEx 5 reloaded the databases for every file.
Authenticode
- package
parser.sections.certparses the certificate table: WIN_CERTIFICATE entries, PKCS#7 signatures, X.509 certificates, signers, countersignatures, RFC 3161 timestamps, nested signatures and page hashes. No extra dependency is needed. AuthenticodeVerifierchecks integrity: image digest, message digest, signer signature, certificate signatures and timestamps. It does not check revocation or expiry.- New
CERT_anomalies, among them data after the PKCS#7 structure (CVE-2013-3900), CurveBall (CVE-2020-0601), Psychic Signatures (CVE-2022-21449), image digest mismatches, and weak or SHA-1 digests.
Structure map and visualizer
StructureMapmaps every file offset to the structures found there- A new visualization engine with thread-safe renderers for byte plot, entropy, structure, hex and ASCII tracks.
- Existing
Visualizercode keeps working and produces the same images by default.VisualizerBuilder.setLegacyStyle(false)switches to the new look. - Fixes in the default images: the legend no longer depends on the order of calls,
createLegendImageno longer throws when called first, and empty files no longer throw.
Anomalies, hints and fixes
- 88 new anomaly subtypes, among them ECMA-335 checks for the CLI header, metadata root,
#~stream and tables of .NET files, and the Authenticode anomalies. - The Optional Header checksum is verified in the regular anomaly scan (
INVALID_CHECKSUM). - Reversing hints for PS2EXE and for data hidden in the certificate table.
- Malformed .NET metadata no longer throws or allocates gigabytes.
- The certificate table address is treated as a file offset, not as an RVA.
- Correct locations for:
- the fields of every section header and .NET table row (before, those of the first one were reported)
- whole export names, including the DLL name and forwarder strings
- imported DLL names
PortexAnalyzer
-l/--loc <offset>prints all structures at an offset.--layoutprints all structures of the file.-pdraws the file with the new visualizer.--fromand--todraw a range, with hex bytes for ranges up to 4 KB, and--visoverlayworks now.--sigs <folder>also scans with the.sigfiles in the folder.--dump certificateswrites the signatures as.p7band the certificates as.cerfiles.- Reports have a new section, Authenticode Signatures, and the new signature line format.
Maven Central: io.github.struppigel:portex_2.12:6.0.0