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

Use database_name for SQL sessions #18855

Merged
merged 1 commit into from Feb 19, 2024

Conversation

sjanusz-r7
Copy link
Contributor

This PR removes the cwd convention from SQL-based sessions, and instead uses a more appropriate def database_name computed value rather than a cached variable.

Verification

Run Docker

docker run -it -p 5432:5432 -e POSTGRES_PASSWORD=password postgres:16.1
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=MyMSSQLServerPassword__<>" -p 1433:1433 mcr.microsoft.com/mssql/server:2022-preview-ubuntu-22.04
docker run -it --rm -e MYSQL_ROOT_PASSWORD='password' -p 3306:3306 mysql:8.3.0
docker run -it --rm -e MYSQL_ROOT_PASSWORD='password' -p 4306:3306 mariadb:11.2.2

Get all the shells:

use mysql_login
run rhost=127.0.0.1 rport=3306 username=root password=password
run rhost=127.0.0.1 rport=4306 username=root password=password

use postgres_login
run rhost=127.0.0.1 rport=5432 username=postgres password=password database=template1

use mssql_login
run rhost=127.0.0.1 rport=1433 username=sa password=MyMSSQLServerPassword__<> use_windows_authent=false
  • Confirm the above script works and gets you sessions
  • Confirm the sessions have the correct database names in the prompt

@cgranleese-r7 cgranleese-r7 self-assigned this Feb 19, 2024
@cgranleese-r7
Copy link
Contributor

Looks good to me 👍

Postgres

image

MSSQL

image

@cgranleese-r7 cgranleese-r7 added the rn-enhancement release notes enhancement label Feb 19, 2024
@cgranleese-r7 cgranleese-r7 merged commit db3b2de into rapid7:master Feb 19, 2024
36 checks passed
@cgranleese-r7
Copy link
Contributor

Release Notes

This PR removes the cwd convention from SQL-based sessions, and instead uses a more appropriate def database_name computed value rather than a cached variable.

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.

None yet

2 participants