Open h00die opened 1 year ago
Standardized (or looking for a bunch of possibilities) option names. Does a module have
user
username
smbUser
,USER_FILE
? I'm sure there are others as well.
Quiet a few, based on a cursory glance at the libs. Although a a guess, Http[Password|Username]
and SMB[User|Pass]
would be quick wins for a lot of modules.
# grep -rn Opt lib/msf | fgrep -v Bool | grep -i passw | cut -d"'" -f2 | sort -u | grep -i pass
AESPassword
BasicAuthPass
DBPASS
FTPPASS
GitPassword
HttpPassword
HttpProxyPass
IAX_PASS
IMAPPASS
lib/msf/core/payload/windows/reverse_http.rb:338: push 44 ; DWORD dwOption (INTERNET_OPTION_PROXY_PASSWORD)
NCSPASS
PASS_FILE
PASSWORD
POP2PASS
RC4PASSWORD
SMBPass
SMTPPASSWORD
USERPASS_FILE
# grep -rn Opt lib/msf | fgrep -v Bool | grep -i user | cut -d"'" -f2 | sort -u | grep -i user
BasicAuthUser
DBUSER
FROMUSER
FROMUSER_FILE
FTPUSER
GitUsername
HttpProxyUser
HttpUserAgent
HttpUsername
IAX_USER
IMAPUSER
lib/msf/core/payload/windows/reverse_http.rb:322: push 43 ; DWORD dwOption (INTERNET_OPTION_PROXY_USERNAME)
MaxGuessesPerUser
NCSUSER
POP2USER
RDP_USER
SMBUser
SMTPUSERNAME
UserAgent
USER_FILE
USERNAME
USERPASS_FILE
Since this issue is open and no one is working I would like to contribute to it
Since this has a lot of moving components (lib, spec, modules), I would recommend making several PRs to address this.
Obviously up to you on implementation, but I would recommend the first PR being the adding of numbers to the creds command output, and the saving of the results for later reference. Reference how search
does it (and any spec it also uses).
Please review the solution and suggest changes or improvements if any. Working on adding multiple entries.
Is it okay if spec tests are changed because adding index to creds
changed the total number of columns of table causing a test to fail. So I changed it to match the new additions for creds
.
you can update the specs
Summary
Right now,
creds
is a stand-alone, 1 way feature (at least in framework). I mean this in that some modules push creds into the database, but the only thing you can do with them once there is to export hashes to crackers. I suspect a typical use case is:I'd like to talk about adding a feature to
creds
command to auto-fill a credential to a module.Example Usage
use auxiliary/server/capture/smtp
creds
now shows something like:host origin service public private realm private_type JtR Format
1.1.1.1 2.2.2.2 25/tcp (smtp) rickjames slap Password
1.1.1.1 2.2.2.2 25/tcp (smtp) jurasic park Password
msf6 exploit(windows/smb/psexec) > show options
Module options (exploit/windows/smb/psexec):
Name Current Setting Required Description
RHOSTS yes The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Metasploit RPORT 445 yes The SMB service port (TCP) SERVICE_DESCRIPTION no Service description to to be used on target for pretty listing SERVICE_DISPLAY_NAME no The service display name SERVICE_NAME no The service name SMBDomain . no The Windows domain to use for authentication SMBPass slap no The password for the specified username SMBSHARE no The share to connect to, can be an admin share (ADMIN$,C$,...) or a normal read/write folder share SMBUser rickjames no The username to authenticate as
msf6 > creds Credentials
host origin service public private realm private_type JtR Format
1.1.1.1 2.2.2.2 25/tcp (smtp) rickjames slap Password
1.1.1.1 2.2.2.2 25/tcp (smtp) jurasic park Password