You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Readme.md
+66-24
Original file line number
Diff line number
Diff line change
@@ -3,15 +3,21 @@
3
3
Stunner is a tool to test and exploit STUN, TURN and TURN over TCP servers.
4
4
TURN is a protocol mostly used in videoconferencing and audio chats (WebRTC).
5
5
6
-
If you find a misconfigured server you can use this tool to open a local socks proxy that relays all traffic via the TURN protocol into the internal network behind the server.
6
+
If you find a misconfigured server you can use this tool to open a local socks proxy that relays all traffic via the
7
+
TURN protocol into the internal network behind the server.
7
8
8
-
I developed this tool during a test of Cisco Expressway which resulted in some vulnerabilities: [https://firefart.at/post/multiple_vulnerabilities_cisco_expressway/](https://firefart.at/post/multiple_vulnerabilities_cisco_expressway/)
9
+
I developed this tool during a test of Cisco Expressway which resulted in some
To get the required username and password you need to fetch them using an out-of-band method like sniffing the Connect request from a web browser with Burp. I added an [example workflow](#example-workflow) at the bottom of the readme on how you would test such a server.
12
+
To get the required username and password you need to fetch them using an out-of-band method like sniffing the Connect
13
+
request from a web browser with Burp. I added an [example workflow](#example-workflow) at the bottom of the readme on
14
+
how you would test such a server.
11
15
12
16
# LICENSE
13
17
14
-
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
18
+
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view
19
+
a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons, PO
20
+
Box 1866, Mountain View, CA 94042, USA.
15
21
16
22
# implemented RFCs
17
23
@@ -27,7 +33,8 @@ TURN Extension for IPv6: [RFC 6156](https://datatracker.ietf.org/doc/html/rfc615
27
33
28
34
## info
29
35
30
-
This command will print some info about the stun or turn server like supported protocols and attributes like the used software.
36
+
This command will print some info about the stun or turn server like supported protocols and attributes like the used
37
+
software.
31
38
32
39
### Options
33
40
@@ -47,7 +54,9 @@ This command will print some info about the stun or turn server like supported p
47
54
48
55
## range-scan
49
56
50
-
This command tries several private and restricted ranges to see if the TURN server is configured to allow connections to the specified IP addresses. If a specific range is not prohibited you can enumerate this range further with the other provided commands. If an ip is reachable it means the TURN server will forward traffic to this IP.
57
+
This command tries several private and restricted ranges to see if the TURN server is configured to allow connections to
58
+
the specified IP addresses. If a specific range is not prohibited you can enumerate this range further with the other
59
+
provided commands. If an ip is reachable it means the TURN server will forward traffic to this IP.
51
60
52
61
### Options
53
62
@@ -78,7 +87,12 @@ UDP based TURN connection (connection from you the TURN server):
78
87
79
88
## socks
80
89
81
-
This is one of the most useful commands for TURN servers that support TCP connections to backend servers. It will launch a local socks5 server with no authentication and will relay all TCP traffic over the TURN protocol (UDP via SOCKS is currently not supported). If the server is misconfuigured it will forward the traffic to internal adresses so this can be used to reach internal systems and abuse the server as a proxy into the internal network. If you choose to also do DNS lookups over socks, it will be resolved using your local nameserver so it's best to work with private IPv4 and IPv6 addresses. Please be aware that this module can only relay TCP traffic.
90
+
This is one of the most useful commands for TURN servers that support TCP connections to backend servers. It will launch
91
+
a local socks5 server with no authentication and will relay all TCP traffic over the TURN protocol (UDP via SOCKS is
92
+
currently not supported). If the server is misconfuigured it will forward the traffic to internal adresses so this can
93
+
be used to reach internal systems and abuse the server as a proxy into the internal network. If you choose to also do
94
+
DNS lookups over socks, it will be resolved using your local nameserver so it's best to work with private IPv4 and IPv6
95
+
addresses. Please be aware that this module can only relay TCP traffic.
82
96
83
97
### Options
84
98
@@ -101,21 +115,29 @@ This is one of the most useful commands for TURN servers that support TCP connec
After starting the proxy open your browser, point the proxy in your settings to socks5 with an ip of 127.0.0.1:1080 (be sure to not set the bypass local address option as we want to reach the remote local addresses) and call the IP of your choice in the browser.
118
+
After starting the proxy open your browser, point the proxy in your settings to socks5 with an ip of 127.0.0.1:1080 (be
119
+
sure to not set the bypass local address option as we want to reach the remote local addresses) and call the IP of your
120
+
choice in the browser.
105
121
106
-
Example: https://127.0.0.1, https://127.0.0.1:8443 or https://[::1]:8443 (those will call the ports on the tested TURN server from the local interfaces).
122
+
Example: https://127.0.0.1, https://127.0.0.1:8443 or https://[::1]:8443 (those will call the ports on the tested TURN
123
+
server from the local interfaces).
107
124
108
-
You can also configure `proxychains` to use this proxy (but it will be very slow as each request results in multiple requests to enable the proxying). Just edit `/etc/proxychains.conf` and enter the value `socks5 127.0.0.1 1080` under `ProxyList`.
125
+
You can also configure `proxychains` to use this proxy (but it will be very slow as each request results in multiple
126
+
requests to enable the proxying). Just edit `/etc/proxychains.conf` and enter the value `socks5 127.0.0.1 1080` under
127
+
`ProxyList`.
109
128
110
-
Example of nmap over this socks5 proxy with a correct configured proxychains (note it's -sT to do TCP syns otherwise it will not use the socks5 proxy)
129
+
Example of nmap over this socks5 proxy with a correct configured proxychains (note it's -sT to do TCP syns otherwise it
This will most likely yield no useable information but can be useful to enumerate all available transports (=protocols to internal systems) supported by the server. This might show some custom protocol implementations but mostly will only return the defaults.
138
+
This will most likely yield no useable information but can be useful to enumerate all available transports (=protocols
139
+
to internal systems) supported by the server. This might show some custom protocol implementations but mostly will only
140
+
return the defaults.
119
141
120
142
### Options
121
143
@@ -138,7 +160,8 @@ This will most likely yield no useable information but can be useful to enumerat
138
160
139
161
## brute-password
140
162
141
-
This command tries all passwords from a given file for a username via the TURN protocol (UDP). This can be useful when analysing a pcap where you can see the username but not the password.
163
+
This command tries all passwords from a given file for a username via the TURN protocol (UDP). This can be useful when
164
+
analysing a pcap where you can see the username but not the password.
142
165
Please note that an offline bruteforce is much more faster in this case.
143
166
144
167
### Options
@@ -163,7 +186,10 @@ Please note that an offline bruteforce is much more faster in this case.
163
186
## memoryleak
164
187
165
188
This attack works the following way:
166
-
The server takes the data to send to `target` (must be a high port > 1024 in most cases) as a TLV (Type Length Value). This exploit uses a big length with a short value. If the server does not check the boundaries of the TLV, it might send you some memory up the `length` to the `target`. Cisco Expressway was confirmed vulnerable to this but according to cisco it only leaked memory of the current session.
189
+
The server takes the data to send to `target` (must be a high port > 1024 in most cases) as a TLV (Type Length Value).
190
+
This exploit uses a big length with a short value. If the server does not check the boundaries of the TLV, it might send
191
+
you some memory up the `length` to the `target`. Cisco Expressway was confirmed vulnerable to this but according to
192
+
cisco it only leaked memory of the current session.
167
193
168
194
### Options
169
195
@@ -182,8 +208,9 @@ The server takes the data to send to `target` (must be a high port > 1024 in mos
182
208
183
209
### Example
184
210
185
-
To receive the data we need to set up a receiver on a server with a public ip. Normally firewalls are configured to only allow highports (>1024) from TURN servers so be sure to use a high port like 8080 in this example when connecting out to the internet.
186
-
211
+
To receive the data we need to set up a receiver on a server with a public ip. Normally firewalls are configured to only
212
+
allow highports (>1024) from TURN servers so be sure to use a high port like 8080 in this example when connecting out to
213
+
the internet.
187
214
188
215
```bash
189
216
sudo nc -u -l -n -v -p 8080 | hexdump -C
@@ -199,7 +226,10 @@ If it works you should see big loads of memory coming in, otherwise you will onl
199
226
200
227
## udp-scanner
201
228
202
-
If a TURN server allows UDP connections to targets this scanner can be used to scan all private ip ranges and send them SNMP and DNS requests. As this checks a lot of IPs this can take multiple days to complete so use with caution or specify smaller targets via the parameters. You need to supply a SNMP community string that will be tried and a domain name that will be resolved on each IP. For the domain name you can for example use burp collaborator.
229
+
If a TURN server allows UDP connections to targets this scanner can be used to scan all private ip ranges and send them
230
+
SNMP and DNS requests. As this checks a lot of IPs this can take multiple days to complete so use with caution or
231
+
specify smaller targets via the parameters. You need to supply a SNMP community string that will be tried and a domain
232
+
name that will be resolved on each IP. For the domain name you can for example use burp collaborator.
203
233
204
234
### Options
205
235
@@ -252,10 +282,22 @@ Same as `udp-scanner` but sends out HTTP requests to the specified ports (HTTPS
252
282
253
283
Let's say you find a service using WebRTC and want to test it.
254
284
255
-
First step is to get the required data. I suggest to launch Wireshark in the background and just join a meeting via Burp to collect all HTTP and Websocket traffic. Next search your burp history for some keywords related to TURN like `3478`, `password`, `credential` and `username` (be sure to also check the websocket tab for these keywords). This might reveal the turn server and the protocol (UDP and TCP endpoints might have different ports) and the credentials used to connect. If you can't find the data in burp start looking at wireshark to identify the traffic. If it's on a non standard port (anything else then 3478) decode the protocol in Wireshark via a right click as `STUN`. This should show you the username used to connect and you can use this information to search burps history even further for the required data. Please note that Wireshark can't show you the password as the password is used to hash some package contents so it can not be reversed.
256
-
257
-
Next step would be to issue the `info` command to the turn server using the correct port and protocol obtained from burp.
258
-
259
-
If this works, the next step is a `range-scan`. If this allows any traffic to internal systems you can exploit this further but be aware that UDP has only limited use cases.
260
-
261
-
If TCP connections to internal systems are allowed simply launch the `socks` command and access the allowed IPs via a browser and set the socks proxy to 127.0.0.1:1080. You can try out 127.0.0.1:443 and other ips to find management interfaces.
285
+
First step is to get the required data. I suggest to launch Wireshark in the background and just join a meeting via Burp
286
+
to collect all HTTP and Websocket traffic. Next search your burp history for some keywords related to TURN like `3478`,
287
+
`password`, `credential` and `username` (be sure to also check the websocket tab for these keywords). This might reveal
288
+
the turn server and the protocol (UDP and TCP endpoints might have different ports) and the credentials used to connect.
289
+
If you can't find the data in burp start looking at wireshark to identify the traffic. If it's on a non standard port (
290
+
anything else then 3478) decode the protocol in Wireshark via a right click as `STUN`. This should show you the username
291
+
used to connect and you can use this information to search burps history even further for the required data. Please note
292
+
that Wireshark can't show you the password as the password is used to hash some package contents so it can not be
293
+
reversed.
294
+
295
+
Next step would be to issue the `info` command to the turn server using the correct port and protocol obtained from
296
+
burp.
297
+
298
+
If this works, the next step is a `range-scan`. If this allows any traffic to internal systems you can exploit this
299
+
further but be aware that UDP has only limited use cases.
300
+
301
+
If TCP connections to internal systems are allowed simply launch the `socks` command and access the allowed IPs via a
302
+
browser and set the socks proxy to 127.0.0.1:1080. You can try out 127.0.0.1:443 and other ips to find management
0 commit comments