import os, socket
os.system('cls')
print('FQDN Extractor: v 0.1')
print('-' * 79)
target = input('Enter Domain to Check: ')
print('FQDN: ', socket.getfqdn(target))
This code is a Python script that takes a user input domain and returns the fully qualified domain name (FQDN) of the target domain.
Let's go through the code line by line:
-
import os, socket
- This line imports theos
andsocket
modules for use in the script. -
os.system('cls')
- This line clears the console screen, so that the user input prompt and output are more visible. -
print('FQDN Extractor: v 0.1')
- This line prints a title for the script. -
print('-' * 79)
- This line prints a separator to visually separate the title from the rest of the output. -
target = input('Enter Domain to Check: ')
- This line prompts the user to enter a domain to check and assigns the input to the variabletarget
. -
print('FQDN: ', socket.getfqdn(target))
- This line gets the FQDN of the target domain using thesocket.getfqdn()
function and prints it to the console.
This code is fairly straightforward and serves its purpose.
No comments:
Post a Comment