ForenSec
2.46K subscribers
435 photos
34 videos
533 files
720 links
Download Telegram
New SSRF Bypass or How to Surprise a Colleague in the Evening
#dns #ssrf #bypass #hex

[ It turned out to be an ancient method, but I saw it for the first time :) ]

We all use IPv4 every day. We all use IPv6 every day. But right now one guy from the chat surprised me by opening his eyes that DNS resolves even IP in Hex format.

Hex IP is a hexadecimal representation of an IP address. Typically, an IP address is written in the familiar dotted notation, such as 192.168.0.1 , where each part is a decimal byte value (0 to 255). However, the same address can be represented in hexadecimal.

Operating principle:

An IP address consists of 4 bytes, and each byte can be represented in hexadecimal format (00 to FF):

The decimal IP 192.168.0.1 is represented as four bytes: 192 (0xC0), 168 (0xA8), 0 (0x00), 1 (0x01).
Hex representation will be C0A801001.

How to convert IP address to hexadecimal format:

Take each octet of the IP address and convert it to hexadecimal.
Combine these values ​​into a string without periods.

If you enter a URL like http://0xC0A80001, the browser or server may interpret this as a request for http://192.168.0.1 .

For convenient conversion, you can use the following command:
 printf '%02X' 192 168 0 1 ; echo

You will get the following output: C0A80001 , substitute 0x - hex code

We go to http://0xC0A80001 and wow, it works
πŸ‘3