Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/homjxi0e/cve-2017-1000367
Privilege EscalationVulnerability AnalysisExploitationPenetration TestingRed TeamingBinary Exploitation
GitHubhomjxi0e/cve-2017-1000367

CVE-2017-1000367

Proof-of-concept exploit for CVE-2017-1000367, a local privilege escalation vulnerability in Sudo's get_process_ttyname() on Linux, allowing overwrite of any file via tty device number manipulation.

View Repository
16239 years agoNot yet reviewed
Share

CVE-2017-1000367

We discovered a vulnerability in Sudo’s get_process_ttyname() for Linux: this function opens “/proc/[pid]/stat” (man proc) and reads the device number of the tty from field 7 (tty_nr). Unfortunately, these fields are space-separated and field 2 (comm, the filename of the command) can contain spaces (CVE-2017-1000367).

For example, if we execute Sudo through the symlink “./ 1 “, get_process_ttyname() calls sudo_ttyname_dev() to search for the non-existent tty device number “1” in the built-in search_devs[].

Next, sudo_ttyname_dev() calls the function sudo_ttyname_scan() to search for this non-existent tty device number “1” in a breadth-first traversal of “/dev”.

Last, we exploit this function during its traversal of the world-writable “/dev/shm”: through this vulnerability, a local user can pretend that his tty is any character device on the filesystem, and after two race conditions, he can pretend that his tty is any file on the filesystem.

On an SELinux-enabled system, if a user is Sudoer for a command that does not grant him full root privileges, he can overwrite any file on the filesystem (including root-owned files) with his command’s output, because relabel_tty() (in src/selinux.c) calls open(O_RDWR|O_NONBLOCK) on his tty and dup2()s it to the command’s stdin, stdout, and stderr. This allows any Sudoer user to obtain full root privileges.

Red Hat Enterprise Linux 6 (sudo) | ✅ |

Red Hat Enterprise Linux 7 (sudo) | ✅ |

Red Hat Enterprise Linux Server (v. 5 ELS) (sudo) | ✅ |

Oracle Enterprise Linux 6 | ✅ |

Oracle Enterprise Linux 7 | ✅ |

Oracle Enterprise Linux Server 5 | ✅ |

CentOS Linux 6 (sudo) | ✅ |

CentOS Linux 7 (sudo) | ✅ |

Debian wheezy | ✅ |

Debian jessie | ✅ |

Debian stretch | ✅ |

Debian sid | ✅ |

Ubuntu 17.04 | ✅ |

Ubuntu 16.10 | ✅ |

Ubuntu 16.04 LTS | ✅ |

Ubuntu 14.04 LTS | ✅ |

SUSE Linux Enterprise Software Development Kit 12-SP2 | ✅ |

SUSE Linux Enterprise Server for Raspberry Pi 12-SP2 | ✅ |

SUSE Linux Enterprise Server 12-SP2 | ✅ |

SUSE Linux Enterprise Desktop 12-SP2 | ✅ |

OpenSuse, Slackware, and Gentoo Linux | ✅ |

How do I patch sudo on CentOS/RHEL/Scientific/Oracle Linux server? ✅ |

Terminal:> sudo yum update

How do I patch sudo on Fedora Linux server?

Terminal:> sudo dnf update

How do I patch sudo on Suse/OpenSUSE Linux server? ✅ |

Terminal:> sudo zypper update

How do I patch sudo on Arch Linux server? ✅ |

Terminal:> sudo pacman -Syu

How do I patch sudo on Alpine Linux server? ✅ |

Terminal:> apk update && apk upgrade

How do I patch sudo on Slackware Linux server? ✅ |

upgradepkg sudo-1.8.20p1-i586-1_slack14.2.txz

How do I patch sudo on Gentoo Linux server? ✅ |

Terminal:> emerge --sync

Terminal:> emerge --ask --oneshot --verbose ">=app-admin/sudo-1.8.20_p1"

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    951
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    683
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    427
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer is an open-source Privileged Access Management (PAM) platform that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and RemoteApp endpoints through a web browser.

    392
  • 5

    SafeLine

    chaitin/safeline

    Self-hosted WAF and reverse proxy that filters malicious HTTP traffic, blocks SQL injection, XSS, and bot attacks, with rate limiting and dynamic HTML/JS encryption.

    344
  • 6

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    336

Explore all tools

Browse our collection of tools

View all tools →