HACKLOG 2×03 – Fondamentali sul World Wide Web

We find a meaning at the end of the Internet:
it is a set of systems connected between of them exchanging messages. Some can only accept certain types of
messages while others only from some senders; once this information comes
received by the recipient, the latter will take care of processing them. To prevent any software manufacturer either
hardware decide to do it on their own are RFCs (Requests for Comments) were devised,
documents that set the standards in IT field. Take HTTP as an example: this is a
protocol that establishes how a browser is Web and a Web Server communicate with each other
if both the Browser and the Web Server agree on how to use this
protocol (defined by the related RFCs) they they will be able to communicate. Ok, what happens when we surf the WWW? Open the Browser and type in the bar
URL address something like: www.hacklog.net The computer connects to a DNS: this
is a system that deals with translating the domain (www.hacklog.net) in the relative Address
IP: a sort of telephone directory so to speak. Your computer will now try to establish
a connection, called TCP, on the port 80 or 8080, usually used for traffic
HTTP (in the HTTPS version it will connect instead to port 443). If the connection is successful your browser
will send an HTTP request to the Web Server ::: The server, if you understand your request
and he will accept it, he will reply with a reply HTTP ::: Your browser will collect the answer and
will translate the code into something visible. The example we saw before refers to it
to the main page of a site: this it happens because, by resolving the main host
(in the previous case www.hacklog.net), a common web server responds with the main page
of the site, which is usually called index.html or index.php. The final extension, as we will see later, is
determined by what language it was written website. The task of the Web Server is to make sure
that, given a certain HTTP request, comes provided the correct HTTP response; the result
of this report is the output on screen that we usually see in the screen of a
Browser (precisely the web page). There are several Web Servers but, as far as they are concerned
it concerns us, we’ll use Apache, a Web Server opensource and very popular among administrators
of system. As you will remember in the previous episode we have
seen how to assign a domain (metasploitable) to an IP address: in the Internet world this
process is performed by DNS, an acronym of Domain Name System. A DNS works like a telephone directory,
an address is associated with each domain IP available on the internet. So when we type a site on the browser
web, for example hacklog.net, our computer makes a request to the DNS they will translate
the domain name in the corresponding address IP. This process is transparent to the user’s eyes
but we can replicate it inside the terminal. Let’s proceed with starting the program: nslookup then we assign two parameters:
>set type=A [enter]>hacklog.net In the first line we specified “set
type=A “. This means that we are requesting all
type A records; these usually contain the redirects of a domain to an address. They will be treated more calmly in the next ones
bets. In the second line we specify the domain / host
The third and fourth lines represent i IP addresses of the requested DNS server. You will notice how in the fourth line it is indicated
# 53: this represents the port number used for the request we made. By default, the DNS servers respond to the
UDP port 53. Now let’s go back to the browser and reconnect
to the site in the victim machine. As we have already said the first page that
it loads is usually called “index.html”, then we open the machine terminal
victim and type: $ nano /var/www/index.html Nano, as you will remember, is the text editor. The sequence of folders in which it is contained
the index.html page (then the container where you upload the website) is / var / www. This can change from web server to
configurations that the web master has entered, however we say that in good percentage it is
always this. Rewrite the / var / www / html path every time
it can be frustrating, so we can enter the directory and avoid rewriting
every time the path. We can know in some folder we find ourselves
typing: $ pwd If we were to enter wrongly in some
sub-directory we can go back with the command:
$ cd [space] .. Having said this, we create a new file
index.html inserting a simple text and we write something like: Hello World. Save with CTRL + X, S key and then ENTER. To know if we did everything correctly
we retrieve a list of the files present in the directory in which we find ourselves and type:
$ ls Now back in the attacker machine browser
and reload the page http: // metasploitable

Leave a Reply

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