As we mentioned in the previous post, we spent some time this past weekend playing around with XBMC as it is gaining in popularity and because we use it often as well.
Quick note before we get going – we’re not trying to feed script kiddies. There are no videos, and the details are somewhat vague… on purpose.
We found a neat little hack to execute arbitrary code on (specifically tested) xbmcbuntu, raspbmc, and ubuntu with xbmc installed. This probably works in similarly crafty ways on the windows side and other platforms but we just can be bothered to verify. This attack isn’t crazy complex or sup3r1337z; rather a (we like to think) clever abuse of functionality.
The heart of this attack relies on the fact that xbmc.runscript allows you to run any python script on the victim box that is accessible to the user xbmc is running as.
Lets cover off getting a shell on xbmcbuntu and raspbmc. This ones less cool because it relies on SMB.
Pre-requisites:
- The event server is running.
- This is on by default on (we’re pretty sure) all XBMC deployments.
- event server is on udp port 9777
- SMB is enabled without a password
- By default xbmcbuntu and raspbmc both ship with SMB enabled with no password.
The attack is pretty straightforward:
- create a python script that downloads a file and executes it… maybe a backdoor?
- upload this python script to the victim using SMB
- invoke the event server on the victim’s xbmc from a remote machine calling Runscript with the file you dropped
- Boom.
- The event server is running.
- This is on by default on (we’re pretty sure) all XBMC deployments.
- event server is on udp port 9777
- invoke the event server on the victim’s xbmc from a remote machine calling Runscript with one of the python scripts that is already on the ubuntu box (by default) and can be abused to download a file. We’re not going to spell it out… it’s not that hard to find.
- this call to event server (in our tests) downloaded a python script to the victim
- invoke the event server on the victim’s xbmc from a remote machine calling Runscript with the python script you downloaded previously.
- Boom.
![attactics[dot]org](/wp-content/uploads/2018/02/attactics_logo.png)