Giter VIP home page Giter VIP logo

shreddy2's Introduction

shreddy2.py -- The Raspberry Pi storage scrub station for USB thumb drives.

Operate your own USB memory stick cleaning station by running this piece of software on a Raspberry PI. USB storage media attached to it is overwritten according to NIST 800-88. The overwriting cycle is 0x00, 0xff and then random data as final pass.

Read the full story at https://pentagrid.ch/en/blog/shreddy2-the-raspberry-pi-storage-scrub-station-for-usb-thumb-drives/

Set up a Raspberry Pi and install the Raspberry Pi OS according to the documentation on https://www.raspberrypi.org/software/. Do this in a safe environment.

Log in to the Raspberry PI. Ensure the default password of the Raspberry Pi is changed. Otherwise, this is a risk for the data attached as USB sticks.

Install dependencies:

sudo apt install python3-pyudev coreutils parted dosfstools

If you like to use a busylight, run the following commands to install software:

git clone https://github.com/nitram2342/pyBusylight.git
cd pyBusylight/
sudo python3 setup.py install

Shreddy will probe for the module, and if the module is not there, the feature is not used.

Create a user that will later run the software:

sudo useradd -d /var/shreddy2 -m -s /usr/sbin/nologin shreddy2

Edit /etc/udev/rules.d/23-usb-storage-permissions.rules:

ACTION=="add", SUBSYSTEMS=="usb", SUBSYSTEM=="block", MODE="0660", OWNER="shreddy2"

Edit /etc/udev/rules.d/42-usb-busylight.rules if you like to use a Kuando Busylight:

SUBSYSTEM=="usb", ATTRS{idVendor}=="27bb", ATTRS{idProduct}=="3bc0", OWNER="shreddy2", MODE="0660"
SUBSYSTEM=="usb", ATTRS{idVendor}=="27bb", ATTRS{idProduct}=="3bca", OWNER="shreddy2", MODE="0660"
SUBSYSTEM=="usb", ATTRS{idVendor}=="27bb", ATTRS{idProduct}=="3bcc", OWNER="shreddy2", MODE="0660"
SUBSYSTEM=="usb", ATTRS{idVendor}=="27bb", ATTRS{idProduct}=="3bcd", OWNER="shreddy2", MODE="0660"
SUBSYSTEM=="usb", ATTRS{idVendor}=="27bb", ATTRS{idProduct}=="f848", OWNER="shreddy2", MODE="0660"

Reload udev rules:

sudo udevadm control --reload-rules

Get Shreddy2 source code:

git clone https://github.com/pentagridsec/shreddy2
cd shreddy2

Install program files:

sudo cp shreddy2.service /etc/systemd/system/
sudo cp shreddy2.py shreddy2-partition.sh /usr/local/bin
sudo chown root.root /usr/local/bin/shreddy2.py /usr/local/bin/shreddy2-partition.sh /etc/systemd/system/shreddy2.service

Allow Shreddy2 user to run /usr/local/bin/shreddy2-partition.sh in privileged mode. Therefore, edit /etc/sudoers.conf by running:

sudo visudo

... and add the following line to the /etc/sudoers.conf configuration:

shreddy2 ALL=(root) NOPASSWD:/usr/local/bin/shreddy2-partition.sh

Enable and run server:

sudo systemctl daemon-reload
sudo systemctl enable shreddy2
sudo systemctl start shreddy2
sudo systemctl status shreddy2
  • Overwriting Flash memory does not guarantee that there are no data residues left. It only reduces the probability. It is best effort.
  • If the shredding station is compromised and a storage medium is attached, information is exposed to the compromised station. You may want to run the shredding station in an air-gapped mode and using a Busylight for status signalling.
  • If you operate the erasing station in a less trustworthy environment, the station could be compromised. If you leave USB sticks, they may be removed by other people, either before or after the clean up operation. Furthermore, USB sticks could be replaced by malicious hardware that has got implants.
  • The erasing station should be labelled with a sufficiently noticeable warning. Otherwise, people think they could charge their phones.

This software is developed by Martin Schobert <[email protected]>. It is published under BSD license with a non-military clause. Please read LICENSE for license details.

shreddy2's People

Contributors

floyd-fuh avatar nitram2342 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

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.