Skip to content

Commit decba43

Browse files
committed
Additional changes to documentation
1 parent 2c307f1 commit decba43

File tree

10 files changed

+79
-48
lines changed

10 files changed

+79
-48
lines changed

docs/metasploit-framework.wiki/Metasploit-Guide-MSSQL.md

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ MSSQL is frequently found on port on the following ports:
88
- 1433/TCP
99
- 1434/UDP
1010

11+
For a full list of MSSQL modules run the `search` command within msfconsole:
12+
13+
```msf
14+
msf6 > search mssql
15+
```
16+
17+
Or to search for modules that work with a specific session type:
18+
19+
```msf
20+
msf6 > search session_type:mssql
21+
```
22+
1123
### Lab Environment
1224

1325
Environment setup:
@@ -46,18 +58,17 @@ on a successful login:
4658
[*] Auxiliary module execution completed
4759
```
4860

49-
Which you can interact with using `sessions -i <session id>` or `sessions -1` to interact with the most recently opened session.
61+
Which you can interact with using `sessions -i <session id>` or `sessions -i -1` to interact with the most recently opened session.
5062

5163
```msf
5264
msf6 auxiliary(scanner/mssql/mssql_login) > sessions
5365
5466
Active sessions
5567
===============
5668
57-
Id Name Type Information Connection
58-
-- ---- ---- ----------- ----------
59-
1 mssql MSSQL test @ 192.168.2.242:143 192.168.2.1:60963 -> 192.168.2
60-
3 .242:1433 (192.168.2.242)
69+
Id Name Type Information Connection
70+
-- ---- ---- ----------- ----------
71+
1 mssql MSSQL test @ 192.168.2.242:1433 192.168.2.1:60963 -> 192.168.23.242:1433 (192.168.2.242)
6172
6273
msf6 auxiliary(scanner/mssql/mssql_login) > sessions -i 1
6374
[*] Starting interaction with 1...
@@ -101,8 +112,7 @@ MSSQL Client Commands
101112
Command Description
102113
------- -----------
103114
query Run a single SQL query
104-
query_interactive Enter an interactive prompt for running multiple SQL queri
105-
es
115+
query_interactive Enter an interactive prompt for running multiple SQL queries
106116
107117
108118
Local File System Commands
@@ -181,17 +191,20 @@ mssql @ 192.168.2.242:1433 (master) > query_interactive
181191
[*] Starting interactive SQL shell for mssql @ 192.168.2.242:1433 (master)
182192
[*] SQL commands ending with ; will be executed on the remote server. Use the exit command to exit.
183193
184-
SQL >> select top 2 table_catalog, table_schema
185-
SQL *> from information_schema.tables;
186-
[*] Executing query: select top 2 table_catalog, table_schema from information_schema.tables;
194+
SQL >> select *
195+
SQL *> from information_schema.tables
196+
SQL *> where table_type = 'BASE TABLE';
197+
[*] Executing query: select * from information_schema.tables where table_type = 'BASE TABLE';
187198
Response
188199
========
189-
190-
# table_catalog table_schema
191-
- ------------- ------------
192-
0 master dbo
193-
1 master dbo
194-
200+
# TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE
201+
- ------------- ------------ ---------- ----------
202+
0 master dbo spt_fallback_db BASE TABLE
203+
1 master dbo spt_fallback_dev BASE TABLE
204+
2 master dbo spt_fallback_usg BASE TABLE
205+
4 master dbo Users BASE TABLE
206+
5 master dbo spt_monitor BASE TABLE
207+
6 master dbo MSreplication_options BASE TABLE
195208
SQL >>
196209
```
197210

docs/metasploit-framework.wiki/Metasploit-Guide-MySQL.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ There are more modules than listed here, for the full list of modules run the `s
1717
msf6 > search mysql
1818
```
1919

20+
Or to search for modules that work with a specific session type:
21+
22+
```msf
23+
msf6 > search session_type:mysql
24+
```
25+
2026
### Lab Environment
2127

2228
When testing in a lab environment MySQL can either be installed on the host machine or within Docker:
@@ -81,12 +87,13 @@ run cidr:/24:mysql://[email protected] threads=50 pass_file=./wordlist.txt
8187

8288
### Obtaining an Interactive Session on the Target
8389

84-
The CreateSession option in `scanner/mysql/msql_login` allows you to obtain an interactive session
90+
The CreateSession option in `auxiliary/scanner/mysql/msql_login` allows you to obtain an interactive session
8591
for the MySQL client you're connecting to. The run command with CreateSession
8692
set to true should give you an interactive session:
8793

8894
```msf
89-
run rhost=127.0.0.1 rport=4306 username=root password=password createsession=true
95+
msf6 > use scanner/mysql/mysql_login
96+
msf6 auxiliary(scanner/mysql/mysql_login) > run rhost=127.0.0.1 rport=4306 username=root password=password createsession=true
9097
9198
[+] 127.0.0.1:4306 - 127.0.0.1:4306 - Found remote MySQL version 11.2.2
9299
[+] 127.0.0.1:4306 - 127.0.0.1:4306 - Success: 'root:password'
@@ -173,7 +180,7 @@ This session also works with the following modules:
173180
exploit/windows/mysql/mysql_start_up
174181
```
175182

176-
Once you've done that, you can run any MySQL query against the target using the `query` command.
183+
Once you've done that, you can run any MySQL query against the target using the `query` command:
177184

178185
```msf
179186
mysql @ 127.0.0.1:4306 > query -h

docs/metasploit-framework.wiki/Metasploit-Guide-PostgreSQL.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ There are more modules than listed here, for the full list of modules run the `s
1717
msf6 > search postgres
1818
```
1919

20+
Or to search for modules that work with a specific session type:
21+
22+
```msf
23+
msf6 > search session_type:postgres
24+
```
25+
26+
2027
### Lab Environment
2128

2229
When testing in a lab environment PostgreSQL can either be installed on the host machine or within Docker:
@@ -172,7 +179,7 @@ This session also works with the following modules:
172179
exploit/windows/postgres/postgres_payload
173180
```
174181

175-
Once you've done that, you can run any Postgres query against the target using the `query` command.
182+
Once you've done that, you can run any Postgres query against the target using the `query` command:
176183

177184
```msf
178185
postgresql @ 127.0.0.1:5432 (template1) > query -h

docs/metasploit-framework.wiki/Metasploit-Guide-SMB.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ There are more modules than listed here, for the full list of modules run the `s
2727
msf6 > search smb
2828
```
2929

30+
Or to search for modules that work with a specific session type:
31+
32+
```msf
33+
msf6 > search session_type:smb
34+
```
35+
3036
### Lab Environment
3137

3238
When testing in a lab environment - SMB can be used on a Window's host machine, or within Docker.
@@ -80,14 +86,14 @@ Should give you output similar to
8086
[*] SMB session 1 opened (172.16.158.1:62793 -> 172.14.2.164:445) at 2024-03-12 17:03:09 +0000
8187
[*] 172.14.2.164:445 - Scanned 1 of 1 hosts (100% complete)
8288
[*] Auxiliary module execution completed
83-
msf6 auxiliary(scanner/smb/smb_login) > sessions -1
89+
msf6 auxiliary(scanner/smb/smb_login) > sessions -i -1
8490
[*] Starting interaction with 1...
8591
```
8692

87-
Which you can interact with using `sessions -i <session id>` or `sessions -1` to interact with the most recently opened session.
93+
Which you can interact with using `sessions -i <session id>` or `sessions -i -1` to interact with the most recently opened session.
8894

8995
```msf
90-
msf6 auxiliary(scanner/smb/smb_login) > sessions -1
96+
msf6 auxiliary(scanner/smb/smb_login) > sessions -i -1
9197
[*] Starting interaction with 1...
9298
9399
SMB (172.14.2.164) > shares

documentation/modules/auxiliary/scanner/mssql/mssql_login.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ session within the MSSQL instance. Running the following commands with all other
2424
msf6 auxiliary(scanner/mssql/mssql_login) > run CreateSession=true RPORT=1433 RHOSTS=192.168.2.242 USERNAME=user PASSWORD=password
2525
```
2626

27-
Should give you output containing
27+
Should give you output containing:
2828

2929
```msf
3030
[*] 192.168.2.242:1433 - 192.168.2.242:1433 - MSSQL - Starting authentication scanner.
@@ -35,18 +35,17 @@ Should give you output containing
3535
[*] Auxiliary module execution completed
3636
```
3737

38-
Which you can interact with using `sessions -i <session id>` or `sessions -1` to interact with the most recently opened session.
38+
Which you can interact with using `sessions -i <session id>` or `sessions -i -1` to interact with the most recently opened session.
3939

4040
```msf
4141
msf6 auxiliary(scanner/mssql/mssql_login) > sessions
4242
4343
Active sessions
4444
===============
4545
46-
Id Name Type Information Connection
47-
-- ---- ---- ----------- ----------
48-
1 mssql MSSQL test @ 192.168.2.242:143 192.168.2.1:60963 -> 192.168.2
49-
3 .242:1433 (192.168.2.242)
46+
Id Name Type Information Connection
47+
-- ---- ---- ----------- ----------
48+
1 mssql MSSQL test @ 192.168.2.242:1433 192.168.2.1:60963 -> 192.168.2.242:1433 (192.168.2.242)
5049
5150
msf6 auxiliary(scanner/mssql/mssql_login) > sessions -i 1
5251
[*] Starting interaction with 1...

documentation/modules/auxiliary/scanner/mysql/mysql_login.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ This session also works with the following modules:
156156
exploit/windows/mysql/mysql_start_up
157157
```
158158

159-
Once you've done that, you can run any MySQL query against the target using the `query` command.
159+
Once you've done that, you can run any MySQL query against the target using the `query` command:
160160

161161
```msf
162162
mysql @ 127.0.0.1:4306 > query -h
@@ -212,5 +212,3 @@ Response
212212
213213
SQL >>
214214
```
215-
216-

documentation/modules/auxiliary/scanner/postgres/postgres_login.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ This auxiliary module is a brute-force login tool for Postgres servers.
44

55
## Verification Steps
66

7-
1. Do: ```use auxiliary/scanner/postgres/postgres_login```
8-
2. Do: ```set PASS_FILE [file containing passwords]```
9-
3. Do: ```set RHOSTS [IP]```
10-
4. Do: ```set USER_FILE [file containing usernames]```
11-
5. Do: ```set DATABASE [template name]```
12-
6. Do: ```run```
7+
1. Do: `use auxiliary/scanner/postgres/postgres_login`
8+
2. Do: `set PASS_FILE [file containing passwords]`
9+
3. Do: `set RHOSTS [IP]`
10+
4. Do: `set USER_FILE [file containing usernames]`
11+
5. Do: `set DATABASE [template name]`
12+
6. Do: `run`
1313

1414
The above USER_FILE and PASS_FILE options can be replaced with USERNAME
1515
and PASSWORD if you know the credentials.
@@ -107,7 +107,7 @@ This session also works with the following modules:
107107
exploit/windows/postgres/postgres_payload
108108
```
109109

110-
Once you've done that, you can run any Postgres query against the target using the `query` command.
110+
Once you've done that, you can run any Postgres query against the target using the `query` command:
111111

112112
```msf
113113
postgresql @ 127.0.0.1:5432 (template1) > query -h

documentation/modules/auxiliary/scanner/smb/smb_login.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,22 @@ session within the smb instance. Running with the following options:
4747
msf6 auxiliary(scanner/smb/smb_login) > run CreateSession=true RHOSTS=172.14.2.164 RPORT=445 SMBDomain=windomain.local SMBPass=password SMBUser=username
4848
```
4949

50-
Should give you output containing
50+
Should give you output containing:
5151

5252
```msf
5353
[*] 172.14.2.164:445 - 172.14.2.164:445 - Starting SMB login bruteforce
5454
[+] 172.14.2.164:445 - 172.14.2.164:445 - Success: 'windomain.local\username:password' Administrator
5555
[*] SMB session 1 opened (172.16.158.1:62793 -> 172.14.2.164:445) at 2024-03-12 17:03:09 +0000
5656
[*] 172.14.2.164:445 - Scanned 1 of 1 hosts (100% complete)
5757
[*] Auxiliary module execution completed
58-
msf6 auxiliary(scanner/smb/smb_login) > sessions -1
58+
msf6 auxiliary(scanner/smb/smb_login) > sessions -i -1
5959
[*] Starting interaction with 1...
6060
```
6161

62-
Which you can interact with using `sessions -i <session id>` or `sessions -1` to interact with the most recently opened session.
62+
Which you can interact with using `sessions -i <session id>` or `sessions -i -1` to interact with the most recently opened session.
6363

6464
```msf
65-
msf6 auxiliary(scanner/smb/smb_login) > sessions -1
65+
msf6 auxiliary(scanner/smb/smb_login) > sessions -i -1
6666
[*] Starting interaction with 1...
6767
6868
SMB (172.14.2.164) > shares

documentation/modules/exploit/windows/smb/smb_relay.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,13 @@ I.E. the filename john will produce two files, `john_netntlm` and `john_netntlmv
9090

9191
### DOMAIN
9292

93-
The domain name used during smb exchange.
93+
The domain name used during SMB exchange.
9494

9595
### ACTION
96+
9697
Determines which of two actions smb_relay will use against the target.
97-
The default is to run PSEXEC, but can be changed to CREATE_SMB_SESSION to
98-
open an interactive smb session against the target instead of running
98+
The default is to run `PSEXEC`, but can be changed to `CREATE_SMB_SESSION` to
99+
open an interactive SMB session against the target instead of running
99100
psexec.
100101

101102
### TIMEOUT

modules/exploits/windows/smb/smb_relay.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ module is not able to clean up after itself. The service and payload
149149

150150
def available_actions
151151
actions = [
152-
['PSEXEC', { 'Description' => 'Run psexec against the relay target' }]
152+
['PSEXEC', { 'Description' => 'Use the SMB Connection to run the exploit/windows/psexec module against the relay target' }]
153153
]
154154
if framework.features.enabled?(Msf::FeatureManager::SMB_SESSION_TYPE)
155-
actions << ['CREATE_SMB_SESSION', { 'Description' => 'Get an SMB session' }]
155+
actions << ['CREATE_SMB_SESSION', { 'Description' => 'Do not close the SMB connection after relaying, and instead create an SMB session' }]
156156
end
157157

158158
actions

0 commit comments

Comments
 (0)