You've loaded an old revision of the document! If you save it, you will create a new version with this data. Media Files{{tag>english linux kali it-security pentest}} ====== Host Discovery with Metasploit database ====== ===== Prepare database ===== Create PostgreSQL database and set up a user with access rights for it. ===== Metasploit: Connect database ===== <code ruby> msf6 > db_connect user:pass@127.0.0.1/db_name </code> ==== Check connection ==== <code ruby> msf6 > db_status [*] Connected to db_name. Connection type: postgresql. Connection name: local_db_service. </code> ===== Metasploit: Create workspace ===== <code ruby> msf6 > workspace * default msf6 > workspace -a new_ws [*] Added workspace: new_ws [*] Workspace: new_ws msf6 > workspace default * new_ws </code> ==== nmap Scan ==== <code ruby> msf6 > db_nmap -sP 192.168.2.0/24 [*] Nmap: Starting Nmap 7.93 ( https://nmap.org ) at 2022-12-29 21:57 Mitteleurop�ische Zeit [*] Nmap: Nmap scan report for 192.168.2.1 ... </code> ===== Check hosts ===== <code ruby> sf6 > hosts Hosts ===== address mac name os_name os_flavor os_sp purpose info comments ------- --- ---- ------- --------- ----- ------- ---- -------- 192.168.2.1 XX:XX:XX:XX:XX:XX 192.168.2.43 XX:XX:XX:XX:XX:XX 192-168-2-43.fritz.box </code> ===== Prepare and perform port scan ===== ==== Pass hosts as parameters ==== <code ruby> msf6 > use auxiliary/scanner/portscan/tcp msf6 auxiliary(scanner/portscan/tcp) > hosts -R </code> ==== Start port scan ==== <code ruby> msf6 auxiliary(scanner/portscan/tcp) > run [+] 192.168.2.1: - 192.168.2.1:21 - TCP OPEN [+] 192.168.2.1: - 192.168.2.1:53 - TCP OPEN [+] 192.168.2.1: - 192.168.2.1:80 - TCP OPEN [+] 192.168.2.1: - 192.168.2.1:443 - TCP OPEN </code>Please solve the following equation to prove you're human. 15 +14 = Please keep this field empty: SavePreviewCancel Edit summary Note: By editing this page you agree to license your content under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International