Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Adversaries may use binary padding to add junk data and change the on-disk representation of malware.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | -15% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 61% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -18% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -37% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -65% | 0% |
> Sub-technique of: T1027
Adversaries may use binary padding to add junk data and change the on-disk representation of malware. This can be done without affecting the functionality or behavior of a binary, but can increase the size of the binary beyond what some security tools are capable of handling due to file size limitations.
Binary padding effectively changes the checksum of the file and can also be used to avoid hash-based blocklists and static anti-virus signatures. The padding used is commonly generated by a function to create junk data and then appended to the end or applied to sections of malware. Increasing the file size may decrease the effectiveness of certain tools and detection capabilities that are not designed or configured to scan large files. This may also reduce the likelihood of being collected for analysis. Public file scanning services, such as VirusTotal, limits the maximum size of an uploaded file to be analyzed.
Platforms: Linux, Windows, macOS
The following tests are from Atomic Red Team and provide actionable ways to test this technique:
Uses dd to add a zero byte, high-quality random data, and low-quality random data to the binary to change the hash.
Upon successful execution, dd will modify /tmp/evil-binary, therefore the expected hash will change.
Supported Platforms: linux, macos
bashdd if=/dev/zero bs=1 count=1 >> #{file_to_pad} #adds null bytes dd if=/dev/random bs=1 count=1 >> #{file_to_pad} #adds high-quality random data dd if=/dev/urandom bs=1 count=1 >> #{file_to_pad} #adds low-quality random data
Dependencies:
Uses truncate to add a byte to the binary to change the hash.
Upon successful execution, truncate will modify /tmp/evil-binary, therefore the expected hash will change.
Supported Platforms: linux, macos
bashtruncate -s +1 #{file_to_pad} #adds a byte to the file size
Dependencies:
If Atomic Red Team tests are not applicable, manually verify the technique by:
No specific mitigations documented for this technique.
| Finding | Severity | Impact | | ----------------------------------- | -------- | --------------- | | Binary Padding technique applicable | Low | Defense Evasion |
| CWE ID | Title | | ------- | ---------------------------- | | CWE-693 | Protection Mechanism Failure |
Other measured skills in the registry, with their headline benchmark lift.