Metasploit Course - Part 2.2 - Metasploit commands
🌐 This is an automatic translation of a topic from Underc0de, the largest Spanish-speaking hacking and IT community. Read the original (Spanish) and reply →
puntoCL ·
Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />This is the continuation of the second part on commands. <br /><br />Module Commands <br /><br />These are the commands we can use within modules<br /><br />advanced: Shows advanced options for one or more modules.<br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br />back: Go back.<br />edit: With this command you can edit the source code of the module you are using, with the Vim editor.<br />info: Shows you all the information about the module you are in.<br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br />loadpath: The loadpath command will load a third-party module tree. It's like loading a patch.<br />options: This command is better known as show options, meaning that whether you type show options or just options you'll get the same thing. This command shows you the options of the module you are using.<br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br />popm: Pops the latest module off the stack and makes it active.<br />previous: Sets the previously loaded module as the current module<br />reload_all: Reloads all modules from all paths.<br />search: Searches module names and descriptions. So if I want to search for android, the result will show me all the modules such as exploit, aux, etc... related to android. With details like the date they were released, the Rank, whether they are effective, and a short description.<br />Código: text
<br />msf > search android<br />Matching Modules<br />================<br /><br /> Name Disclosure Date Rank Description<br /> ---- --------------- ---- -----------<br /> auxiliary/admin/android/google_play_store_uxss_xframe_rce normal Android Browser RCE Through Google Play Store XFO<br /> auxiliary/dos/android/android_stock_browser_iframe 2012-12-01 normal Android Stock Browser Iframe DOS<br /> auxiliary/gather/android_browser_file_theft normal Android Browser File Theft<br /> auxiliary/gather/android_browser_new_tab_cookie_theft normal Android Browser "Open in New Tab" Cookie Theft<br /> auxiliary/gather/android_htmlfileprovider normal Android Content Provider File Disclosure<br /> auxiliary/gather/android_object_tag_webview_uxss 2014-10-04 normal Android Open Source Platform (AOSP) Browser UXSS<br /> auxiliary/gather/android_stock_browser_uxss normal Android Open Source Platform (AOSP) Browser UXSS<br /> auxiliary/gather/firefox_pdfjs_file_theft normal Firefox PDF.js Browser File Theft<br /> auxiliary/scanner/sip/sipdroid_ext_enum normal SIPDroid Extension Grabber<br /> auxiliary/server/android_browsable_msf_launch normal Android Meterpreter Browsable Launcher<br /> auxiliary/server/android_mercury_parseuri normal Android Mercury Browser Intent URI Scheme and Directory Traversal Vulnerability<br /> exploit/android/adb/adb_server_exec 2016-01-01 excellent Android ADB Debug Server Remote Payload Execution<br /> exploit/android/browser/samsung_knox_smdm_url 2014-11-12 excellent Samsung Galaxy KNOX Android Browser RCE<br /> exploit/android/browser/stagefright_mp4_tx3g_64bit 2015-08-13 normal Android Stagefright MP4 tx3g Integer Overflow<br /> exploit/android/browser/webview_addjavascriptinterface 2012-12-21 excellent Android Browser and WebView addJavascriptInterface Code Execution<br /> exploit/android/fileformat/adobe_reader_pdf_js_interface 2014-04-13 good Adobe Reader for Android addJavascriptInterface Exploit<br /> exploit/android/local/futex_requeue 2014-05-03 excellent Android 'Towelroot' Futex Requeue Kernel Exploit<br /> exploit/android/local/put_user_vroot 2013-09-06 excellent Android get_user/put_user Exploit<br /> exploit/multi/local/allwinner_backdoor 2016-04-30 excellent Allwinner 3.4 Legacy Kernel Local Privilege Escalation<br /> payload/android/meterpreter/reverse_http normal Android Meterpreter, Android Reverse HTTP Stager<br /> payload/android/meterpreter/reverse_https normal Android Meterpreter, Android Reverse HTTPS Stager<br /> payload/android/meterpreter/reverse_tcp normal Android Meterpreter, Android Reverse TCP Stager<br /> payload/android/meterpreter_reverse_http normal Android Meterpreter Shell, Reverse HTTP Inline<br /> payload/android/meterpreter_reverse_https normal Android Meterpreter Shell, Reverse HTTPS Inline<br /> payload/android/meterpreter_reverse_tcp normal Android Meterpreter Shell, Reverse TCP Inline<br /> payload/android/shell/reverse_http normal Command Shell, Android Reverse HTTP Stager<br /> payload/android/shell/reverse_https normal Command Shell, Android Reverse HTTPS Stager<br /> payload/android/shell/reverse_tcp normal Command Shell, Android Reverse TCP Stager<br /> post/android/capture/screen normal Android Screen Capture<br /> post/android/manage/remove_lock 2013-10-11 normal Android Settings Remove Device Locks (4.0-4.3)<br /> post/android/manage/remove_lock_root normal Android Root Remove Device Locks (root)<br />
<br />show: Shows modules of a given type, or all modules. There are several ways to use show, which I will show you now.<br /><br />If we type show in msfconsole, all the modules within metasploit will be shown.I am not going to show all of the results because the post has a word limit and won't let me include all the results.<br /><br />Código: text
<br />msf > show<br /><br />Encoders<br />========<br /><br /> Name Disclosure Date Rank Description<br /> ---- --------------- ---- -----------<br /> cmd/echo good Echo Command Encoder<br /> cmd/generic_sh manual Generic Shell Variable Substitution Command Encoder<br /> cmd/ifs low Generic ${IFS} Substitution Command Encoder<br /> cmd/perl normal Perl Command Encoder<br /> <br /> <br />NOP Generators<br />==============<br /><br /> Name Disclosure Date Rank Description<br /> ---- --------------- ---- -----------<br /> aarch64/simple normal Simple<br /> armle/simple normal Simple<br /> mipsbe/better normal Better<br /><br />Exploits<br />========<br /><br /> Name Disclosure Date Rank Description<br /> ---- --------------- ---- -----------<br /> windows/ssh/putty_msg_debug 2002-12-16 normal PuTTY Buffer Overflow<br /> windows/ssh/securecrt_ssh1 2002-07-23 average SecureCRT SSH1 Buffer Overflow<br /> windows/ssh/sysax_ssh_username 2012-02-27 normal Sysax 5.53 SSH Username Buffer Overflow<br /> windows/ssl/ms04_011_pct 2004-04-13 average MS04-011 Microsoft Private Communications Transport Overflow<br /> windows/telnet/gamsoft_telsrv_username 2000-07-17 average GAMSoft TelSrv 1.5 Username Buffer Overflow<br /> windows/telnet/goodtech_telnet 2005-03-15 average GoodTech Telnet Server Buffer Overflow<br /> windows/tftp/attftp_long_filename 2006-11-27 average Allied Telesyn TFTP Server 1.9 Long Filename Overflow<br /> windows/tftp/distinct_tftp_traversal 2012-04-08 excellent Distinct TFTP 3.10 Writable Directory Traversal Execution<br /> windows/tftp/dlink_long_filename 2007-03-12 good D-Link TFTP 1.0 Long Filename Buffer Overflow<br /> windows/tftp/futuresoft_transfermode 2005-05-31 average FutureSoft TFTP Server 2000 Transfer-Mode Overflow<br /> windows/tftp/netdecision_tftp_traversal 2009-05-16 excellent NetDecision 4.2 TFTP Writable Directory Traversal Execution<br /> windows/tftp/opentftp_error_code 2008-07-05 average OpenTFTP SP 1.4 Error Packet Overflow<br /> windows/tftp/quick_tftp_pro_mode 2008-03-27 good Quick FTP Pro 2.1 Transfer-Mode Overflow<br /> windows/tftp/tftpd32_long_filename 2002-11-19 average TFTPD32 Long Filename Buffer Overflow<br /><br />Payloads<br />========<br /><br /> Name Disclosure Date Rank Description<br /> ---- --------------- ---- -----------<br /> aix/ppc/shell_bind_tcp normal AIX Command Shell, Bind TCP Inline<br /> aix/ppc/shell_find_port normal AIX Command Shell, Find Port Inline<br /> aix/ppc/shell_interact normal AIX execve Shell for inetd<br /> aix/ppc/shell_reverse_tcp normal AIX Command Shell, Reverse TCP Inline<br /> android/meterpreter/reverse_http normal Android Meterpreter, Android Reverse HTTP Stager<br /> android/meterpreter/reverse_https normal Android Meterpreter, Android Reverse HTTPS Stager<br /> android/meterpreter/reverse_tcp normal Android Meterpreter, Android Reverse TCP Stager<br /> android/meterpreter_reverse_http normal Android Meterpreter Shell, Reverse HTTP Inline<br /> android/meterpreter_reverse_https normal Android Meterpreter Shell, Reverse HTTPS Inline<br /> android/meterpreter_reverse_tcp normal Android Meterpreter Shell, Reverse TCP Inline<br /> android/shell/reverse_http normal Command Shell, Android Reverse HTTP Stager<br /> android/shell/reverse_https normal Command Shell, Android Reverse HTTPS Stager<br /><br />Auxiliary<br />=========<br /><br /> Name Disclosure Date Rank Description<br /> ---- --------------- ---- -----------<br /> admin/mssql/mssql_sql normal Microsoft SQL Server Generic Query<br /> admin/mssql/mssql_sql_file normal Microsoft SQL Server Generic Query from File<br /> admin/mysql/mysql_enum normal MySQL Enumeration Module<br /> admin/mysql/mysql_sql normal MySQL SQL Generic Query<br /> admin/natpmp/natpmp_map normal NAT-PMP Port Mapper<br /> admin/netbios/netbios_spoof normal NetBIOS Response Brute Force Spoof (Direct)<br /> dos/http/rails_json_float_dos 2013-11-22 normal Ruby on Rails JSON Processor Floating Point Heap Overflow DoS<br /> dos/http/sonicwall_ssl_format 2009-05-29 normal SonicWALL SSL-VPN Format String Vulnerability<br /> dos/http/webrick_regex 2008-08-08 normal Ruby WEBrick::HTTP::DefaultFileHandler DoS<br /> dos/http/wordpress_directory_traversal_dos normal WordPress Traversal Directory DoS<br /> dos/http/wordpress_long_password_dos 2014-11-20 normal WordPress Long Password DoS<br /> dos/http/wordpress_xmlrpc_dos 2014-08-06 normal Wordpress XMLRPC DoS<br /> dos/mdns/avahi_portzero 2008-11-14 normal Avahi Source Port 0 DoS<br /> dos/misc/dopewars 2009-10-05 normal Dopewars Denial of Service<br /> scanner/http/trace_axd normal HTTP trace.axd Content Scanner<br /> scanner/http/typo3_bruteforce normal Typo3 Login Bruteforcer<br /> scanner/http/vcms_login normal V-CMS Login Utility<br /><br />
<br /><br />We can also view them separately by typing the following commands - show auxiliary - show exploits - show payloads - show encoders and show nops.<br /><br />Código: text
show payloads
<br /><br />(The full output of show payloads, show exploits, show encoders, show nops and show auxiliary is the same as in the original post; it is the standard Metasploit module listing, which is printed in English by msfconsole.)<br /><br />Código: text
<br />msf > show nops<br /><br />NOP Generators<br />==============<br /><br /> Name Disclosure Date Rank Description<br /> ---- --------------- ---- -----------<br /> aarch64/simple normal Simple<br /> armle/simple normal Simple<br /> mipsbe/better normal Better<br /> php/generic normal PHP Nop Generator<br /> ppc/simple normal Simple<br /> sparc/random normal SPARC NOP Generator<br /> tty/generic normal TTY Nop Generator<br /> x64/simple normal Simple<br /> x86/opty2 normal Opty2<br /> x86/single_byte normal Single Byte<br />
<br /><br />And the last one, show options, shows you the options to configure the exploit, aux, nops, payload etc... that we are using.<br /><br />Código: text
<br />msf auxiliary(wordpress_login_enum) > show options<br /><br />Module options (auxiliary/scanner/http/wordpress_login_enum):<br /><br /> Name Current Setting Required Description<br /> ---- --------------- -------- -----------<br /> BLANK_PASSWORDS false no Try blank passwords for all users<br /> BRUTEFORCE true yes Perform brute force authentication<br /> BRUTEFORCE_SPEED 5 yes How fast to bruteforce, from 0 to 5<br /> DB_ALL_CREDS false no Try each user/password couple stored in the current database<br /> DB_ALL_PASS false no Add all passwords in the current database to the list<br /> DB_ALL_USERS false no Add all users in the current database to the list<br /> ENUMERATE_USERNAMES true yes Enumerate usernames<br /> PASSWORD no A specific password to authenticate with<br /> PASS_FILE no File containing passwords, one per line<br /> Proxies no A proxy chain of format type:host:port[,type:host:port][...]<br /> RANGE_END 10 no Last user id to enumerate<br /> RANGE_START 1 no First user id to enumerate<br /> RHOSTS yes The target address range or CIDR identifier<br /> RPORT 80 yes The target port (TCP)<br /> SSL false no Negotiate SSL/TLS for outgoing connections<br /> STOP_ON_SUCCESS false yes Stop guessing when a credential works for a host<br /> TARGETURI / yes The base path to the wordpress application<br /> THREADS 1 yes The number of concurrent threads<br /> USERNAME no A specific username to authenticate as<br /> USERPASS_FILE no File containing users and passwords separated by space, one pair per line<br /> USER_AS_PASS false no Try the username as the password for all users<br /> USER_FILE no File containing usernames, one per line<br /> VALIDATE_USERS true yes Validate usernames<br /> VERBOSE true yes Whether to print output for all attempts<br /> VHOST no HTTP server virtual host<br /><br />
<br />use: Select a module. When we have decided to use a particular module.<br />Código: text
<br />msf > use auxiliary/scanner/http/wordpress_login_enum<br />msf auxiliary(wordpress_login_enum) ><br />
<br /><br /><br /><br />Job Commands <br /><br />handler: Starts a payload listener.<br />Código: text
<br />msf > handler<br />Usage: handler [options]<br /><br />Spin up a Payload Handler as background job.<br /><br />OPTIONS:<br /><br /> -H <opt> The RHOST/LHOST to configure the handler for<br /> -P <opt> The RPORT/LPORT to configure the handler for<br /> -e <opt> An Encoder to use for Payload Stage Encoding<br /> -h Help Banner<br /> -n <opt> The custom name to give the handler job<br /> -p <opt> The payload to configure the handler for<br /> -x Shut the Handler down after a session is established<br />msf ><br />
<br />jobs: Displays and manages jobs. Jobs are modules running in the background.<br />kill: Kills or terminates a job. kill kills any job that is running.<br />rename_job: Renames a job.<br /><br /><br /><br />Resource Script Commands<br />makerc: Saves the commands entered since startup to a file. That is, if you want to save a history of the work done, it generates a listing of all the information stored in the file you specify.<br />resource: Runs the commands stored in a file. It lets you load one of the files with the .rc extension.<br /><br /><br /><br />Database Backend Commands<br /><br />db_connect: Connect to an existing database.<br />db_disconnect: Disconnects from the current database.<br />db_export: Exports a file containing the database<br />db_import: Imports a scan result file. These files are detected automatically.<br />db_nmap: Used to run nmap and store all scan results in the prepared tables in the database.<br />db_rebuild_cache: Rebuilds the module cache stored in the database.<br />db_status: Shows the current database status.<br />hosts: Lists all hosts in the database.<br />loot: Lists all loot in the database.<br />notes: Lists all notes in the database.<br />services: Lists all services in the database.<br />vulns: Lists all vulnerabilities in the database<br />workspace: Switch between database workspaces<br /><br /><br /><br />Credentials Backend Commands<br /><br />creds: Lists all credentials in the database<br /><br /><br />Metasploit Course - Part 1 - Let's talk about metasploit<br />Metasploit Course - Part 2.1 - Metasploit commands<br />Metasploit Course - Part 2.2 - Metasploit commands<br />Metasploit Course - Part 3 - How to get a meterpreter with EternalBlue<br />Metasploit Course - Part 4 - Meterpreter command definitions<br />Metasploit Course - Part 4.1 - Demonstration of meterpreter commands<br />Metasploit Course - Part 4.2 - Demonstration of meterpreter commands<br />Metasploit Course - Part 5 – Let's talk about msfvenom<br />