mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-05-02 12:46:04 -04:00
added files
This commit is contained in:
parent
929f49f333
commit
a7015f4ddf
6 changed files with 151 additions and 0 deletions
39
usr/libexec/security-misc/cold-boot-attack-defense-kexec-prepare
Executable file
39
usr/libexec/security-misc/cold-boot-attack-defense-kexec-prepare
Executable file
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
## Copyrigh (C) 2022 - 2022 ENCRYPTED SUPPORT LP <adrelanos@whonix.org>
|
||||
## See the file COPYING for copying conditions.
|
||||
## modified by Friedrich Doku <friedrichdoku@gmail.com>
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
true "env:"
|
||||
env
|
||||
|
||||
## Debugging.
|
||||
## Lets hope $1 is set to reboot, poweroff or halt by systemd.
|
||||
true "1: $1"
|
||||
|
||||
sudo dbus-monitor --system |
|
||||
while read -r line; do
|
||||
if [[ $line =~ .*"poweroff.target".* ]]; then
|
||||
kexec -l /boot/vmlinuz-$(uname -r) --initrd=/boot/initrd.img-$(uname -r) --reuse-cmdline --append="wiperamexit=yes wiperamaction=poweroff"
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ $line =~ .*"reboot.target".* ]]; then
|
||||
kexec -l /boot/vmlinuz-$(uname -r) --initrd=/boot/initrd.img-$(uname -r) --reuse-cmdline --append="wiperamexit=yes wiperamaction=reboot"
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ $line =~ .*"halt.target".* ]]; then
|
||||
kexec -l /boot/vmlinuz-$(uname -r) --initrd=/boot/initrd.img-$(uname -r) --reuse-cmdline --append="wiperamexit=yes wiperamaction=halt"
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ $line =~ .*"kexec.target".* ]]; then
|
||||
kexec -l /boot/vmlinuz-$(uname -r) --initrd=/boot/initrd.img-$(uname -r) --reuse-cmdline --append="wiperamexit=yes wiperamaction=reboot"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
sleep 10
|
Loading…
Add table
Add a link
Reference in a new issue