Exercise 1: Create a Python script that prints all the forms and links of a web page sent by argument to the program.
Exercise 2: Create a tool to perform the following tasks:
- Given an IP address or a domain name, find information related to the owner of that domain and the corresponding DNS records.
- Run a scan with Nmap against the target and subsequently, obtain more information from the target using Shodan.
- In the case of finding ports that are frequently related to web servers (80, 8080, 443) perform an HTTP request using the OPTIONS method to determine if indeed, the target is a web server and extract the supported HTTP methods.
- BeautifulSoup library
- Python Whois library
- DNS library
- Request HTTP library
- Nmap library
- Shodan library
Both exercises have a help message to know the flags required for their execution with the -h
tag.
python3 <name_exercise> -h
For this exercise it is only necessary to enter the domain of a web page by command line, so run:
python3 exercise1.py -d <url_webpage>
For this exercise it is only necessary to enter the domain of a web page by command line, so run:
python3 exercise2.py -d <url_webpage>
Once the run is launched, the domain owner information will be obtained with Whois
and its corresponding DNS records. Afterwards, a port scan will be performed with the Nmap
tool where the supported HTTP methods will be displayed on the screen, in case it supports any, if any port belonging to a web server is found. Finally, more information about the domain owner will be obtained with the Shodan
tool.