• Stars
    star
    303
  • Rank 137,655 (Top 3 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created over 4 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Checksec tool in Python, Rich output. Based on LIEF


checksec.py

Checksec tool in Python, Rich output, based on LIEF

Demo

CI badge PyPI package badge Python version badge

Table of Contents

Overview

A simple tool to verify the security properties of your binaries.

These properties can be enabled by your compiler to enforce the security of your executables, and mitigate exploits. However it can be challenging to apply them on a whole system.

Check the level of security your Linux distro / Windows release is providing you !

Supported formats:

  • ELF
  • PE
  • Mach-O

Based on:

  • Rich: Beautiful terminal output formatting
  • LIEF: Cross-platform library to parse, modify and abstract ELF, PE and Mach-O formats

Requirements

Setup

Windows

You find the checksec.exe on the latest Github releases:

Linux

python3 -m venv venv
source venv/bin/activate
(venv) pip install checksec.py

Usage

(venv) checksec <file_or_directory>...

Check --help for more options (JSON output, recursive walk, workers count)

FAQ

1️⃣ What's the difference between checksec.py and checksec.sh ?

checksec.py checksec.sh
Cross-Platform support
Distributed workload
Scan file
Scan directory
Scan directory recursively
Specify libc path
Scan process
Scan process libs
Scan kernel config
Output Cli
Output JSON
Output CSV
Output XML
ELF: Relro
ELF: Canary
ELF: NX
ELF: PIE
ELF: RPATH
ELF: RUNPATH
ELF: Symbols
ELF: Fortify
ELF: Fortified
ELF: Fortifable
ELF: Fortify Score

2️⃣ What's the difference between checksec.py and winchecksec ?

checksec.py winchecksec
Cross-Platform support
Distributed workload
Scan file
Scan directory
Scan directory recursively
Output CLI
Output JSON
PE: ASLR - DYNAMIC_BASE
PE: ASLR - HIGHENTROPYVA
PE: INTEGRITYCHECK
PE: Authenticode signed
PE: DEP
PE: Manifest Isolation
PE: SEH
PE: SafeSEH
PE: Control Flow Guard
PE: Return Flow Guard
PE: Stack Cookie

3️⃣ checksec is slow on some huge binaries ! What's happening ?!

checksec.py relies on the LIEF library to parse PE/ELF/MachO formats.

➡️The library doesn't offer at this point on-demand parsing, so it will parse and fetch unnecessary data.

➡️Retrieving symbols can be slow (ex: pandoc, 118M, +300 000 symbols, +2m 20sec). See this issue

4️⃣ I sent a CTRL-C to cancel checksec.py processing, the app doesn't want to quit

checksec.py is working with multiple process workers to parallelize its execution and binary processing. When a CRTL-C is received, checksec.py will wait for them to stop.

Sometimes, this is not working, and I don't know why at this point. You can kill the remaining Python workers afterwards.

References

License

License: GPL v3

Contributors

More Repositories

1

awesome-virtualization

Collection of resources about Virtualization
1,602
star
2

pyvmidbg

LibVMI-based debug server, implemented in Python. Building a guest aware, stealth and agentless full-system debugger
Python
216
star
3

libmicrovmi

A cross-platform unified Virtual Machine Introspection API library
Rust
164
star
4

r2vmi

Hypervisor-Level Debugger based on Radare2 / LibVMI, using VMI IO and debug plugins
C
131
star
5

osw-fs-windows

A git history of Windows filesystems
78
star
6

oswatcher

A framework to track the evolution of Operating Systems over time
Python
57
star
7

docker-kdesrc-build

Dockerfiles to compile KDE source code into Docker with kdesrc-build script
Python
47
star
8

vid-sys

Rust unsafe bindings for Vid API (Hyper-V)
C
13
star
9

libsysinfo

Extracts information about running processes and network connections from the virtual filesystem /proc
CMake
11
star
10

protonvpn-nm-import

Script to import ProtonVPN configuration files into NetworkManager automatically
Python
10
star
11

linux-sysinternals

CMake
9
star
12

packer-templates-winxp

Batchfile
7
star
13

kvm-vmi

KVM-based Virtual Machine Introspection
Jinja
6
star
14

kvmi

Rust bindings to KVM's introspection libkvmi library
Rust
5
star
15

vagrant-xen-pyvmidbg

Vagrant box to work on pyvmidbg project
HTML
5
star
16

xenctrl

Rust
4
star
17

CNAF

Source code used by the French CNAF (Caisse Nationale des Allocations Familiales)
COBOL
4
star
18

packer-templates

My packer templates
Python
3
star
19

fdp

Rust bindings on FDP (Fast Debugging Protocol) VirtualBox introspection library
Rust
3
star
20

xenstore

Rust bindings to Xenstore
Rust
3
star
21

libvmi-rs

Rust reimplementation of LibVMI
Rust
3
star
22

protonvpn-vm

Preconfigured ProtonVPN setup in a virtual machine
3
star
23

docker-gui-app

Summary of the techniques available to run gui applications inside docker
3
star
24

packer-flare

Packer templates to build your FLARE VM from scratch
PowerShell
3
star
25

windows_internals

2
star
26

kvm

Fork of KVM with Virtual Machine Introspection patch
C
2
star
27

xenevtchn

Rust bindings to xenevtchn library
Rust
2
star
28

cmake_template_cpp

A simple C++ project template based on CMake
CMake
2
star
29

nitro

KVM-based Virtual Machine Introspection
Python
2
star
30

vagrant-icebox

A vagrant environment to develop Icebox and VirtualBox VMI
Batchfile
2
star
31

unbound-formula

Install and configure the Unbound DNS server
SaltStack
2
star
32

libksysguard

Fork of libksysguard
C++
1
star
33

web_monitor

Python
1
star
34

test-formula

A docker container to quickly test a SaltStack formula
SaltStack
1
star
35

testdbus

CMake
1
star
36

kdesrc-build.py

An attempt to rewrite the KDE build system into Python
Python
1
star
37

doxify

Quick C++ source code documentation generator based on doxygen.
Shell
1
star
38

wikimedia-phabricator-tools

Fork of https://gerrit.wikimedia.org/r/phabricator/tools
Python
1
star
39

xenvmevent-sys

Rust unsafe bindings for Xen VM event definitions
Rust
1
star
40

kdesrc-build-genconf

Python
1
star
41

bug_pyfakefs

No such file or directory in the fake filesystem: b'/tmp'
Python
1
star
42

kde-build-metadata

Fork of the kde-build-metadata KDE repository
1
star
43

pandoc_template

A template to generate reports with Pandoc
Makefile
1
star
44

wenzel.github.io

https://wenzel.github.io
HTML
1
star
45

vagrant-xen-r2vmi

Vagrant box to work on r2vmi project
Ruby
1
star
46

salt-oneshot

A quick wrapper around SaltStack to quickly test and deploy a system configuration without having to set-up a Salt Master server.
Python
1
star
47

procexp_helper

C++
1
star
48

bug_pyspy

Python
1
star
49

kcm_template_qml

CMake
1
star
50

docker-owncloud

Dockerfile to configure and deploy Owncloud with a simplified configuration based on SaltStack
Shell
1
star
51

bug_report

A repo to store reproducible code for bug reports
1
star
52

vagrant-xen

A set of Vagrant boxes to install and test the Xen hypervisor
Ruby
1
star
53

fdp-sys

Rust unsafe bindings on FDP (Fast Debugging Protocol) library for VirtualBox Introspection
Rust
1
star
54

xenforeignmemory

Safe Rust bindings to xenforeignmemory
Rust
1
star
55

checksec.py-test-binaries

Test binaries for checksec.py
1
star
56

test_bug_actions

https://bugzilla.mozilla.org/show_bug.cgi?id=1622455
1
star
57

kmonitor

A new system monitor for KDE
CMake
1
star
58

xenevtchn-sys

Rust bindings for xenevtchn library
Rust
1
star
59

kvmi-sys

Rust bindings for KVM's introspection libkvmi library
Rust
1
star