
Run a script when police raid your house - lpman
https://github.com/defuse/swatd
======
fencepost
Frankly, if I were in a place or doing activities where I thought a police
raid was a significant possibility, I'd MUCH rather have something that would
trigger video AND AUDIO recording from multiple cameras in the house, placed
in locations where they wouldn't be "accidentally" knocked over or otherwise
destroyed and with the data going offsite immediately via any of several
channels (e.g. home network, home wifi, neighbor wifi, public/semipublic wifi
(e.g. "xfinitywifi"), LTE phone).

Alternately, always have the recording going to something local, but trigger
offsiting it with something like this and otherwise have a very limited
timeframe for keeping it.

The other VERY VERY important piece of this I suspect would be notices posted
at every possible entrance to the house, something like "Video and audio
recording occur on these premises. By entering, you consent to this recording
and to the use and public disclosure of these recordings. If you do not
consent to these recording, use and disclosure policies, please call (xxx)
xxx-xxxx and schedule an appointment." Perhaps I should call this a kick-
through license - I'm not sure it'd stand up, but I suspect you'd have a
pretty decent chance of that.

Of course, I'm boring, not inclined to activities likely to inspire either
police interest or SWATing, and I live in a mostly-white townhouse community
in the 'burbs. My most likely home invasion would be because "you are in a
maze of twisty drives and townhouse units, all alike."

~~~
ryanmarsh
It's probably my PTSD but my biggest fear is getting raided by SWAT in a
"wrong house" mixup or for some other stupid reason. In such an instance I
would likely kill one or more of them. I have a family in my house that could
be injured by them in the process. I've always wanted a camera system that had
remote encrypted storage so I could prove the truth in court.

I just re-read this comment and I'm clearly nuts.

~~~
JonFish85
"In such an instance I would likely kill one or more of them"

You may want to consider how to react differently in such a situation. That's
definitely a fight you can't win, and indeed would probably lead to causing
your loved ones more pain than it's worth. It's probably best to comply with
order in the heat of the moment and later fight it in court. The outcome will
be much, much better, I promise.

~~~
ryanmarsh
Brother, my alarm went off in my house one night when I was in bed because of
high winds outside. A door moved slightly in its jamb causing the sensor to
trip. I was out the door with my gun and had circled and cleared the perimeter
of the house before I knew what happened. My wife says I was screaming at the
"intruders" to get out of my house the entire time. I do not remember this.

I mean no insult by saying this but you really just cannot understand what
this is like unless you've lived it.

~~~
a3n
Sorry we made you go through that man. Even if you did volunteer.

~~~
PhantomGremlin
I don't know the details about the GP poster. But a lot of people didn't
"volunteer" for as much service in Iraq or Afghanistan as they wound up doing.

Yes they initially volunteered but then "stop-loss" happened and they had to
stay in the active military for far longer than they were originally told they
would.

Also many people were serving in reserve units or the National Guard (aka
"weekend warriors") and entire units wound up being sent to Iraq because we
didn't have enough active duty soldiers.

There's a hard to use .mil website that has details.[1] E.g deaths just in
"Operation Iraqi Freedom" (there are additional ME deaths not included):

    
    
       active duty    3502
       reserve         413
       National Guard  497
    

[1]
[https://www.dmdc.osd.mil/dcas/pages/casualties.xhtml](https://www.dmdc.osd.mil/dcas/pages/casualties.xhtml)

~~~
ryanmarsh
I want no sympathy personally, and I really don't like the "hero" talk. Nobody
I ever met in the infantry was oblivious to what they were getting themselves
into. Especially not in the airborne. I mean really, they throw you out of
airplanes with parachutes made by the lowest bidder. Everyone laughs about
dying to cover the fear.

When you sign up they are very clear that the term of your enlistment is 8
years whether or not you serve 4 or 5 active. They can call you up anytime in
that 8 years. It sucks but again it's not a violation of trust. Still being
stop lossed to go back is hugely terrifying for guys ready to transition back
to civilian life.

Some guys out there really need help. Fallujah and the Korengal were meat
grinders. I haven't met a single guy who was boots on the ground there that
isn't seriously messed up from it. We owe it to them to get the care they need
but the VA is an absolute crime.

~~~
PhantomGremlin
> I haven't met a single guy who was boots on the ground there that isn't
> seriously messed up from it.

War is hell.

I remember hearing about neighbors who came back from Vietnam in around 1970,
and they also suffered PTSD (of course I don't think we had that acronym
then). And I knew an Army NCO (recipient of the Silver Star) who served two
tours in Vietnam. He slept with a loaded .45 under his pillow, probably
"cocked and locked" as they say (at least hopefully it was "locked"). And it
wasn't because he lived in a bad neighborhood.

Its a shame that we still haven't figured out how to get help to those who
need it, how to help ease those guys off that razor's edge that they needed to
maintain in order to come back alive.

------
ipsin
I really like his sort of thing, but realize that, like anti-forensics tools,
there is a risk to having and using destructive anti-tamper triggers.

If the police actually think you're up to something, raid you, and your
"cybernetic boobytrap" destroys your hundreds of GB of _actual_ random data,
they may still try and prove that you're a terrible person and destroyed
evidence in court. Then it's up to a jury, and a prosecutor bent on making you
look guilty as hell.

I'm not trying to dissuade exploration, but understand what can happen if you
actually deploy this sort of system.

~~~
gpcz
This program makes me nervous because its primary use case is to obstruct
justice, which the author tries to get away from with a thinly-veiled excuse
that it could also be used to defend against criminals. I understand that
technology is ethically neutral (for example, this program could be used to
hinder reverse-engineering of a sealed computing appliance), but the fact that
they're basically advertising this thing to obstruct police investigations
puts me off.

~~~
NoMoreNicksLeft
> This program makes me nervous because its primary use case is to obstruct
> justice

Given the number of raids that happen based on false CI information, typoed
street addresses, or government overreach... it's not clear that the program
is meant to be used primarily for that.

The police aren't our friends. They don't protect us individually or
collectively. Often we need to be protected from them. Any tool that can help
with that is a good thing.

~~~
emcrazyone
1000% agree. I was out having fun one night with some friends in my younger
years. We left a bar together and split up. As I and one of the guys I was
with entered a parking structured, my other friends drove up to us in a
convertible car. They were laughing at me because my fly was down so I pulled
it up in a funny gesture as I approached them.

At that point, two cops pulled in behind me and thought I was passing drugs.
They looked around on the ground and patted me down and when they found
nothing, they trump up some charges and said I indecently exposed myself. When
the case went to court, the cops were caught lying. They tried to tell the
judge I flashed some girls in a convertible but video showed they lied through
their teeth.

So I have my own personal story but don't listen to me, hear what this
professor and an ex-cop have to say about talking to the police.

[https://www.youtube.com/watch?v=6wXkI4t7nuc](https://www.youtube.com/watch?v=6wXkI4t7nuc)

------
mathetic
> SWATd is a daemon for running scripts when your house gets raided by the
> police (or broken into by criminals).

It's funny how the distinction seems blurry at times.

~~~
NoMoreNicksLeft
It's not blurry at all. The police get to decide what is criminal and what
isn't... so they're always the good guys.

------
kbart
Not to be picky, just interested. What's the reason behind using a daemon
instead of simply running sensor check scripts in Cron? Or even better, raise
interrupt when sensor fails, so you don't have to wait 30s (in worst case).

------
nkw
IAALBIANYL, so I will leave whether or not this would be operationally useful
to those smarter than me, but from a legal standpoint, one should be aware
that operation of a system like this as far as the United States would likely
result in additional charges for obstruction of justice[1].

It is by no means unusual for the government to fail in the prosecution of the
original crime they investigated, but succeed in convicting a defendant for
obstruction. (See, e.g. Martha Stewart[2]). In fact it is not at all
impossible (though not likely) to imagine a scenario in which someone
committed no crime, was running a utility like this, and was eventually
charged with obstruction. Say I'm Brian Q. Krebs, some nice people on the
Internet decide to swat[3] me confusing me with someone with a similar
name[4], police enter my house, swatd deploys and ambitious and creative young
prosecutor decides to charge me with a violation of 18 USC 1519. Might not
succeed, but boy will he get some press.

As always, the best advice if you are going to engage in a wide-ranging
criminal conspiracy is to make sure you have some goofy-reasoned memos from
DOJ lawyers approving your activities[5] and Congress on call to provide you
retroactive immunity[6].

[1] 18 U.S.C. 1519 (or 1001 or 1501, or 1510) -
[http://www.law.cornell.edu/uscode/text/18/1519](http://www.law.cornell.edu/uscode/text/18/1519)

[2]
[http://en.wikipedia.org/wiki/Martha_Stewart#Stock_trading_ca...](http://en.wikipedia.org/wiki/Martha_Stewart#Stock_trading_case_and_conviction)

[3]
[http://en.wikipedia.org/wiki/Swatting](http://en.wikipedia.org/wiki/Swatting)

[4]
[http://krebsonsecurity.com/tag/swatting/](http://krebsonsecurity.com/tag/swatting/)

[5]
[http://en.wikipedia.org/wiki/Torture_Memos#Letter_from_John_...](http://en.wikipedia.org/wiki/Torture_Memos#Letter_from_John_Yoo_to_Alberto_Gonzales)

[6]
[http://en.wikipedia.org/wiki/Amnesty_law#United_States](http://en.wikipedia.org/wiki/Amnesty_law#United_States)
or
[http://en.wikipedia.org/wiki/Foreign_Intelligence_Surveillan...](http://en.wikipedia.org/wiki/Foreign_Intelligence_Surveillance_Act#Foreign_Intelligence_Surveillance_Act_of_1978_Amendments_Act_of_2008)

~~~
saganus
IAALBIANYL - I'm thinking this means "I Am A Lawyer But I Am Not Your Lawyer"?
I haven't seen this before but it seems to make sense. Or does it mean
something else?

~~~
nkw
You got it.

------
earthrise
Hi everyone, I'm the author of that software.

I really didn't want this to blow up. It's absolutely NOT a solution to
getting raided by the police. While that was the original inspiration for
writing the tool, I was half-joking when I wrote the README about it being a
defense against law enforcement.

I've moved the code into a different branch and added a disclaimer to the
README. The most important line of the disclaimer is: "If you need to rely on
SWATd, you have already lost."

------
Spooky23
This is a really stupid thing to do.

Willful destruction of evidence is a criminal act in many cases, and even in
cases where it isn't, judges can instruct juries to make adverse inferences.

If you're handling sensitive material, you should have a consistent
policy/practice to periodically purge, destroy or deal with data. You're less
likely to get into hot water over deleting data if its a long-standing
process. If you are involved in a criminal scheme and the police are busting
down the door, they have evidence already.

Previous jobs had me involved in alot of civil litigation from the IT side.
Many really serious problems were avoided by having good deletion policy. The
place that let employees squirrel away email for 20 years would either lose
cases because of stupid employee chatter or win pyrrhic victories after
spending thousands (or millions in one case) of dollars on discovery.

------
SlipperySlope
Thank you for sharing a clever script that has many uses!

However ...

Ideally, your computer should be secure against physical access and not need
to run a script.

This is a solved problem in the intelligence and defense communities which
have policies such as physical key storage, e.g. PIN enabled encrypted USBs,
encrypted file systems, multifactor authentication and such to defeat forensic
tools operated by an adversary.

Suppose you are a military or intelligence officer carrying around a laptop
with secret stuff on it. How do you think that laptop is secured so that its
safe even in the hands of an adversary.

Far more likely than a police raid, is the accidental trigger of the script,
e.g. the house painter needs to move your server a bit to get to the wall
behind it!

~~~
jordsmi
> This is a solved problem in the intelligence and defense communities which
> have policies such as physical key storage, e.g. PIN enabled encrypted USBs,
> encrypted file systems, multifactor authentication and such to defeat
> forensic tools operated by an adversary.

That doesn't really help if they grab your pc while you are in the middle of a
session while your data is already decrypted.

------
Practicality
It's difficult to think of things you could watch that would only occur during
a raid. The examples given: ethernet and wi-fi, both go down much more often
than you would like to think. Usually it's only for microseconds, but if you
have a program that happens to check right then, there goes your encryption
keys.

A tweak to the code would be to make sure that the sensor stays in the fail
state for a particular duration. Even a few seconds would get rid of a lot of
the false positives.

------
smoyer
I think you could accomplish a similar function using the proximity of a cell
phone to a laptop (like this:
[http://www.novell.com/coolsolutions/feature/18684.html](http://www.novell.com/coolsolutions/feature/18684.html)).
If the script shuts the laptop down when it's too far from the phone, that's
perfect for me.

~~~
acveilleux
Well, for non-destructive actions that's probably good enough.

For destructive actions (say zeroing an RSA private key or some sort of master
key, wiping an HSM, etc.) than you would want a system where the likelihood of
false negatives is minimized only so far as the likelihood of a false positive
is very remote.

In the former case, you could be compelled to provide the password (or
equivalent). In the later case, even if you do they have to brute force the
crypto container (assuming no backup of the destroyed data can be found.)

HSMs generally behave destructively to tampering and normally are the
exclusive holder of a specific key. They tend to have a metal casing that
protects the tamper detection mechanisms from accidental triggering and
redundant batteries to avoid running out of power (which is normally a trigger
for self-erasure through de-powering SRAM or running off of a capacitor with
an high-priority non-maskable power-loss interrupt to trigger zeroing.)

~~~
cmdkeen
This is where you need to separate the data from the encryption, and where
external hardware based authentication becomes useful. If you have a hardware
authentication you can destroy the device without losing data, and depending
on the ease of getting a new device hold up the ability to access said data.
There are all sorts of things you could look at wrt securing/destroying the
device, GPS location etc.

If you were to have the devices be stored / issued from somewhere outwith the
jurisdiction of your state you might even have something that could stand up
to the law. But then you have to worry about someone tampering with the
devices - but by that point you're up against intelligence agencies and
realistically you can't do anything to stop them - after all your device is
Tempest secured, air gapped from the internet etc etc.

------
pluma
Or simply don't have your computer in the US.

But that might be easier said then done if you happen to actually live in the
US, of course.

------
e40
The interesting part would be information about available sensors, and I see
none of that at the link provided. Too bad.

~~~
the8472
You basically have to script your own, depending on your system.

Case instrusion sensor, availability of your network, inertial sensors.

Hotplug events are especially interesting. There are Firewire memory dumpers
or attempts to reboot from an USB stick. And they simply might have to unplug
things if they want to physically move the machine, even if they have spliced
the power source.

Not everyone has the same hardware.

------
kefka
Or well known as a dead man's switch.

Speaking tangentially, what is the current state of the art of homomorphic
encryption? I found this: [https://hcrypt.com/](https://hcrypt.com/) \- Anyone
try it yet?

------
cryoshon
Wouldn't it be more practical to change things so that the cops aren't raiding
houses all the time?

~~~
towelguy
It would be more practical to go live where cops aren't raiding houses all the
time.

I wonder why DPR wasn't living in some tropical riviera instead of the US.

~~~
pluma
But no other country has as many freedoms as the US. Everybody knows the world
envies Americans for their freedoms and democracy, don't they?

/s

