Exploit-DB #15346
Description: Platinum SDK Library - POST UPnP 'sscanf' Buffer Overflow (PoC)
Type: dos
Platform: multiple
Date: 2010-10-28
Author: n00b

Exploit:
/*
                  -POC CODE Remote Buffer Overflow -
=========================================================================
! Exploit Title: Platinum SDK library post upnp sscanf buffer overflow !
=========================================================================
Date: 28th October 2010
-----------------------
Author: n00b  Realname: *carl cope* 
-----------------------------------
Software Link: http://www.plutinosoft.com/platinum
--------------------------------------------------
Version: All versions are affected Mulitple vendors 
---------------------------------------------------
Tested on: Windows xp sp3,Vista sp2,Linux unbuntu 
---------------------------------------------------
Fixed versions :Platinum 0.6.0
==========================================================================
-Mulitple vendors soap_action_name post upnp sscanf remote buffer overflow-
==========================================================================

-Description-

First of all while i was testing the upnp in the xbmc application i 
noticed after finding the vulnerable function in the source code it was 
because of the Platinum UPnP SDK which was used for upnp protocol.

There are more applications vulnerable to this exploit than i had first thought im 
not writing an exploit for them all as it would be pointless i've passed the information
to the developers of platinum sdk and when they have updated so will the rest of the 
vendors hope fully.

Any thing which uses this sdk is exploitable if you do decide to write an exploit for any
of the vulnerable applications please give credits to n00b for finding the bug.!!

The vendor has released a fix for this vulnerability 
http://kent.dl.sourceforge.net/project/platinum/platinum/0.6.1/CHANGELOG.txt

I would like to thank the vendor of the sdk for taking swift action and fixing this vulnerability
swiftly 10/10 for communications and working to get this issue resolved.


-Description-

Version 2010-07-27 Platinum-SRC-0-6-0_632 SDK
This is a list of the applications that are using the platinum SDK library.

-Afected applications-
Asset UPnP              = http://forum.dbpoweramp.com/showthread.php?t=18020 <-- Tested and is exploitable Release v.3.
XBMC                    = http://xbmc.org/                                   <-- Tested and is exploitable/Exploit released.
Google Simplify Media   = http://www.simplifymedia.com/blog/                 
qvivo                   = http://www.qvivo.com/us/download/                  
doubletwist             = http://www.doubletwist.com/                        
Boxee                   = http://www.boxee.tv/                               
BoxAmp                  = http://www.open7x0.org/wiki/BoxAmp                 
Ventis Media            = http://www.mediamonkey.com/                        
DVBSBridge              = http://www.dvblogic.com/                                
IntelligentShare        = http://www.adoubleu.de/
Easyon.tv               = http://www.easyon.tv/index.php
Foobar plugin foo_upnp  = http://www.hydrogenaudio.org/forums/index.php?showtopic=69664
plex                    = http://elan.plexapp.com/
CommVault               = http://www.commvault.com/
Iwedia                  = http://www.iwedia.com/
Mythtv                  = http://www.mythtv.org/wiki/UPnP
Vdr-plugin-upnp         = http://www.linuxtv.org/vdrwiki/index.php/Vdr-plugin-upnp


Any thing that use this sdk is exploitable till the update is available.
-Afected applications-


-Shouts-
Aluigi   = Take care m8 and all the best for the future !!.
Corelan  = Keep up the good work thanks for the advice !!.
Exploit-db = Looking good guys keep up the good work !!.
XBMC-DEV = Nice work with the project looking nice !!.
-Shouts-

----------
Disclaimer
----------
The information in this advisory and any of its
demonstrations is provided "as is" without any
warranty of any kind.
 
I am not liable for any direct or indirect damages
caused as a result of using the information or
demonstrations provided in any part of this advisory.
Educational use only..!!
*/

#include <stdio.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <netinet/in.h>

/*
'''          !!IMPORTATNT!!                       
The UUID must be set i've hardcoded this 
to make it easy to replace with the victim UUID
you can get the UUID number from the server
by issuing a get request to the vulnerable server
on port 00000 you can use a web browser to do this.
example = http://127.0.0.1:00000


-Note-
Just a side note the port is random and once the xbmc
application is installed the UUID will be set up along 
with the port number at installation so you will have to 
do a port scan to find what port the service is running
on but once its found it will be on that port till it 
is reinstalled.Also the UUID will stay the same.

Universally Unique Identifier
---------------------------------------------------
XML example
<UDN>
uuid:0970aa46-ee68-3174-d548-44b656447658
</UDN> 
---------------------------------------------------
-Note-

I was not going to write an xml paraser just for this
when a web browser and a set of eyes can do it.:)

Platinum UPnP SDK 
http://www.plutinosoft.com/platinum
http://sourceforge.net/users/c0diq
'''
*/
//compiled using gcc on linux.
//Cygwin on windows.

void error(char *mess)
{
    perror(mess);
    exit(1);
}

int main(int argc, char *argv[])
{
    int sock;
    int input;
    
	struct sockaddr_in http_client;
    char buf[2000];

    unsigned int http_len;
    

    /* If there is more than 2 arguments passed print usage!!*/
    if (argc != 3)
    {
        fprintf(stderr,"USAGE: Server_ip port\n");
        exit(1);
    }

    /* Create socket */
    if ((sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
    {
        er