Skip to content

Latest commit

 

History

History
48 lines (32 loc) · 1.89 KB

0x08.Networking-Basics#1.md

File metadata and controls

48 lines (32 loc) · 1.89 KB

Learning Objectives

General

  • What is localhost/127.0.0.1
  • What is 0.0.0.0
  • What is /etc/hosts
  • How to display your machine’s active network interfaces

What is the hosts file

    vi /etc/hosts
  • Is the file that translate hostname to it's ip, it was used until the early 1980 before the dns was invented.
  • when u browse a specific web site, the OS first search for it's IP address in the hosts file, if it's there it will use this IP, if it's not it will get it from the DNS.
  • So you can block a website by adding a wrong IP (0.0.0.0 OR 127.0.0.1) to this website in the hosts file.
  • Each line contains and IP and it's hostname.
  • https://www.makeuseof.com/tag/modify-manage-hosts-file-linux/

localhost (127.0.0.1):

localhost is a hostname that typically resolves to the loopback IP address 127.0.0.1 in IPv4 addressing. It refers to the local computer or the computer on which the program is running. When you access localhost in a web browser or use it in network communication, you are referring to your own machine. It is commonly used for testing and development purposes when you want a server application to run on the same machine you are using.


0.0.0.0:

0.0.0.0 is a special-purpose IP address used to designate an unspecified or unknown target. In the context of network configuration, it typically means "any" or "all" addresses and is used to bind a socket to all available network interfaces on the host. When a server application binds to 0.0.0.0, it listens for incoming connections on all network interfaces, allowing it to accept connections from any IP address that the host is configured to listen on. It is commonly used when you want a server to be accessible from any network interface on the host, rather than just a specific interface or IP address.


COMMAND LINE

netcat: