前言:本文主要介绍kali linux的分区级加密方案,旨在对抗离线攻击。加密技术涉及bitlocker和luks,内容包括分区制作与加解密,以及自动挂载与权限分配等问题解决方案。本文随时更新。
uname -v:#1 SMP Debian 4.17.8-1kali1 (2018-07-24)
create:2018-8-17 07:11:39
update:2018-8-17 08:24:36
Windows10 家庭版开启bitlocker
本人用的是双系统,GPT分区以及UEFI模式安装kali的文章后续会补上。
- 升级系统。机器自带的为HOME版,这个版本是不支持bitlocker的,所以要升级到专业版或者更高的企业版。得知此事后,第一反应是重装系统,其实大可不必。备份当前设备ID和激活密钥,再搜一下高级版本的激活码,直接更新即可。升级完成后进行下一步。
- 启动加密。右键D盘盘符,开启bitlocker。由于是块新硬盘,里面没有数据,采用最快的那个模式,再写入数据时会自动加密。设置成功后可进行下一步。
- 开关方式。每次开机登入windows系统之后都要双击输入密钥才能解锁。关机时会自动锁定,但这种方式不切实际。
manage-bde.exe d: -lock
pause
写个脚本,另存为lock_d.bat。加锁时,先确保加密分区没有文件操作占用,然后右键以管理员权限运行即可。
在Linux系统中解锁bitlocker
Linux默认并不支持bitlocker,但可以借助第三方工具disklocker解决。
- 编译安装步骤
- 解密与挂载
sudo dislocker -r -V /dev/sdaX -uPASSWORD -- /media/bitlocker
sudo -i
cd /media/bitlocker
mount -r -o loop dislocker-file /media/mount
#普通用户权限问题,参考如下命令:
mount -t cifs //10.6.10.113/SHARE /u02 -o noatime -o nodiratime -o username=administrator,password=111111,rw,uid=0,gid=0,dir_mode=0777,file_mode=0777
- 使用手册
m4k0@4rk:~$ dislocker --help
dislocker by Romain Coltel, v0.7.1 (compiled for Linux/x86_64)
Compiled version: master:747cbd6
Usage: dislocker [-hqrsv] [-l LOG_FILE] [-O OFFSET] [-V VOLUME DECRYPTMETHOD -F[N]] [-- ARGS...]
with DECRYPTMETHOD = -p[RECOVERY_PASSWORD]|-f BEK_FILE|-u[USER_PASSWORD]|-k FVEK_FILE|-c
Options:
-c, --clearkey decrypt volume using a clear key (default)
-f, --bekfile BEKFILE
decrypt volume using the bek file (on USB key)
-F, --force-block=[N] force use of metadata block number N (1, 2 or 3)
-h, --help print this help and exit
-k, --fvek FVEK_FILE decrypt volume using the FVEK directly
-l, --logfile LOG_FILE
put messages into this file (stdout by default)
-O, --offset OFFSET BitLocker partition offset, in bytes (default is 0)
-p, --recovery-password=[RECOVERY_PASSWORD]
decrypt volume using the recovery password method
-q, --quiet do NOT display anything
-r, --readonly do not allow to write on the BitLocker volume
-s, --stateok do not check the volume's state, assume it's ok to mount it
-u, --user-password=[USER_PASSWORD]
decrypt volume using the user password method
-v, --verbosity increase verbosity (CRITICAL errors are displayed by default)
-V, --volume VOLUME volume to get metadata and keys from
-- end of program options, beginning of FUSE's ones
ARGS are any arguments you want to pass to FUSE. You need to pass at least
the mount-point.
- 注意事项
这里填一下Kali安装disklocker遇到的坑。-
缺少依赖。使用
aptitute -search 依赖名
或者apt-file search 依赖名
定位到包,如:
libpolarssl7_1.3.9-2.1+deb8u3_amd64.deb、libpolarssl-dev_1.3.9-2.1+deb8u3_amd64.deb。
去这里https://packages.debian.org/jessie/amd64/libpolarssl-dev,右上角搜索后,下载安装。 -
缺少头文件
-
/usr/include/ruby-2.5.0/ruby/ruby.h:24:10: fatal error: ruby/config.h: Arquivo ou diretório inexistente
#include "ruby/config.h"
^~~~~~~~~~~~~~~
compilation terminated.
src/CMakeFiles/dislocker.dir/build.make:62: recipe for target 'src/CMakeFiles/dislocker.dir/dislocker.c.o' failed
make[2]: *** [src/CMakeFiles/dislocker.dir/dislocker.c.o] Error 1
CMakeFiles/Makefile2:200: recipe for target 'src/CMakeFiles/dislocker.dir/all' failed
make[1]: *** [src/CMakeFiles/dislocker.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
sudo cp /usr/include/x86_64-linux-gnu/ruby-2.5.0/ruby/config.h /usr/include/ruby-2.5.0/ruby/
其实还有个叫m3.bitlocker工具可以解锁bitlocker,很好安装,但装完你会发现这货居然是要收保护费的!
其他措施
- 不要作死尝试先安装linux再去双系统windows,分区表会乱掉。
- 考虑到地球重力方向,以及液态水的导电性,水杯的最高位置要低于笔记本的最低位置。
别问我为什么这么做,说多了都是泪……
结语
官方文档和ISSUE永远都是好东西。
在笔者看来,安全的深层问题,永远都是口令问题。关于口令,也有单独发文的计划,慢慢来。
后期会加入针对上述技术的破解手段。
网友评论