Skip to content

Conversation

cdelafuente-r7
Copy link
Contributor

This adds the reference to MITRE ATT&CK technique T1021 "Remote Services" and its sub-techniques. (see https://attack.mitre.org/techniques/T1021/ for details).

This has been mainly done with the help of AI and local scripts. The process was as follows:

  1. Use both the source code and the documentation for each module in Metasploit.
  2. Filter according to keywords related to the MITRE technique.
  3. Process each module from the filtered list of modules using AI with a specific crafted prompt, the source code and the documentation.
  4. Final manual review.

@cdelafuente-r7 cdelafuente-r7 added the rn-enhancement release notes enhancement label Sep 22, 2025
Comment on lines +183 to +184
inject_request(cookie, token, 'rm -rf /a')
inject_request(cookie, token, 'rm -rf b')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rubocop was not happy with this...

@bwatters-r7
Copy link
Contributor

Based on reading the ATTA&K docs, we're looking for modules that use an account on a remote service to steal/manipulate/add. That said, this PR includes:
auxiliary/admin/smb

  • chec_dir_file
  • download_file
  • list_directory
  • ms17_010_command
  • samba_symlink_traversal
  • upload_file
  • webexec_command

I'm unclear as to why those are included, but

  • change_password
  • delete_file
  • psexec_ntdsgrab
  • webexec_command
    are not included. All of these are logging into the SMB service and doing something with those creds?

@bwatters-r7
Copy link
Contributor

I also see that metasploit-framework/modules/auxiliary/admin/teradata /teradata_odbc_sql.py is missing, though it is a sql login module for querying data.
I don't see any of the python modules listed as changed.

@cdelafuente-r7
Copy link
Contributor Author

Hi Brendan, thank you for looking into this. I agree there are some missing modules there. I need to update my scripts since I just realized some techniques were not properly included.

@bwatters-r7
Copy link
Contributor

It might be worth it to do a scan of all documentation that gives the value for username and then check if the module contains the HTTP::Client, SMB::Client, or other remote-based client library. Based on the MITRE docs, if we're logging in, were using this technique, I assume?

['URL', 'https://en.wikipedia.org/wiki/SMBRelay'],
['URL', 'http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx']
['URL', 'http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx'],
['ATT&CK', Mitre::Attack::Technique::T1021_002_SMB_WINDOWS_ADMIN_SHARES]
Copy link
Contributor

@adfoster-r7 adfoster-r7 Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Should we be manually adding the parent T1021_REMOTE_SERVICES here explicitly, or should we be wiring that up behind the scenes implicitly? 🤔

Suggested change
['ATT&CK', Mitre::Attack::Technique::T1021_002_SMB_WINDOWS_ADMIN_SHARES]
['ATT&CK', Mitre::Attack::Technique::T1021_REMOTE_SERVICES],
['ATT&CK', Mitre::Attack::Technique::T1021_002_SMB_WINDOWS_ADMIN_SHARES]

The reason being, whether or not we should be showing T1021_REMOTE_SERVICES in Pro's UI or in the info command by default

Copy link
Contributor

@adfoster-r7 adfoster-r7 Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to go with the implicit approach, then it'd make sense to ignore any related code changes to this PR and create a separate ticket 👍

Or happy to ignore entirely (Spencer's preference) 🥳

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In answer to this, see exploits/linux/misc/igel_command_injection
It works through either telnet or VNC. VNC has a special subclause, but telnet does not. The only way to express both is with the overarching technique and the sub-technique. It might be useful to keep them separate so that you can see both?

['CVE', '2018-5999'],
['CVE', '2018-6000']
['CVE', '2018-6000'],
['ATT&CK', Mitre::Attack::Technique::T1021_REMOTE_SERVICES]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This module does not use an account; it uses a special POST requesto to place the router in command mode, then sends a UDP packet instructing the router to start a telnet server serving bash.

['URL', 'https://www.postgresql.org/support/security/CVE-2025-1094/'], # PostgreSQL Advisory
['URL', 'https://attackerkb.com/topics/G5s8ZWAbYH/cve-2024-12356/rapid7-analysis'] # Rapid7 Analysis
['URL', 'https://attackerkb.com/topics/G5s8ZWAbYH/cve-2024-12356/rapid7-analysis'], # Rapid7 Analysis
['ATT&CK', Mitre::Attack::Technique::T1021_REMOTE_SERVICES]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see anywhere in this module where we are using an authenticated account?

['URL', 'https://en.wikipedia.org/wiki/SMBRelay'],
['URL', 'http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx']
['URL', 'http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx'],
['ATT&CK', Mitre::Attack::Technique::T1021_002_SMB_WINDOWS_ADMIN_SHARES]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In answer to this, see exploits/linux/misc/igel_command_injection
It works through either telnet or VNC. VNC has a special subclause, but telnet does not. The only way to express both is with the overarching technique and the sub-technique. It might be useful to keep them separate so that you can see both?

[ 'URL', 'https://kb.igel.com/securitysafety/en/isn-2021-01-igel-os-remote-command-execution-vulnerability-41449239.html' ],
[ 'URL', 'https://www.igel.com/wp-content/uploads/2021/02/lxos_11.04.270.txt' ]
[ 'URL', 'https://www.igel.com/wp-content/uploads/2021/02/lxos_11.04.270.txt' ],
[ 'ATT&CK', Mitre::Attack::Technique::T1021_005_VNC ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see anywhere we are authenticating in this module?

['URL', 'https://platformsecurity.com/blog/CVE-2025-32433-poc'],
['URL', 'https://github.com/ProDefense/CVE-2025-32433']
['URL', 'https://github.com/ProDefense/CVE-2025-32433'],
['ATT&CK', Mitre::Attack::Technique::T1021_004_SSH]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see where this is authenticating

}
},
'References' => [
[ 'ATT&CK', Mitre::Attack::Technique::T1021_REMOTE_SERVICES ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also retrieves passwords

}
},
'References' => [
[ 'ATT&CK', Mitre::Attack::Technique::T1021_001_REMOTE_DESKTOP_PROTOCOL ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just enables RDP, it does not authenticate.

['URL', 'https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_overview'],
['URL', 'https://github.com/PowerShell/openssh-portable']
['URL', 'https://github.com/PowerShell/openssh-portable'],
['ATT&CK', Mitre::Attack::Technique::T1021_004_SSH]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think installing ssh counts?

'References' => [
[ 'URL', 'https://www.youtube.com/watch?v=vdppEZjMPCM&hd=1' ]
[ 'URL', 'https://www.youtube.com/watch?v=vdppEZjMPCM&hd=1' ],
[ 'ATT&CK', Mitre::Attack::Technique::T1021_REMOTE_SERVICES ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be sort of a VNC relay attack, it might be better to use the VNC sub-category?

}
},
'References' => [
[ 'ATT&CK', Mitre::Attack::Technique::T1021_004_SSH ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just adds an ssh key; it does not log in.

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

Successfully merging this pull request may close these issues.

3 participants