Coder Social home page Coder Social logo

3snake's Introduction

3snake - dump sshd and sudo credential related strings

Disclaimer

I Wrote This In College

About

Targeting rooted servers, reads memory from sshd and sudo system calls that handle password based authentication. Doesn't write any memory to the traced processes. Spawns a new process for every sshd and sudo command that is run.

Listens for the proc event using netlink sockets to get candidate processes to trace. When it receives an sshd or sudo process ptrace is attached and traces read and write system calls, extracting strings related to password based authentication.

Don't really like the solution of backdooring openssh or installing a kernel module on target servers so I made this.

3snake

Build

make
./3snake -h
./3snake

Usage

Run in current terminal ./3snake

Daemonize and dump output to file ./3snake -d -o "/tmp/output_file.txt"

Configuration

Located in config.h

  • ROOT_DIR - root directory when daemonized (relative file paths for -o option will end up here)
  • ENABLE_SSH - OpenSSH server password auth
  • ENABLE_SUDO - sudo password auth
  • ENABLE_SU (experimental) - su password auth
  • ENABLE_SSH_CLIENT (experimental) - ssh client password auth
  • ENABLE_PASSWD - passwd password changes

Limitations

Linux, ptrace enabled, /proc filesystem mounted

Todo

Features X
OpenSSH server password auth X
sudo X
su X
regex strings from processes ~
ssh client X
  • Make the process of adding tracers more fluid
  • Yubikey: Ask for second yubikey from end users, OpenSSH
  • Output mode that only shows usernames/passwords

Licenses

MIT and Wrote This When In College

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.