← All Challenges

Challenge 16: Ratio Padding

Difficulty: Easy
Category: Non-Printable Ratio Bypass


Objective

You have binary shellcode that contains a high proportion of non-printable bytes. This shellcode must remain intact and unmodified within the file. Your goal is to get the file past the scanner’s non-printable byte ratio check without altering the payload itself.

Scanner Behavior

The scanner calculates a global ratio of non-printable bytes to total file size:

ratio = non_printable_bytes / total_file_size

If this ratio exceeds 40% (and the file is at least 64 bytes), the file is flagged as suspicious.

The scanner does not analyze specific sections or regions of the file. It counts all non-printable bytes across the entire file and divides by the total size.

Rules

Hints

  1. The ratio is non_printable / total_size. You can’t reduce the numerator (the shellcode is fixed). What about the denominator?
  2. What if the file was much larger than just the payload?
  3. Adding printable content doesn’t break anything — but it dilutes the ratio.

View Solution