Giter Club home page Giter Club logo

covermyass's Introduction

build status Coverage Status Go Report Card GitHub all releases

Introduction

Covermyass is a post-exploitation tool to cover your tracks on various operating systems. It was designed for penetration testing "covering tracks" phase, before exiting the compromised server. At any time, you can run the tool to find which log files exists on the system, then run again later to erase those files. The tool will tell you which file can be erased with the current user permissions. Files are overwritten repeatedly with random data, in order to make it harder for even very expensive hardware probing to recover the data.

It supports the three major operating systems (Linux, macOS, Windows) and a few smaller ones (FreeBSD, OpenBSD).

Current status

This tool is still in beta. Upcoming versions might bring breaking changes. For now, we're focusing Linux and Darwin support, Windows may come later.

Installation

Download the latest release :

curl -sSL https://github.com/sundowndev/covermyass/releases/latest/download/covermyass_linux_amd64 -o ./covermyass
chmod +x ./covermyass

Verify digital signatures

covermyass releases are signed using PGP key (rsa4096) with ID E5BC23488DA8C7AC and fingerprint 1A662C679AD91F549A77CD96E5BC23488DA8C7AC. Our key can be retrieved from common keyservers.

  1. Download binary, checksums and signature
curl -L https://github.com/sundowndev/covermyass/releases/latest/download/covermyass_linux_amd64 -o covermyass_linux_amd64 && \
curl -L https://github.com/sundowndev/covermyass/releases/latest/download/covermyass_SHA256SUMS -o covermyass_SHA256SUMS && \
curl -L https://github.com/sundowndev/covermyass/releases/latest/download/covermyass_SHA256SUMS.gpg -o covermyass_SHA256SUMS.gpg
  1. Import key
gpg --keyserver https://keys.openpgp.org --recv-keys 0xE5BC23488DA8C7AC
  1. Verify signature (optionally trust the key from gnupg to avoid any warning)
gpg --verify covermyass_SHA256SUMS.gpg covermyass_SHA256SUMS
  1. Verify checksum
sha256sum --ignore-missing -c covermyass_SHA256SUMS

Usage

$ covermyass -h

Usage:
  covermyass [flags]

Examples:

Overwrite log files 5 times with a final overwrite with zeros to hide shredding
covermyass --write -z -n 5


Flags:
  -f, --filter strings   File paths to ignore (supports glob patterns)
  -h, --help             help for covermyass
  -n, --iterations int   Overwrite N times instead of the default (default 3)
  -l, --list             Show files in a simple list format. This will prevent any write operation
      --no-read-only     Exclude read-only files in the list. Must be used with --list
  -v, --version          version for covermyass
      --write            Erase found log files. This WILL shred the files!
  -z, --zero             Add a final overwrite with zeros to hide shredding

First, run an analysis. This will not erase anything.

$ covermyass

Loaded known log files for linux
Scanning file system...

Found the following files
/var/log/lastlog (29.5 kB, -rw-rw-r--)
/var/log/btmp (0 B, -rw-rw----)
/var/log/wtmp (0 B, -rw-rw-r--)
/var/log/faillog (3.2 kB, -rw-r--r--)

Summary
Found 4 files (4 read-write, 0 read-only) in 27ms

When you acknowledged the results, erase those files.

$ whoami
root
$ covermyass --write -n 100

Loaded known log files for linux
Scanning file system...

Found the following files
/var/log/lastlog (29.5 kB, -rw-rw-r--)
/var/log/btmp (0 B, -rw-rw----)
/var/log/wtmp (0 B, -rw-rw-r--)
/var/log/faillog (3.2 kB, -rw-r--r--)

Summary
Found 4 files (4 read-write, 0 read-only) in 27ms

⣾ Shredding files... (3.1 MB, 1.3 MB/s) [2s] 

Successfully shredded 4 files 100 times

Filter out some paths :

$ covermyass -f '/foo/**/*.log' -f '/bar/foo.log'

License

Covermyass is licensed under the MIT license. Refer to LICENSE for more information.

Sponsorship

covermyass's People

Contributors

sundowndev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

covermyass's Issues

Select files based on modification time

When dealing with a huge number of log files, it can be nice to be able to only read or overwrite relevant files. Files that weren't modified after a date (say, the date the machine was compromised), are not useful to overwrite because the logs have nothing to do with the event. This would increase performances and prevent to deal with permission issues as well.

Example

# Files with a last modified date prior to Dec 24, 2022 will be ignored
$ covermyass --from-date 2022-12-24

User-provided file paths

The tool may not be able to find log files in all places. In such case, the user can specify additional paths to look at for log files.

Example

$ covermyass -p '/foo/bar/*.log'

Shredding heavy files can cause memory overflow

Previously, we used to write random data to files by set of 1024 bytes. Which means that for a file of 4096 bytes, we perform 4 write operations to rewrite the file entirely. Since #10, we're now doing a single write operation per file. This can lead the program to crash if the file is too heavy (we should perform some benchmarks to confirm that). Doing a progressive shredding instead can solve that case.

Predictible overwrite ?

Some users may find disturbing that the tool performs another analysis before actually overwriting the files. It may also take a long time to perform. A solution to this could be to save the initial analysis to a file, so the user can review it, then use it to overwrite them. This behavior is similar to how Terraform works with the plan and apply commands.

Example

# Initial analysis
$ covermyass --to-file=plan.json

# Use the first run to overwrite the files without searching for log files twice
$ covermyass --write --from-file=plan.json

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.