All Projects → etke → checksec.rs

etke / checksec.rs

Licence: Apache-2.0 license
Fast multi-platform (ELF/PE/MachO) binary checksec written in Rust.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to checksec.rs

HatVenom
HatVenom is a HatSploit native powerful payload generation tool that provides support for all common platforms and architectures.
Stars: ✭ 84 (+18.31%)
Mutual labels:  elf, macho, pe
Lief
Authors
Stars: ✭ 2,730 (+3745.07%)
Mutual labels:  elf, macho, pe
The Backdoor Factory
Patch PE, ELF, Mach-O binaries with shellcode new version in development, available only to sponsors
Stars: ✭ 2,904 (+3990.14%)
Mutual labels:  elf, macho, pe
dwex
DWARF Explorer - a GUI utility for navigating the DWARF debug information
Stars: ✭ 58 (-18.31%)
Mutual labels:  elf, macho
Automated-Malware-Analysis-List
My personal Automated Malware Analysis Sandboxes and Services
Stars: ✭ 20 (-71.83%)
Mutual labels:  elf, pe
byteripper
A tool to extract code from individual functions in a library.
Stars: ✭ 14 (-80.28%)
Mutual labels:  elf, macho
Dissection
The dissection of a simple "hello world" ELF binary.
Stars: ✭ 427 (+501.41%)
Mutual labels:  elf, pe
Rop Tool
A tool to help you write binary exploits
Stars: ✭ 590 (+730.99%)
Mutual labels:  elf, pe
Filebytes
Library to read and edit files in the following formats: Executable and Linking Format (ELF), Portable Executable (PE), MachO and OAT (Android Runtime)
Stars: ✭ 105 (+47.89%)
Mutual labels:  elf, pe
extrude
🕵️ Analyse binaries for missing security features, information disclosure and more...
Stars: ✭ 51 (-28.17%)
Mutual labels:  elf, macho
Goblin
An impish, cross-platform binary parsing crate, written in Rust
Stars: ✭ 591 (+732.39%)
Mutual labels:  elf, pe
Detect It Easy
Program for determining types of files for Windows, Linux and MacOS.
Stars: ✭ 2,982 (+4100%)
Mutual labels:  elf, macho
Cave miner
Search for code cave in all binaries
Stars: ✭ 218 (+207.04%)
Mutual labels:  elf, pe
Checksec.py
Checksec tool in Python, Rich output. Based on LIEF
Stars: ✭ 188 (+164.79%)
Mutual labels:  elf, pe
Faerie
Magical ELF and Mach-o object file writer backend
Stars: ✭ 187 (+163.38%)
Mutual labels:  elf
Xhook
🔥 A PLT hook library for Android native ELF.
Stars: ✭ 2,996 (+4119.72%)
Mutual labels:  elf
Elfkit
rust elf parsing, manipulation and (re)linking toolkit
Stars: ✭ 180 (+153.52%)
Mutual labels:  elf
Elf Parser
Lightweight elf binary parser with no external dependencies - Sections, Symbols, Relocations, Segments
Stars: ✭ 172 (+142.25%)
Mutual labels:  elf
Android Disassembler
Disassemble ANY files including .so (NDK, JNI), Windows PE(EXE, DLL, SYS, etc), linux binaries, libraries, and any other files such as pictures, audios, etc(for fun)files on Android. Capstone-based disassembler application on android. 안드로이드 NDK 공유 라이브러리, Windows 바이너리, etc,... 리버싱 앱
Stars: ✭ 250 (+252.11%)
Mutual labels:  elf
Chain Reactor
Chain Reactor is an open source framework for composing executables that simulate adversary behaviors and techniques on Linux endpoints.
Stars: ✭ 206 (+190.14%)
Mutual labels:  elf

checksec.rs

crates.io docs.rs github-actions

Fast multi-platform (ELF/PE/MachO) binary checksec written in Rust.

cargo crate releases periodically

Uses goblin to for multi-platform binary parsing support and ignore for fast recursive path iteration that respects various filters such as globs, file types and .gitignore files and serde for Serializaiton/Deserialization.

Prior Art

Plenty of prior art exists for this type of tool. Some are standalone command line utilities and some are plugins for frameworks or debuggers, however all are platform specific.

Project Author Language Active
checksec.sh (original) Tobias Klein bash Jan 28, 2009 - Nov 17, 2011
checksec Dhiru Kholia python Apr 18, 2013 - Mar 19, 2014
checksec.sh Brian Davis bash Feb 14, 2014 - current
pwntools - checksec Gallopsled python Nov 8, 2014 - current
CheckSec.c hugsy c Dec 7, 2015 - Apr 24, 2018
checksec klks c++ Mar 25, 2017
iOS-checksec.py ChiChou python Apr 6, 2017
checksec-win Lucas Leong c++ Aug 21, 2017
winchecksec Trail Of Bits c++ Aug 17, 2018 - current
pe_mitigation_check.py David Cannings python Sep 20, 2018

note: not an exhaustive list

Build/Install

git (HEAD)

git clone https://github.com/etke/checksec.rs && cd checksec.rs
cargo build --release
cargo install --path .

cargo

cargo install checksec

Cross-compilation

For instances where you want to compile for a different target OS or architecture, see rust-cross.

Usage

USAGE:
    checksec [FLAGS] [OPTIONS]

FLAGS:
    -h, --help           Prints help information
    -j, --json           Output in json format
        --pretty         Human readable json output
    -P, --process-all    Check all running processes
    -V, --version        Prints version information

OPTIONS:
    -d, --directory <DIRECTORY>    Target directory
    -f, --file <FILE>              Target file
    -p, --process <NAME>           Name of running process to check

Example

standalone checksec

individual binary
$ checksec -f test/binaries/true-x86_64
ELF64: | Canary: true CFI: false SafeStack: false Fortify: true Fortified: 2 NX: true PIE: None Relro: Partial RPATH: None RUNPATH: None | File: test/binaries/true-x86_64
individual binary (json output)
$ checksec -f test/binaries/true-x86_64 --json
{"binaries":[{"binarytype":"Elf64","file":"test/binaries/true-x86_64","properties":{"Elf":{"canary":true,"clang_cfi":false,"clang_safestack":false,"fortified":2,"fortify":true,"nx":true,"pie":"None","relro":"Partial","rpath":{"paths":["None"]},"runpath":{"paths":["None"]}}}}]}
running processes
$ checksec -P
-zsh(34)
 ↪ ELF64: | Canary: true CFI: false SafeStack: false Fortify: true Fortified: 8 NX: true PIE: Full Relro: Full RPATH: None RUNPATH: None | File: /bin/zsh
checksec(216)
 ↪ ELF64: | Canary: false CFI: false SafeStack: false Fortify: false Fortified: 0 NX: true PIE: Full Relro: Full RPATH: None RUNPATH: None | File: /home/etke/.cargo/bin/checksec
init(1)
 ↪ ELF64: | Canary: false CFI: false SafeStack: false Fortify: false Fortified: 0 NX: true PIE: None Relro: Partial RPATH: None RUNPATH: None | File: /init
running processes (json output)
$ checksec -P --json
{"processes":[{"binary":[{"binarytype":"Elf64","file":"/bin/zsh","properties":{"Elf":{"canary":true,"clang_cfi":false,"clang_safestack":false,"fortified":8,"fortify":true,"nx":true,"pie":"PIE","relro":"Full","rpath":{"paths":["None"]},"runpath":{"paths":["None"]}}}}],"pid":34},{"binary":[{"binarytype":"Elf64","file":"/init","properties":{"Elf":{"canary":false,"clang_cfi":false,"clang_safestack":false,"fortified":0,"fortify":false,"nx":true,"pie":"None","relro":"Partial","rpath":{"paths":["None"]},"runpath":{"paths":["None"]}}}}],"pid":1},{"binary":[{"binarytype":"Elf64","file":"/home/etke/.cargo/bin/checksec","properties":{"Elf":{"canary":false,"clang_cfi":false,"clang_safestack":false,"fortified":0,"fortify":false,"nx":true,"pie":"PIE","relro":"Full","rpath":{"paths":["None"]},"runpath":{"paths":["None"]}}}}],"pid":232}]}

libchecksec

Just add the following to any current project with goblin dependencies to enable checksec trait on goblin::Object::{Elf, Mach, PE} objects.

Add checksec crate dependency to your project Cargo.toml.

[dependencies]
checksec = { version = "0.0.9", features = ["elf", "macho", "pe", "color"] }

Now in your project source, specify dependency on the checksec crate and import the required module to access the associated Properties trait(s).

extern crate checksec;
use checksec::elf;
use checksec::macho;
use checksec::pe;

You will now have access to all the implemented check functions directly from the goblin::Object.

See examples/ for library usage examples.

Todo

libchecksec todos

  • Platform specific checks
    • ELF
      • Fortifiable
      • Rpath RW
    • PE
      • Authenticode verification
    • MachO
      • Rpath RW
  • Platform independent checks
    • MachO
      • @rpath contents into shared::VecRpath similar to DT_RPATH/DT_RUNPATH on ELFs
      • Code signature validation

checksec todos

  • ?

project todos

  • Tests (cargo test)

Contributing

Improvements welcome!

  • For ideas, please check the Github Issues page.
    • Want something added? file an issue and tag it with improvement
  • Found a problem? file an issue including the following information
    • Description of the problem
    • Expected behaviour
    • Attach bug tag
  • For pull requests to be reviewed;
    • must be formatted with supplied project rustfmt.toml
    • must have no Clippy warnings/errors with supplied project clippy.toml (when one exists)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].