Basic Binary Strings Research

If you are familiar with web vulnerabilities and you want to analyze the administrative panel of your network device you can easily start from.. basic binary string research! This simple trick will help you discover which headers are used by HTTPD Server to communicate with. It will allow you to save time by not using unavailable headers during your penetration requests 😉

Let’s jump into your device vendor’s website, download firmware and try to extract it via the Binwalk tool (using extract binary parameter -e). Once we have our binary extracted to analyse (in our case it will be a HTTPD server) we can start to scrap every readable string from it:

λ  ~  strings research/wr840v3/httpd > dump.txt

Now it’s time to check which web header is available in our binary. I’ve prepared very simple script in Python to do it:

# List from:
headers = [

import sys

if len(sys.argv) != 2:
  print("""Httpd Binary Parser v1.0

~$ strings <binary> > dump.txt
~$ python3 dump.txt

with open(str(sys.argv[1])) as reader:
  cnt = 1
  for line in reader.readlines():
    line = line.rstrip()

    for header in headers:
      if line.find(header) > 0:
        print("[FOUND! #{} header: {}] {}".format(cnt, header, line))

    cnt = cnt + 1

Ok, so now let’s run our code with the HTTPD server and see the results:

λ  ~  python3 dump.txt
[FOUND! #2790 header: Referer] httpMimeReferer

The `Referer` header helped me to execute a Local File Include && Os Command Injection bugs in the WR840N router (in the last few days) and of course – the Referer header is a sample but this scan will be more profitable with less common headers included in HTTPD server.

This little, silly script above returns a couple of false positives but despite that parsing binary strings allow you to find some interesting `web-data` a little bit faster 😉

Happy hunting!

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to Top