MSFconsole is located in the /usr/share/metasploit-framework/msfconsole directory.
The -q option removes the launch banner by starting msfconsole in quiet mode.
root@kali:#msfconsole-qmsf>
Help Information
Pass -h to msfconsole to see the other usage options available.
root@kali:~#msfconsole-hUsage:msfconsole [options]Commonoptions -E, --environment ENVIRONMENT The Rails environment. Will use RAIL_ENV environment variable if that is set. Defaults to production if neither option not RAILS_ENV environment variable is set.
Databaseoptions-M,--migration-pathDIRECTORYSpecifyadirectorycontainingadditionalDBmigrations-n,--no-databaseDisabledatabasesupport-y,--yamlPATHSpecifyaYAMLfilecontainingdatabasesettingsFrameworkoptions-cFILELoadthespecifiedconfigurationfile-v,--versionShowversionModuleoptions--defer-module-loadsDefermoduleloadingunlessexplicitlyasked.-m,--module-pathDIRECTORYAnadditionalmodulepathConsoleoptions:-a,--askAskbeforeexitingMetasploitoraccept'exit -y'-d,--defangedExecutetheconsoleasdefanged-L,--real-readlineUsethesystemReadlinelibraryinsteadofRbReadline-o,--outputFILEOutputtothespecifiedfile-p,--pluginPLUGINLoadapluginonstartup-q,--quietDonotprintthebanneronstartup-r,--resourceFILEExecutethespecifiedresourcefile (- forstdin)-x,--execute-commandCOMMANDExecutethespecifiedstringasconsolecommands (use ; for multiples)-h,--helpShowthismessage
Entering help or a ? once in the msf command prompt will display a listing of available commands along with a description of what they are used for.
msf>helpCoreCommands=============CommandDescription------------------?HelpmenuadvancedDisplaysadvancedoptionsforoneormoremodulesbackMovebackfromthecurrentcontextbannerDisplayanawesomemetasploitbannercdChangethecurrentworkingdirectorycolorTogglecolorconnectCommunicatewithahosteditEditthecurrentmodulewith $VISUAL or $EDITORexitExittheconsolegetGetsthevalueofacontext-specificvariablegetgGetsthevalueofaglobalvariablegrepGreptheoutputofanothercommandhelpHelpmenuinfoDisplaysinformationaboutoneormoremodulesirbDropintoirbscriptingmodejobsDisplaysandmanagesjobskillKillajobloadLoadaframeworkpluginloadpathSearchesforandloadsmodulesfromapathmakercSavecommandsenteredsincestarttoafileoptionsDisplaysglobaloptionsorforoneormoremodulespopmPopsthelatestmoduleoffthestackandmakesitactivepreviousSetsthepreviouslyloadedmoduleasthecurrentmodulepushmPushestheactiveorlistofmodulesontothemodulestackquitExittheconsolereload_allReloadsallmodulesfromalldefinedmodulepathsrename_jobRenameajobresourceRunthecommandsstoredinafilerouteRoutetrafficthroughasessionsaveSavestheactivedatastoressearchSearchesmodulenamesanddescriptionssessionsDumpsessionlistingsanddisplayinformationaboutsessionssetSetsacontext-specificvariabletoavaluesetgSetsaglobalvariabletoavalueshowDisplaysmodulesofagiventype,orallmodulessleepDonothingforthespecifiednumberofsecondsspoolWriteconsoleoutputintoafileaswellthescreenthreadsViewandmanipulatebackgroundthreadsunloadUnloadaframeworkpluginunsetUnsetsoneormorecontext-specificvariablesunsetgUnsetsoneormoreglobalvariablesuseSelectsamodulebynameversionShowtheframeworkandconsolelibraryversionnumbersDatabaseBackendCommands=========================CommandDescription------------------credsListallcredentialsinthedatabasedb_connectConnecttoanexistingdatabasedb_disconnectDisconnectfromthecurrentdatabaseinstancedb_exportExportafilecontainingthecontentsofthedatabasedb_importImportascanresultfile (filetype willbeauto-detected)db_nmapExecutesnmapandrecordstheoutputautomaticallydb_rebuild_cacheRebuildsthedatabase-storedmodulecachedb_statusShowthecurrentdatabasestatushostsListallhostsinthedatabaselootListalllootinthedatabasenotesListallnotesinthedatabaseservicesListallservicesinthedatabasevulnsListallvulnerabilitiesinthedatabaseworkspaceSwitchbetweendatabaseworkspaces
Tab Completion
As with most other shells, entering what you know and pressing ‘Tab’ will present you with a list of options available to you or auto-complete the string if there is only one option.
Variables will only carry over if they are set globally.
msfauxiliary(ms09_001_write) >backmsf>
Banner
Display an awesome metasploit banner.
Check
To see if a target is vulnerable to a particular exploit instead of actually exploiting it.
msfexploit(ms08_067_netapi) >showoptionsModuleoptions (exploit/windows/smb/ms08_067_netapi):NameCurrentSettingRequiredDescription--------------------------------------RHOST172.16.194.134yesThetargetaddressRPORT445yesSettheSMBserviceportSMBPIPEBROWSERyesThepipenametouse (BROWSER, SRVSVC)Exploittarget:IdName------0AutomaticTargetingmsfexploit(ms08_067_netapi) >check[*] Verifying vulnerable status... (path:0x0000005a)[*] System is not vulnerable (status:0x00000000)[*] The target is not exploitable.msfexploit(ms08_067_netapi) >
Color
Enable or disable color output.
Connect
A miniature Netcat clone is built into the msfconsole to support SSL, proxies, pivoting, and file transfers.
Connect to a remote host, by issuing the connect command with an IP address and port number.
msf>connect192.168.1.123[*] Connected to 192.168.1.1:23DD-WRTv24std (c) 2008 NewMedia-NET GmbHRelease:07/27/08 (SVN revision:10011)DD-WRTlogin:
Edit
The edit command will edit the current module with $VISUAL or $EDITOR.
By default, this will open the current module in Vim.
Running the irb command will drop you into a live Ruby interpreter shell where you can issue commands and create Metasploit scripts on the fly. (IRB Scripting Mode)