

Enumerate: get/ extract as much as possible from the target

nmap $target #From the result, target might be up but block ping
nmap -Pn $target # No ping -scan all port


nmap -Pn -sV -O $target # service version and OS running on the target
nmap -Pn -sV -O $target -oX windows_server_2012 # output in xml format -> for metasploit

service postgresql start
msfconsole

# IN msf5
workspace # check workspace
workspace -a Win2k12 # add new workspace
db_import <file_path>
host # check that the data is imported successfully
services # same thing as above

#msfconsole allows us to do nmap inside
workspace -a Nmap_MSF # create new workspace
db_nmap -Pn -sV -O $target