Skip to content

Commit

Permalink
Merge pull request hephaest0s#2 from hephaest0s/master
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
Sabri Haddouche committed May 5, 2015
2 parents 93ab24f + fe0fd5c commit 60bdd34
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
![usbkill](https://github.com/pwnsdx/usbkill/blob/master/Resources/USBKill.jpg?raw=true)

« usbkill » is a killswitch that wait for a change on your USB ports and then immediately shutdown your computer when there are. Anti-forensics.
« usbkill » is a kill-switch that waits for a change on your USB ports and then immediately shuts down your computer. Anti-forensic.

> The project is still in early development stage but it does work and is effective. Expect improvements to come. Custom commands for when a USB change is observed will be implemented later.
> The project is still under development but it does work and is effective. Expect improvements to come. Custom commands for when a USB change is observed will be implemented.
To run:

Expand All @@ -12,11 +12,11 @@ sudo python3 usbkill.py

### Why?

Imagine your government comes busting in, or steals your laptop when you are at a public library (as with Ross). The police commonly use a « [mouse jiggler](http://www.amazon.com/Cru-dataport-Jiggler-Automatic-keyboard-Activity/dp/B00MTZY7Y4/ref=pd_bxgy_pc_text_y/190-3944818-7671348) » to keep the screensaver and sleep mode from activating.
In case the police or other thugs come busting in (or steal your laptop from you when you are at a public library as happened to Ross). You can use this as an anti-forensic measure.

If something like this happens to you, you would like to shutdown your computer immediately. This is what usbkill does.
The police commonly uses a « [mouse jiggler](http://www.amazon.com/Cru-dataport-Jiggler-Automatic-keyboard-Activity/dp/B00MTZY7Y4/ref=pd_bxgy_pc_text_y/190-3944818-7671348) » to keep the screensaver and sleep mode from activating.

Of course your government could be replaced by an adversary like a hacker or anyone else who want your informations.
If you are attacked this way, you would like for your computer to shut down your immediately.

> **Important**: Make sure to use full disk encryption! Otherwise they will get in anyway.
Expand Down
8 changes: 4 additions & 4 deletions usbkill.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def log(msg):
os.system("echo '' >> " + logfile)

# Log the message that needed to be logged:
os.system("echo '" + str(time) + " " + msg + "' >> " + logfile)
os.system("echo '" + str(time()) + " " + msg + "' >> " + logfile)

# Log current usb state:
os.system("echo 'Current state:' >> " + logfile)
Expand Down Expand Up @@ -70,7 +70,7 @@ def lsusb():
def settings_template(filename):
# Make sure there is the settings folder
if not os.path.isdir("/etc/usbkill/"):
os.system("mkdir /etc/usbkill/")
os.mkdir("/etc/usbkill/")
# Make sure there is a settings file
if not os.path.isfile(filename):
# Pre-populate the settings file if it does not exist yet
Expand Down Expand Up @@ -113,7 +113,7 @@ def loop(whitelisted_devices, sleep_time):
acceptable_devices = set(start_devices + whitelisted_devices)

# Write to logs that loop is starting:
msg = "Started patrolling the USB ports every", sleep_time, "seconds..."
msg = "Started patrolling the USB ports every " + str(sleep_time) + " seconds..."
log(msg)
print(msg)

Expand Down Expand Up @@ -154,7 +154,7 @@ def exit_handler(signum, frame):

# Make sure there is a logging folder
if not os.path.isdir("/var/log/usbkill/"):
os.system("mkdir /var/log/usbkill/")
os.mkdir("/var/log/usbkill/")

# Make sure settings file is available
settings_template(SETTINGS_FILE)
Expand Down

0 comments on commit 60bdd34

Please sign in to comment.