May 28, 2017 02:23 AM
(This post was last modified: May 28, 2017 02:39 AM by Asdethprime.)
Introduction to Web Hacking: Mapping The Attack Surface
When hacking a web server, one of the most important thing you need to do is map the appropriate surface.
Essentially what happens is that the web-server you are targeting is often a part of a much wider network. What you need to do is get a detail list of web-servers connected to a particular application that you can attack. Any one of the web server identified can be used to penetrate the network (and eventually rape it depending on how skilled you are and how vulnerable the system is).
Target and Operating System on the attacking machine
An awesome part in cyber security is that in most countries it’s completely legal to map a network including identyfing attack surface. Running a vulnerability scanner or attempting to fuzz applications running on the servers however is NOT legal.
However, since the part we are investigating is legal lets take a live web server.
For our example the web server we will be creating a skeleton to attack is : 123movesfree.com
As you can possible guess by the name it’s a website that streams free movies, and is distributed under Cloud Flare (that is bad for hackers because Cloud Flare has a rather effective web application firewall which makes hacking it more difficult).
Alright, enough of intro let's get into mapping the target.
Basic Security Before Proceeding
The first thing we want to do is set up proxychains and tor to prevent our anonymity. I am using Ubuntu though this should work for most linux terminals:
The command I would type is
$ sudo apt-get install tor
$sudo apt-get install proxychains
Once both of them are installed lets get to the actual work of mapping the target.
Mapping the Target
So the first thing I am going to use is ping to find the IP address of the target
$ ping 123moviesfree.com
I get the IP address to be : 213.247.47.190
Which is good, so the next thing we do is try running fierce.
Fierce is a DNS enumeration tool, free, open source (please feel free to google up on this because it's very useful) which is very useful for network enumeration. If anyone uses Kali Linux it should come pre-installed, if it doesn't finding and installing it should be a trival matter.
So the command I will run is :
$ proxychains perl fierce.pl -dns 123freemovies.com
Fierce does it's little things like bruteforcing the DNS and trying DNS zone transfer - which is a cool way to enumerate provided its working. As expected DNS zone transfer does not work.
The program however outputs a group of subnets worth probing futher:
Subnets found (may want to probe here using nmap or unicornscan):
173.239.2.0-255 : 1 hostnames found.
173.239.5.0-255 : 1 hostnames found.
174.137.132.0-255 : 1 hostnames found.
213.247.47.0-255 : 1 hostnames found.
54.225.100.0-255 : 1 hostnames found.
64.95.64.0-255 : 1 hostnames found.
So that's not a bad start.
Now we are going to ping individual subnets to figure out what IP address are live on the network and which of them belong to 123freemovies.com (through a reverse DNS lookup)
This is a lengthy process which tool me a whole day.
Just for tips this is how you would go about pinging host to find if any one of them are alive.
$ sudo proxychains nmap -T5 -sP 173.239.2.0–255
This scan returned 134 live host when most of them were not a part of 123freemovies.com
Iterating the process we get the following results:
The mapped attack surface
So this is the result we get:
184.95.38.195:123moviesfree.ae
104.31.87.5:123moviesfree.be
69.64.147.242:123moviesfree.biz
52.0.217.44:123moviesfree.bz
52.0.217.44:123moviesfree.cc
179.43.173.118:123moviesfree.ch
69.64.147.242:123moviesfree.co
104.27.141.252:123moviesfree.com
103.224.182.250:123moviesfree.cz
103.224.182.239:123moviesfree.de
104.18.37.66:123moviesfree.es
103.224.182.211:123moviesfree.eu
184.168.221.13:123moviesfree.in
104.28.2.151:123moviesfree.info
185.53.178.6:123moviesfree.io
185.53.178.8:123moviesfree.is
141.8.224.169:123moviesfree.it
173.208.215.108:123moviesfree.ml
72.52.4.121:123moviesfree.net
69.64.147.242:123moviesfree.org
45.79.222.138:123moviesfree.ph
164.138.223.139:123moviesfree.pro
128.199.141.59:123moviesfree.pw
185.53.179.8:123moviesfree.re
184.95.38.195:123moviesfree.se
91.144.20.76:123moviesfree.sy
195.20.41.218:123moviesfree.tk
178.175.129.10:123moviesfree.to
192.64.119.2:123moviesfree.today
69.64.147.242:123moviesfree.tv
198.54.126.90:123moviesfree.us
103.224.182.252:123moviesfree.vc
88.198.29.97:123moviesfree.vg
69.64.147.242:123moviesfree.ws
38 publicly reach-able servers for us to probe. Not bad for starters right.
When hacking a web server, one of the most important thing you need to do is map the appropriate surface.
Essentially what happens is that the web-server you are targeting is often a part of a much wider network. What you need to do is get a detail list of web-servers connected to a particular application that you can attack. Any one of the web server identified can be used to penetrate the network (and eventually rape it depending on how skilled you are and how vulnerable the system is).
Target and Operating System on the attacking machine
An awesome part in cyber security is that in most countries it’s completely legal to map a network including identyfing attack surface. Running a vulnerability scanner or attempting to fuzz applications running on the servers however is NOT legal.
However, since the part we are investigating is legal lets take a live web server.
For our example the web server we will be creating a skeleton to attack is : 123movesfree.com
As you can possible guess by the name it’s a website that streams free movies, and is distributed under Cloud Flare (that is bad for hackers because Cloud Flare has a rather effective web application firewall which makes hacking it more difficult).
Alright, enough of intro let's get into mapping the target.
Basic Security Before Proceeding
The first thing we want to do is set up proxychains and tor to prevent our anonymity. I am using Ubuntu though this should work for most linux terminals:
The command I would type is
$ sudo apt-get install tor
$sudo apt-get install proxychains
Once both of them are installed lets get to the actual work of mapping the target.
Mapping the Target
So the first thing I am going to use is ping to find the IP address of the target
$ ping 123moviesfree.com
I get the IP address to be : 213.247.47.190
Which is good, so the next thing we do is try running fierce.
Fierce is a DNS enumeration tool, free, open source (please feel free to google up on this because it's very useful) which is very useful for network enumeration. If anyone uses Kali Linux it should come pre-installed, if it doesn't finding and installing it should be a trival matter.
So the command I will run is :
$ proxychains perl fierce.pl -dns 123freemovies.com
Fierce does it's little things like bruteforcing the DNS and trying DNS zone transfer - which is a cool way to enumerate provided its working. As expected DNS zone transfer does not work.
The program however outputs a group of subnets worth probing futher:
Subnets found (may want to probe here using nmap or unicornscan):
173.239.2.0-255 : 1 hostnames found.
173.239.5.0-255 : 1 hostnames found.
174.137.132.0-255 : 1 hostnames found.
213.247.47.0-255 : 1 hostnames found.
54.225.100.0-255 : 1 hostnames found.
64.95.64.0-255 : 1 hostnames found.
So that's not a bad start.
Now we are going to ping individual subnets to figure out what IP address are live on the network and which of them belong to 123freemovies.com (through a reverse DNS lookup)
This is a lengthy process which tool me a whole day.
Just for tips this is how you would go about pinging host to find if any one of them are alive.
$ sudo proxychains nmap -T5 -sP 173.239.2.0–255
This scan returned 134 live host when most of them were not a part of 123freemovies.com
Iterating the process we get the following results:
The mapped attack surface
So this is the result we get:
184.95.38.195:123moviesfree.ae
104.31.87.5:123moviesfree.be
69.64.147.242:123moviesfree.biz
52.0.217.44:123moviesfree.bz
52.0.217.44:123moviesfree.cc
179.43.173.118:123moviesfree.ch
69.64.147.242:123moviesfree.co
104.27.141.252:123moviesfree.com
103.224.182.250:123moviesfree.cz
103.224.182.239:123moviesfree.de
104.18.37.66:123moviesfree.es
103.224.182.211:123moviesfree.eu
184.168.221.13:123moviesfree.in
104.28.2.151:123moviesfree.info
185.53.178.6:123moviesfree.io
185.53.178.8:123moviesfree.is
141.8.224.169:123moviesfree.it
173.208.215.108:123moviesfree.ml
72.52.4.121:123moviesfree.net
69.64.147.242:123moviesfree.org
45.79.222.138:123moviesfree.ph
164.138.223.139:123moviesfree.pro
128.199.141.59:123moviesfree.pw
185.53.179.8:123moviesfree.re
184.95.38.195:123moviesfree.se
91.144.20.76:123moviesfree.sy
195.20.41.218:123moviesfree.tk
178.175.129.10:123moviesfree.to
192.64.119.2:123moviesfree.today
69.64.147.242:123moviesfree.tv
198.54.126.90:123moviesfree.us
103.224.182.252:123moviesfree.vc
88.198.29.97:123moviesfree.vg
69.64.147.242:123moviesfree.ws
38 publicly reach-able servers for us to probe. Not bad for starters right.



