Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure modules honor spooler settings #18954

Conversation

adfoster-r7
Copy link
Contributor

Closes #18953

Verification

msfconsole
use auxiliary/scanner/ftp/ftp_version
run

Before

No error logs are output in the spooler file:

$ tail /tmp/example.txt
msf6 auxiliary(scanner/ftp/ftp_login) > run

[-] Msf::OptionValidateError One or more options failed to validate: RHOSTS.
msf6 auxiliary(scanner/ftp/ftp_login) >

After

Error logs are output to the spooler filter:

$ tail /tmp/example.txt
msf6 auxiliary(scanner/ftp/ftp_login) > run
msf6 auxiliary(scanner/ftp/ftp_login) >

@cgranleese-r7
Copy link
Contributor

Msf::OptionValidateError errors are now spooled to the file correctly 👍

Before

msfconsole output

msf6 exploit(windows/smb/psexec) >  use auxiliary/scanner/ftp/ftp_version
msf6 auxiliary(scanner/ftp/ftp_version) > spool /tmp/example.txt
[*] Spooling to file /tmp/example.txt...
msf6 auxiliary(scanner/ftp/ftp_version) > set rhosts test.txt
rhosts => test.txt
msf6 auxiliary(scanner/ftp/ftp_version) > run

[-] test.txt:21           - Msf::OptionValidateError The following options failed to validate:
[-] test.txt:21           - Invalid option RHOSTS: Host resolution failed: test.txt
msf6 auxiliary(scanner/ftp/ftp_version) >

Spool output

metasploit-framework on  upstream-master:master [$?] via  desktop-linux via  v3.0.5 via ⍱
❯ tail -f /tmp/example.txt
[*] Spooling to file /tmp/example.txt...
msf6 auxiliary(scanner/ftp/ftp_version) > set rhosts test.txt
rhosts => test.txt
msf6 auxiliary(scanner/ftp/ftp_version) > ls
[*] exec: ls

msf6 auxiliary(scanner/ftp/ftp_version) > run
msf6 auxiliary(scanner/ftp/ftp_version) >

After

msfconsole output

msf6 exploit(windows/smb/psexec) > use auxiliary/scanner/ftp/ftp_version
msf6 auxiliary(scanner/ftp/ftp_version) > spool /tmp/example.txt
[*] Spooling to file /tmp/example.txt...
msf6 auxiliary(scanner/ftp/ftp_version) > set rhosts test.txt
rhosts => test.txt
msf6 auxiliary(scanner/ftp/ftp_version) > run

[-] test.txt:21           - Msf::OptionValidateError The following options failed to validate:
[-] test.txt:21           - Invalid option RHOSTS: Host resolution failed: test.txt
msf6 auxiliary(scanner/ftp/ftp_version) >

Spool output

metasploit-framework (4292488) [$?] via  desktop-linux via  v3.0.5 via ⍱ took 11s
❯ tail -f /tmp/example.txt
[*] Spooling to file /tmp/example.txt...
msf6 auxiliary(scanner/ftp/ftp_version) > set rhosts test.txt
rhosts => test.txt
msf6 auxiliary(scanner/ftp/ftp_version) > run

[-] test.txt:21           - Msf::OptionValidateError The following options failed to validate:
[-] test.txt:21           - Invalid option RHOSTS: Host resolution failed: test.txt
msf6 auxiliary(scanner/ftp/ftp_version) >

@cgranleese-r7 cgranleese-r7 merged commit d2c599e into rapid7:master Mar 13, 2024
35 checks passed
@cgranleese-r7
Copy link
Contributor

cgranleese-r7 commented Mar 13, 2024

Release Notes

This PR fixes an issue where modules were not honouring spooler settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn-fix release notes fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MSF not writing run-time errors in a spool file.
2 participants