/* (STonX [0.6.7]?[0.6.5]) local root buffer overflow exploit. - {x86}.
*
* Author: Cody Tubbs (loophole of hhp).
* www.hhp-programming.net / pigspigs@yahoo.com
* 12/27/2000
*
* STonX is the Atari ST Emulator for Unix/X.
* Current release is 0.6.5.
* Current pre-release is 0.6.7-epsilon.
*
* Tested on 0.6.7-epsilon via Slackware Linux 7.0.
* Same bug is within 0.6.5, it will work as well most likely.
*
* Will gain UID=0 when STonX is suid root.
*
* TEMPFIX PATCH INCLUDED (hhp-stonx_main.patch):
*********************************************************************
--- old/main.c Sun Dec 31 18:40:14 2000
+++ new/main.c Sun Dec 31 18:41:28 2000
@@ -290,9 +290,9 @@
{ char *home;
if ((home=getenv("HOME")) != NULL)
{ FILE *rc;
- char stonxrc[256];
- strcpy (stonxrc,home);
- strcat (stonxrc,"/"STONXRC);
+ char stonxrc[512+1];
+ strncpy(stonxrc,home,502);
+ strncat(stonxrc,"/"STONXRC,10);//STONXRC=".stonxrc"
if ((rc=fopen(stonxrc,"r")) != NULL)
{ int i,c=1;
char *args[64];
**********************************************************************
* end of tempfix patch. Install via: 'patch -p1 < hhp-stonx_main.patch'
*/
#include