
Code: Select all
...
Enter LUKS passphrase:
failed to setup dm-crypt mapping
failed to read from key storage
Command failed: No key available with this passphrase
mount: special device -dev-mapper-root does not exist
umount: /root: not mounted
Command failed: no such device
Enter LUKS passphrase:
Code: Select all
insmod /modules/dm-crypt.ko
insmod /modules/dm-mod.ko
Code: Select all
insmod: error inserting `dm-crypt.ko`: -1 Unknown symbol in module
Code: Select all
dm_crypt: Unknown symbol dm_put_device
dm_crypt: Unknown symbol dm_unregister_target
dm_crypt: Unknown symbol dm_register_target
dm_crypt: Unknown symbol dm_table_get_mode
dm_crypt: Unknown symbol dm_get_device
device-mapper: 4.4.0-ioctl (2005-01-12) initialized: dm-devel@redhat.com
1)1. after reboot and entering the correct LUKS passphraseCode: Select all
Enter LUKS passphrase: failed to setup dm-crypt mapping failed to read from key storage Command failed: No key available with this passphrase mount: special device -dev-mapper-root does not exist umount: /root: not mounted Command failed: no such device Enter LUKS passphrase:
Again, it is best to compile dm-crypt and device-mapper into the kernel instead of modules, i will add this to the guide to avoid confusion.2. The tutorial explains about linuxrc "Basically its job will be to set up dm-crypt, ..."; but i really do not understand where this script does so. So i decided to try to solve this by inserting dm-crypt and dm-mod modules (just like it is explained here: http://wiki.blagblagblag.org/Encrypting ... ate_initrd ): so i copied dm-crypt.ko, dm-mod.ko and insmod to the initrd and added
Code:
insmod /modules/dm-crypt.ko
insmod /modules/dm-mod.ko
to linukrc. The result was
Code:
insmod: error inserting `dm-crypt.ko`: -1 Unknown symbol in module
and dmesg told
Code:
dm_crypt: Unknown symbol dm_put_device
dm_crypt: Unknown symbol dm_unregister_target
dm_crypt: Unknown symbol dm_register_target
dm_crypt: Unknown symbol dm_table_get_mode
dm_crypt: Unknown symbol dm_get_device
device-mapper: 4.4.0-ioctl (2005-01-12) initialized: dm-devel@redhat.com

my thought was: i have (temporarily, untill the root-encryption works) a second unencrypted root-partition wich is compiled exactly like the encrypted one. and from this system i can open/encrypt/mount the encrypted partition without any problems. so i thought, this should work from the initrd as well if i include the right modules.I highly recommend however that you follow step by step the guide, it's not hard to understand.
i tried to use the script, which didn't work. so i replaced the script by one, that only checks for procfs and devfs andDid you created the nodes yourself inside the initrd or you used the script ?
Code: Select all
mknod --mode=600 /dev/mapper/control c 10 63 this problem can be solved by inserting dm-mod.ko before dm-crypt.ko (as i figured out in the meantime) but this does nothing to solve the first problem.insmod: error inserting `dm-crypt.ko`: -1 Unknown symbol in module


Code: Select all
insmod /modules/aes-i586.ko Code: Select all
...
umount -n /proc
insmod /modules/aes-i586.ko
insmod /modules/dm-mod.ko
insmod /modules/dm-crypt.ko
loadkeys ...
no, it is not; only, recompile the kernel, reconfigure the system, and so on would have been really inconvenient.If building the initrd is too much work for you
Code: Select all
Enter LUKS passphrase:
failed to setup dm-crypt mapping
failed to read from key storage
Command failed: No key available with this passphrase
mount: special device -dev-mapper-root does not exist
umount: /root: not mounted
Command failed: no such device
What are you exactly trying to say in this line? what do you mean by "after I disable the llinuxrc-script" ? You need that script to boot your system, otherwise you won't be able to decrypt the root partitionBut after I disable the linuxrc-script and compiled also the SHA256 crypto in, I have success in mounting root .
Code: Select all
#!/bin/sh
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
# Filter kernel messages on boot
dmesg -n 1
haltme() {
b=0
while [ "$b" = 0 ]
do
sleep 60
done
}
mount -t proc none /proc
CMDLINE=`cat /proc/cmdline`
exec /bin/sh
Code: Select all
#!/bin/sh
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
# Filter kernel messages on boot
dmesg -n 1
haltme() {
b=0
while [ "$b" = 0 ]
do
sleep 60
done
}
mount -t proc none /proc
CMDLINE=`cat /proc/cmdline`
## Create /dev/mapper/control nod for udev systems # Only if you choosed
#sh devmap_mknod.sh # to use devmap_mknod
#umount -n /proc =========>>>add #
## loadkeys # Only for international users,
#loadkeys ./es-cp850.map.gz
# correct password while loop
c=0
while [ "$c" != 5 ]
do
cryptsetup luksOpen /dev/sda3 root
mount -t ext3 /dev/mapper/root /root
umount -n /proc # ========>>>>> newline
if [ "$?" = 0 ]; then
echo "Root Decrypted"
break
else
umount /root
cryptsetup luksClose root
let c=$c+1
if [ "$c" = 5 ]; then
echo "Illegal Trasspassing attempted"
echo "Halting..."
haltme
fi
fi
--snapp
No, I don't think /proc needs to be mounted for cryptsetup execution, your problem was the ciphers, you didn't had sha256 builted in the kernel, yet you used it when you created the mapping, therefore it failed when you tried to decrypt it. That's way it all worked fine when you recompiled your kernel with sha256 builted in.So the only change I made, was to umount /proc after I mounted root. Is the /proc needed by cryptsetup for the ciphers ??? This would explain it.
....
http://eprint.iacr.org/2005/271
This paper implements a side-channel attack on the AES implemention of
the Linux kernel via dm-crypt. That is, the encryption key is reveal to
any legal user of the system by probing the processor's cache after
about 800 read/write requests.
These kinds of attacks are quite new, and there is no clear answer how to
deal with them. I presume it will take a while before we see this gap
closed. For the moment: Don't use dm-crypt on systems where users can
write to disks for that they are not authorized to know the encryption
key.
....
If I understand that sentence right, you would need access to the system via a user account for executing such unprivileged processes & exploiting the weakness.The attacks allow an unprivileged process to attack other processes running in parallel on the same processor, despite partitioning methods such as memory protection, sandboxing and virtualization

Sorry, i do not really understand which difference that makes. if i understood correctly, this kind of attack is possible, if the encrypted disk is opened and the attacker owns a process on the local machine - no matter if there are unencrypted disks/partitions as well. or did i understand something wrong?Since this Thread is about System Encryption, meaning the whole disk (except /boot) is encrypted,
The problem seems not to be luks- (but AES-) specific. Does that mean that any currently used partition encryption-methods are affected (since they are all AES-based, aren't they?)? Or are there any elliptic-curve-cryptographic-methods yet?We discuss in detail several such attacks on AES, and experimentally demonstrate their applicability to real systems, such as OpenSSL and Linux's dm-crypt encrypted partitions
But how is the attacker supposed to open the disk in the first place, if it is encrypted? IMO the only way to exploit this weakness is if you give an attacker a user account on your machine or if he gets physical access to it while it is still running - if the PC is powered off, he'll need to encrypt the disk first.if i understood correctly, this kind of attack is possible, if the encrypted disk is opened and the attacker owns a process on the local machine - no matter if there are unencrypted disks/partitions as well. or did i understand something wrong?
Code: Select all
ls -l /dev/sdb /dev/sdb1
brw-rw---- 1 root disk 8, 16 Sep 10 11:25 /dev/sdb
brw-rw---- 1 root disk 8, 17 Sep 10 11:25 /dev/sdb1
losetup /dev/loop0 myinitrd
mount /dev/loop0 /mnt/initrd/
cd /mnt/initrd/
mkdir mnt/usbstick
cd /mnt/initrd/dev
mknod sdb b 8 16
mknod sdb1 b 8 17
Code: Select all
#!/bin/sh
export PATH=/bin:/sbin
# Get cmdline from proc
mount -t proc proc /proc
CMDLINE=`cat /proc/cmdline`
umount /proc
loadkeys de-latin1
# Mount real root and change to it
sleep 1
mount -t vfat /dev/sdb1 /mnt/usbstick
cat /mnt/usbstick/root.key | cryptsetup luksOpen /dev/sda5 root
mount -t reiserfs /dev/mapper/root /root
cd /root
mkdir initrd
pivot_root . initrd
# Start init and flush ram device
exec chroot . /bin/sh <<- EOF >/dev/console 2>&1
umount initrd
rm -rf initrd
blockdev --flushbufs /dev/ram0
exec /sbin/init ${CMDLINE}
EOF
Code: Select all
#!/bin/sh
############################################
#script by Aszrael
#based von scripts by Reikinio and unixtroll
#feel free to copy/modify/whatever you like
############################################
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
dmesg -n 1
#function to halt the system
stop()
{
b=0
while [ "$b" = 0 ]
do
echo ""
echo "you are out"
sleep 60
## if you work with 2 luks-passwords (eg slot0: very long pw from usb-key and
## slot1: rather weak pw to be entered without usb-key) you might want to add
## some extra security against bruteforcing by replacing "sleep 60" with something like
## crypsetup -q luksDelKey root 1
## this will delete the key for your root-device in slot1
## BE CAREFULL - "-q" overrides any confirmation!!! - be SURE to have your
## masterkey in slot0 (and don't lose it :-)
done
}
#function to probe for USB-Stick
#calls all other functions
test()
{
if ! mount /dev/sda1 /mnt/keydisk>/dev/null 2>/dev/null
then
echo ""
echo "no usb-key present"
input
else
keydisk
fi
}
#function to enter pwd manually
#3 tries
input() #
{
c=3
z=" ..."
while [ "$c" != 0 ]
do
if ! cryptsetup luksOpen /dev/hda4 root 2>/dev/null # <- remove "2>/dev/null" for visible promt for your password
then
let c=$c-1
echo ""
echo $c $z
if [ "$c" = 0 ]
then
echo "... wrong pw"
stop
fi
else
mount /dev/mapper/root /root 2>/dev/null
break
fi
done
}
#function that reads keyfile from USB-Stick
keydisk()
{
if ! cryptsetup luksOpen --key-file=/mnt/keydisk/laptux.key /dev/hda4 root 2>/dev/null # <- change to match your USB-Device and keyfile
then
stop
else
mount /dev/mapper/root /root 2>/dev/null
umount /mnt/keydisk>/dev/null
fi
}
mount -t proc none /proc
CMDLINE=`cat /proc/cmdline`
sh devmap_mknod #<- call devmap_mknod-script - remove if not needed
umount -n /proc
loadkeys ./de.map.gz #<- german keymap (see howto)
cat ./ascii-skull #<- ascii-greeter
sleep 5 # <- wait for slow USB-Stick
test #<- start function test()
echo ""
echo "you are allowed in"
cd /root
mkdir initrd
pivot_root . initrd
# start init and flush ram device
exec chroot . /bin/sh <<- EOF >dev/console 2>&1
umount initrd
rm -rf initrd
blockdev --flushbufs /dev/ram0
exec /sbin/init ${CMDLINE}
EOF

can anyone help me?dd if=/dev/zero of=/dev/sdb bs=1024k count=5 conv=notrunc
mkfs -t vfat -I /dev/sdb
mount -t vfat /dev/sdb /mnt/usb
#coping vmlinux
#coping System.map
#coping initrd
syslinux /dev/sdb
sync