Commit graph

4,837 commits

Author SHA1 Message Date
Benjamin Funke
342dda3064 add update_info_timestamp scripts 2026-06-23 17:54:39 +02:00
horsicq
74e9ca450d chore: update date to 2026-06-23 in db info files 2026-06-23 01:46:57 +02:00
DosX
eed67fc08d dbs_min update 2026-06-22 18:55:48 +03:00
Benjamin Funke
958258a5cd update DiE version in RUN.md 2026-06-22 17:34:53 +02:00
DosX
d23269a06e Add VCasm-Protector and Excalibur detections
Add new heuristics to PE DB: insert VCasm-Protector (version 1.1-1.2, hash 0xcfed7c1e) and Excalibur (version 1.0X, hash 0x7f364e1f) into the packer/cryptor signature list, and add a section-name rule for VCasm-Protector ('vcasm'). Also adjust array punctuation for the appended entries.
2026-06-22 18:33:43 +03:00
DosX
6b53f22ae4 Improve Skater .NET detector
Add upstream GitHub reference and replace the slow signature-in-section check with PE.isNetObjectPresent checks for 'RustemSoft.Skater' and 'RustemSoft.Skater.Skater_NET_Obfuscator' to speed up detection. Keeps the existing EP .NET compare logic and version detection for 2.X.
2026-06-22 18:33:15 +03:00
DosX
5c5e3ad911 Rename and refactor Unicode signature generator
Rename generateUnicodeSignatureMask to convertStringToUnicodeSignature and change its output to a continuous UTF-16LE hex string (no spaces) with consistent zero-padding. Update all callers accordingly across the PE heuristics file, adjust doc examples to the new format, and remove an obsolete substring adjustment for the NjRAT separator pattern. These changes standardize how UTF-16LE signatures are produced and consumed by PE.isSignature*/PE.findSignature calls.
2026-06-22 16:47:15 +03:00
DosX
1af9c5240f dbs_min update 2026-06-22 16:29:29 +03:00
DosX
a8180360d2 Refactor variable names in heuristics
Rename many internal variables in scanForMaliciousCode_NET_and_Native to clearer, self-descriptive identifiers (e.g. k0_off/k1_off/k3_off -> offsetKey0/offsetKey1/offsetKey3, lfa*_off -> offsetLfa*, keyLen/j/L -> keyLength/offset, and byte variables like b0/b1 -> cipherM/cipherZ, etc.). Changes span the pre-calculation block, verifyPeSignature, and scanBuffer to improve readability and maintainability. No functional logic changes intended — behavior should remain the same.
2026-06-22 16:29:00 +03:00
DosX
61509245aa Optimize signature pattern checks
Adjust signature pattern handling in scanForMaliciousCode_NET_and_Native.

- Remove the added "??" prefix when building njRatDataSeparatorPattern so the pattern uses the substring directly.
- Remove the trailing " **" wildcard from the Unicode " RAT" signature passed to PE.isSignatureInSectionPresent to narrow matching.
2026-06-22 16:28:35 +03:00
DosX
6774f5bfb8 Generate precise UTF-16LE hex signature mask
Rewrite generateUnicodeSignatureMask to produce UTF-16LE hex byte sequences for each character. The new implementation uses charCodeAt to extract code units, computes low/high bytes in little-endian order, pads bytes to two hex digits (ES3/ES5 compatible), and joins byte pairs with spaces. This replaces the previous quoted 'char'00' style output and correctly handles non-ASCII characters.
2026-06-22 16:27:49 +03:00
DosX
c4c388de73 Refactor PE scan buffer decoding and checks
Replace custom hex decoding and helper with direct PE.readBytes, removing hexLUT and getDecodedBuffer to reduce overhead. Simplify scanBuffer signature and internals (rename comment, local caching, remove unused offsetBase), tighten verifyPeSignature comments and remove redundant explanatory comments. Use PE.readBytes for resources, overlay and sections, and keep existing algorithm detection logic intact; this is a cleanup/optimization to improve readability and performance without changing core behavior.
2026-06-22 16:15:17 +03:00
DosX
7f96c2e668 Simplify e_lfanew fast-fail and cache lfa3
Remove redundant b3 decode and consolidate the e_lfanew fast-fail check to test upper 16-bits against max bounds. Treat the MSB of e_lfanew as implicitly 0 and move its per-iteration validation into the main scan loop by caching lfa3_off as _lfa3 and reading the MSB (d3F) once per iteration. This reduces repeated reads and unnecessary variables, clarifies assumptions about e_lfanew, and slightly improves performance by localizing offsets and eliminating a prior separate fast-fail branch.
2026-06-22 16:09:36 +03:00
DosX
16791938db Optimize PE signature decryption and scanning
Inline and optimize PE header verification and scanning hot paths for performance. Added precomputed lfa*_off lookup tables for e_lfanew byte offsets and removed the getDecryptedByte helper by inlining decryption math inside verifyPeSignature to avoid function-call and modulo overhead. Reduced repeated arithmetic by caching base indices, precomputing remainder r, and validating high-order bytes early; also added maxLfa to avoid recomputing buffer bounds. Minor micro-optimizations: cache hexLUT locally in getDecodedBuffer, cache k*_off arrays in scanBuffer, and break out of loops once an encrypted PE is detected. Behavior and verification checks are preserved while improving throughput in tight scanning loops.
2026-06-22 16:07:28 +03:00
DosX
f2fa6b342b Optimize PE heuristic scanning and decryption
Performance and memory optimizations for the PE heuristic scanner:

- Tighten DOS-PDB scan loop to stop once pdbPathBeginOffset is found (avoids an extra break).
- Replace offset tables (k0_off/k1_off/k3_off) with typed Uint8Array to reduce allocations and improve access speed.
- Extract a single getDecryptedByte function (removed inner closure) to avoid per-call closure allocation and centralize decrypt logic.
- Add a fast-fail check for the most-significant byte of e_lfanew and simplify lfaNewOffset calculation to speed header validation.
- Replace multiple inline decryption calls with getDecryptedByte in verifyPeSignature for clarity and efficiency.
- Restructure the detection inner loop to early-continue on mismatches and apply lazy evaluation for arithmetic checks (ADD-SUB / SUB-REV) to reduce unnecessary work.

Behavior should be unchanged functionally while reducing CPU and memory overhead during scanning.
2026-06-22 16:02:50 +03:00
DosX
1837b16d0b dbs_min update 2026-06-22 14:55:45 +03:00
DosX
987d68a71d Optimize PE section scanning and caching
Cache section properties (offset, size, name) and replace direct PE.section accesses to improve readability and performance. Adjust skip logic to use cached sectionSize/sectionName. Expand scanning windows: scan .text of .NET assemblies up to 0x64000, increase data-like sections to 0x12000 and other sections to 0x6000 (previously smaller), to improve detection of encoded/encrypted payloads.
2026-06-22 14:55:36 +03:00
DosX
ab126dd877 dbs_min update 2026-06-22 14:02:37 +03:00
DosX
6b180e6bb8 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-22 14:02:01 +03:00
DosX
3303f77420 Standardize wildcard and broaden resource checks
Replace inconsistent byte wildcard in a signature ("81 ED ?? ?? 01 20" -> "81 ED .. .. 01 20") to match the file's wildcard convention, and expand resource-name detection by adding a regex for obvious malicious names (TROJAN, VIRUS, MALWARE, DROPPER). An inline comment was added explaining the resource-name check; minor spacing was also adjusted.
2026-06-22 14:01:59 +03:00
Benjamin Funke
0b2f054553 add references to PE signatures 2026-06-21 17:54:53 +02:00
DosX
134b93e3d2 dbs_min update 2026-06-21 13:10:07 +03:00
DosX
435cf589d0 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-21 13:09:24 +03:00
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
Benjamin Funke
4e608a54f6 add references for Aztec C/AmigaBasic signature 2026-06-21 11:54:54 +02: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