This article applies to:
- Trustwave SEG/MailMarshal SMTP
How do Spammers encode or obfuscate HTTP links (URLs)?
Spammers encode or obfuscate URLs in different ways to bypass spam filtering or mask spamming activity.
Spammers insert encoded characters into URLs to bypass spam filtering or mask spamming activity. A basic understanding of binary, octal, decimal and hexdecimal number systems and how to convert from one system to another is assumed in the following examples. The following techniques and examples explain how spammers encode URLs with the number systems.
Internet Explorer interprets an IP address that is encoded to a single decimal number as an actual IP address. For example, you can encode the loopback address,
http://127.0.0.1/, using the decimal numbering system.
- Convert each octet (each part of the IP address) into binary. Remember to pad each binary number on the left (most significant bit, or MSB) with zeroes to give you 8 bits.
127 = 01111111
0 = 00000000
0 = 00000000
1 = 00000001
Join all the binary numbers together:
Convert the result to decimal, yielding:
Insert the result into the URL or in a link. Your browser will interprets the following as
- Convert each octet of the IP address into octal. Remember to pad each octal number on the left with a zero. In each case the MSB (leftmost) digit needs to be 0.
127 = 0177
0 = 0
0 = 0
1 = 01
These octal numbers can now be used in the URL, and the browser will interpret as
- Convert the IP address to decimal. See result from the previous decimal encoding example.
- Convert the decimal result from the decimal encoding example to hexadecimal.
2130706433 = Hex
0x in front of the number.
- Create the URL, yielding:
ASCII Value encoding
Since individual characters in the URL can be represented by their equivalent ASCII decimal or hex value, the encoded characters can be applied to some or all of the characters in the URL. These ASCII encoded addresses cannot be used directly in the browser URL locator, but your browser decodes these obfuscated links correctly if used in a HTML page or HTML Spam message. For example, you can encode the URL for the Trustwave website, http://www.trustwave.com/, in the following progression to create a highly obfuscated URL:
- In ASCII, the 'w' character can be represented by its hex value of %77 or its decimal value of w:
- The http part of the link can be encoded:
- It is possible to apply the ASCII encoding on IP addresses already encoded in Octal, Decimal or Hexadecimal. For example, combining hex encoding with ASCII encoding, and applying to
127.0.0.1, can give the following highly obfuscated URL:
You can use the Microsoft Windows Calculator in Scientific mode to translate Decimal, Hex, Octal, and Binary.
- This article was previously published as: