Skip to content

Release 6.0.0

Latest

Choose a tag to compare

@struppigel struppigel released this 21 Oct 07:32
· 2 commits to master since this release

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 return java.util.Optional instead of the Guava Optional. Guava is no longer a transitive dependency.
  • New signature scanner API. MatchedSignature is now SignatureMatch, and the five signature getters of PEData are replaced by getSignatureMatches(LocationKind...).
  • Signature names lose their outer brackets, [NSIS] is now NSIS. This also applies to anomaly and reversing hint texts.
  • New report format for signatures. ReportCreator.peidReport() is now signatureReport(), and matches are printed as Armadillo 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.cert parses 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.
  • AuthenticodeVerifier checks 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

  • StructureMap maps 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 Visualizer code 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, createLegendImage no 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. --layout prints all structures of the file.
  • -p draws the file with the new visualizer. --from and --to draw a range, with hex bytes for ranges up to 4 KB, and --visoverlay works now.
  • --sigs <folder> also scans with the .sig files in the folder.
  • --dump certificates writes the signatures as .p7b and the certificates as .cer files.
  • Reports have a new section, Authenticode Signatures, and the new signature line format.

Maven Central: io.github.struppigel:portex_2.12:6.0.0