Commit graph

4,813 commits

Author SHA1 Message Date
DosX
9853fdc223 Rename MSDOS rule files; adjust RM_FORTRAN mode
Rename several MSDOS detection rule files to include category prefixes and improve organization. Files renamed:
- db/MSDOS/RM_FORTRAN.4.sg -> db/MSDOS/compiler_RM_FORTRAN.4.sg (mode changed 100755 -> 100644; only whitespace/formatting normalized, no detection logic change)
- db/MSDOS/REC_small_AV.1.sg -> db/MSDOS/immunizer_REC_small_AV.1.sg
- db/MSDOS/RLE_com-packer.2.sg -> db/MSDOS/packer_RLE_com-packer.2.sg
- db/MSDOS/REC_small.1.sg -> db/MSDOS/protector_REC_small.1.sg
- db/MSDOS/anti-tracing_add-on.1.sg -> db/MSDOS/protector_anti-tracing_add-on.1.sg

No functional changes to detection rules aside from the noted formatting and permission adjustment.
2026-06-21 13:09:22 +03:00
DosX
82e408f2df Rename DB files to sfx_ and compiler_ prefixes
Rename several database pages to standardized prefixes for clearer organization: db/LX/{PKZIP-SFX.1.sg,RAR-SFX.1.sg} -> db/LX/sfx_PKZIP-SFX.1.sg and db/LX/sfx_RAR-SFX.1.sg; db/MSDOS/{Microsoft_Fortran.4.sg,Microsoft_Quick_Basic.4.sg} -> db/MSDOS/compiler_Microsoft_Fortran.4.sg and db/MSDOS/compiler_Microsoft_Quick_Basic.4.sg. Files are unchanged (100% similarity); only filenames were updated to reflect type (sfx for self-extractors, compiler for compilers).
2026-06-21 12:46:12 +03:00
DosX
bb3351fdbb Rename Borland C to C++ and update sLang
Rename db/LX/compiler_Borland_C.4.sg to db/LX/compiler_Borland_C++.4.sg and update the detect() function to set sLang from "C/C++" to "C++". This adjusts the file/name to explicitly represent the C++ compiler and aligns the language identifier accordingly; no other functional changes.
2026-06-21 12:44:48 +03:00
DosX
b0f6c22d8d Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-21 12:43:23 +03:00
DosX
86151c660f Strengthen de4dot .NET detection logic
Refine the PE.NET detection in tool_de4dot.6.sg: accept either method_0 or smethod_0 and require either both GClass0 & GClass1 or both Class0 & Class1. Previously the check relied on smethod_0 and allowed a single GClass0 (or Class0+Class1), which could produce false positives; this change makes detection stricter and more accurate.
2026-06-21 12:43:13 +03:00
Benjamin Funke
3c0c6b8a53 add references to LX signatures 2026-06-21 11:31:02 +02:00
Benjamin Funke
fa082ddaf1 add references to MACH signatures 2026-06-21 11:29:03 +02:00
DosX
dac2016dfb Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-21 12:26:31 +03:00
DosX
3113bca5ed Expand malware signature list with more variants
Add additional signature variants to the signsToCheck array in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg (scanForMaliciousCode_NET_and_Native). New entries cover different capitalizations and synonyms for file/cookie/wallet stealers (e.g. Grabfiles/stealfiles, GrabCookies, WalletsStealer/WalletsGrabber) to improve detection coverage for varied naming conventions.
2026-06-21 12:26:22 +03:00
Benjamin Funke
96836f65dc redefine Virbox signature as protector 2026-06-21 11:25:36 +02:00
DosX
e087251e33 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-21 12:22:27 +03:00
DosX
f249f403a6 Categorize and rename MSDOS rule files
Rename many db/MSDOS detection rules to include category prefixes (e.g. compiler_, extender_, immunizer_, linker_, protector_, other_) for clearer organization. Add sLang assignment for Microsoft_C rule to set "C" or "C/C++" based on sName. Normalize formatting/whitespace in several scripts and remove executable bit from a few rule files. No detection logic changes besides the explicit sLang assignment.
2026-06-21 12:22:16 +03:00
Benjamin Funke
fb7147c698 rename library_java to library_Java
Also added reference to the Java website
2026-06-21 11:19:12 +02:00
DosX
4f6397516c dbs_min update 2026-06-21 12:14:04 +03:00
DosX
a5b91db3ad Refactor MSDOS rule filenames; set LSI C language
Renamed multiple db/MSDOS detection rule files to include category prefixes (compiler_, library_, protector_, self-displayer_, sfx_) for clearer organization. Cleared executable bits on LSI_C and Khrome_Crypt files (100755 → 100644). Added sLang = "C" to the LSI C detection rule to explicitly mark the language. No other functional changes.
2026-06-21 12:13:36 +03:00
DosX
20c1d39026 Set sLang in detectors; rename DB files
Populate sLang in several MS-DOS detector scripts so the detected language is recorded (Logitech_Modula-2.4: sLang = "Modula-2"; ASIC-Basic, ApBasic, BetterBASIC, Turbo_Basic: sLang = "Basic"). Also rename L_O_V_E__FORTH.4.sg to compiler_L_O_V_E__FORTH.4.sg and Phar_Lap.0a.sg to extender_Phar_Lap.0a.sg to standardize database file naming. No other logic changes.
2026-06-21 12:06:59 +03:00
DosX
9a03a2c257 Reclassify and rename MSDOS rule files
Rename multiple files in db/MSDOS to add category prefixes (e.g. converter_, extender_, packer_, protector_, self-displayer_) for clearer organization. Remove executable bit on several .sg files (mode 100755 -> 100644) and apply minor whitespace/line-ending normalization in a few detection rules (no functional changes).
2026-06-21 12:01:50 +03:00
DosX
798b437caa Add Rabby Wallet signature to heuristics
Append Rabby Wallet signature string to the PE heuristic list in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg to improve detection of Rabby Wallet-related binaries.
2026-06-21 11:57:24 +03:00
DosX
d0fb016461 Remove sOptions assignment in MACH gcc detect
Stop forcing sOptions = "C/C++" in db/MACH/compiler_gcc.4.sg when libgcc_s.1.dylib is present. The detection now only sets bDetected, avoiding an unintended override of compiler option state elsewhere.
2026-06-21 11:40:53 +03:00
DosX
5890991148 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-21 11:38:47 +03:00
DosX
74a0883a84 Stop .NET header loop early; add OneKey Wallet sig
Limit iteration in scanForObfuscations_NET by adding an early-exit condition to the for loop (for ... && !isStrangeEpPosition) and remove the redundant break. Also append the OneKey signature string to the malicious signature array in scanForMaliciousCode_NET_and_Native so it is recognized by heuristics.
2026-06-21 11:38:44 +03:00
Benjamin Funke
6b276f63cb improve gcc MACH signature
Change bDetected types to = true to sync our coding standards, remove an duplicated MACH variant which is already in use by the signature
2026-06-21 09:57:53 +02:00
Benjamin Funke
82469c4924 add reference for Delphi signature 2026-06-21 09:56:18 +02:00
Benjamin Funke
f38b4b9623 add references for NE signatures 2026-06-21 09:50:46 +02:00
Benjamin Funke
cc0e869a2b add references for PE signatures 2026-06-21 09:46:17 +02:00
Benjamin Funke
511c99562f add references to signatures 2026-06-20 22:32:01 +02:00
Benjamin Funke
f46b3ca1ac remove newlines in MS-XNA/KTX signature 2026-06-20 21:36:33 +02:00
DosX
cf5a235a54 dbs_min update 2026-06-20 19:44:12 +03:00
DosX
10b6350cb5 Extend PE compare signature; minor formatting
Extend the PE.compare pattern used to skip bitmap resources by adding extra trailing zero bytes to the signature, reducing false positives when determining resource types. Also perform minor whitespace/formatting cleanups in heuristic functions (isNameObfuscated and scanForLanguagesAndCompilers) to improve readability.
2026-06-20 19:43:24 +03:00
DosX
d77aa6f6dd Skip empty/small sections during entropy scan
Add a guard in scanForPackersAndCryptors_NET_and_Native to skip sections with FileOffset == 0 or FileSize < 0x1000 before calculating entropy. This avoids reading invalid/empty section data and reduces false/high-entropy detections for very small sections, improving robustness of packer/cryptor detection.
2026-06-20 19:33:40 +03:00
DosX
10fa1b1822 Only skip tiny sections when sectionOffset > 0
Restrict the small-section skip in scanForMaliciousCode_NET_and_Native to cases where sectionOffset > 0. This prevents erroneously bypassing section processing when sectionOffset is zero or unset, preserving entry/resource section checks and improving heuristic scanning accuracy in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg.
2026-06-20 16:09:22 +03:00
DosX
16aff736fc dbs_min update 2026-06-20 15:59:58 +03:00
DosX
722077df81 Allow wildcards in sub ebp immediate pattern
Replace the fixed immediate bytes in the heuristic pattern (was `81 ED 32 6F 01 20`) with wildcards (`81 ED ?? ?? 01 20`) in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg. This relaxes the signature for the `sub ebp, imm` instruction so the rule can match more binary variants while keeping the surrounding instruction sequence intact for detection.
2026-06-20 15:59:50 +03:00
DosX
eb07d5723d Refactor risk score calc and verdict details
Introduce a percentageOfRiskScore variable to avoid recomputing the risk expression and clamp it to 100. Use this variable in the verdict details string and append the mayBeInfected note when the computed percentage is below 70%, improving readability and providing conditional infection context.
2026-06-20 08:06:00 +03:00
DosX
ddcb553e3f dbs_min update 2026-06-20 07:42:54 +03:00
DosX
7c7194f655 Refactor scanning: extract scanArea and improve heuristics
Extracted a reusable scanArea(areaOffset, areaSize) helper to centralize base64/anchor scanning and replaced global/unicode scanning with targeted scans. Add targeted scanning of PE sections, unmanaged resources and the overlay (gated by packer/protector results), with optimizations to skip unlikely sections (small sections, common .text/.rsrc/.idata/.reloc cases) and to only target large resources (>4KB) while skipping bitmaps. Also renamed/cleaned up offset variables and simplified encrypted-payload scanning logic by consolidating maxScanSize/dataBuffer creation and removing redundant conditionals. These changes improve performance and detection coverage.
2026-06-20 07:42:34 +03:00
DosX
f22203954f Extend section name regex to match .edata/.xdata
Update the section name pattern from /^\.(?:r)?data$/i to /^\.[rex]?data$/i so .edata and .xdata (in addition to .rdata and .data) are recognized and get the larger scan size when scanning for malicious code.
2026-06-20 06:02:20 +03:00
DosX
3a4f9a10e6 Detect ASCII/UTF-16LE Base64 payloads
Replace simple signature variants with robust Base64 payload detection for both ASCII and UTF-16LE encodings. The patch checks for "TV" + raw postfix bytes in the DOS stub (ASCII) and searches for a UTF-16LE "TV" anchor plus Unicode signature masks, sets a base64Version flag, and emits an "Encoded executable payload" verdict including the encoding (Base64, ASCII/UTF-16LE). Removes the prior validateGlobalUnicodeString/validateSignature path and consolidates detection logic.
2026-06-20 05:59:25 +03:00
DosX
90db1886d7 dbs_min update 2026-06-19 17:53:21 +03:00
DosX
88548b7a0b Clarify detection scope in comment
Update comment to explicitly state the heuristic detects encrypted PE files in resources, sections, and overlay via KPA (Known Plaintext Attack). This is a documentation-only change to clarify detection scope; no functional code changes.
2026-06-19 17:52:58 +03:00
DosX
0ab54f846c Label payloads as executable and skip PE sections
Update verdict labels to specify "executable" for Base64 and encrypted payloads for clarity. Add an optimization comment and additional checks to skip scanning common PE sections (.rsrc, .idata, .reloc) when they're unlikely to contain encrypted payloads, and reorder a conditional for the entry-point/.text check to be more robust.
2026-06-19 17:49:09 +03:00
DosX
0a74ea574a Optimize PE scan loop and hex decoding
Performance and readability refactor of the PE heuristic scanner.

- Introduce Uint8Arr alias (fallback to Array) and a hexLUT typed lookup table for fast hex-to-byte decoding.
- Replace dynamic per-byte hex parsing with LUT and allocate decoded buffers as Uint8Arr to reduce overhead.
- Refactor scanBuffer: hoist variables, minimize re-computation, and apply lazy evaluation for alternative decryption checks (ADD/SUB and SUB/REV) to short-circuit work when XOR/XNOR matches.
- Minor cleanup of PE header offset assignment/comment.

Changes are intended to improve speed and reduce allocations while preserving existing verification logic.
2026-06-19 11:45:39 +03:00
DosX
b92aeb6e9a Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-19 11:22:34 +03:00
DosX
5f45111d01 Refactor getDecrypted and add conhost.exe
Change the inner getDecrypted implementation to a named function with combined variable declarations and clearer multiline ternary formatting for readability; no functional change to the decryption logic. Also add "conhost.exe" to systemFileNamesDict so the console host is treated as a system-signed filename.
2026-06-19 11:22:31 +03:00
Benjamin Funke
f4aa94179a add ObjGrid signature 2026-06-19 01:18:10 +02:00
Benjamin Funke
d7ce667b68 add FluidSynth signature 2026-06-19 00:45:21 +02:00
Benjamin Funke
8d8fa5f773 add DWMAPI signature 2026-06-19 00:16:31 +02:00
Kaens
d74d71aa29 audio.1.sg now has unique format IDs for parsing + extra
(see Kaens/audio1sg for details)
2026-06-18 20:06:01 +02:00
DosX
400ed3f5d9 dbs_min update 2026-06-18 19:34:33 +03:00
DosX
8dc9261189 Support SUB-REV mode and PE verification fix
Add detection/support for a new SUB-REV (arithmetic-reverse) decryption mode: introduce mode 2 in verifyPeSignature and extend the universal decryptor return to handle SUB-REV. Compute reverse expected bytes (e0_rev/e1_rev) and add a matching detection branch. Also fix PE header offset handling (avoid double addition of peStartOffset) and normalize algorithm labels (e.g. "XOR-XNOR", "ADD-SUB") and the verdict version string to include "Algo: ". These changes improve heuristic coverage for encrypted PE payloads using reversed subtraction schemes.
2026-06-18 19:34:17 +03:00