View Issue Details

IDProjectCategoryView StatusLast Update
0004781Kali LinuxGeneral Bugpublic2018-07-17 22:20
Reporterccmcdee Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version2018.2 
Summary0004781: Setting root password on live-usb-persistence is not respected across boots
Description

While using Live-USB-Persistence mode, I've set several features including:

a new root-user password
adding an unprivileged user account & password
adding a few packages such as irssi, firefox-dev
changing wallpaper to solid color

All features persist across boot except:
persistent root-user password

This is a Live lxde install in persistence-mode

Steps To Reproduce

1) create usb-persistence from forensics live mode using the following steps:

open fdisk and create /dev/sdb3 using remaining disk. set at primary (p). it will create the proper size.

write the changes for new partition (w), fdisk will exit normally.

follow https://docs.kali.org/downloading/kali-linux-live-usb-persistence from step 3 - 4
#mkfs.ext4 -L persistence /dev/sdb3
#e2lable /dev/sdb3 persistence

#mkdir -p /mnt/my_usb
#mount /dev/sdb3 /mnt/my_usb
#echo "/ union" > /mnt/my_usb/persistence.conf
#umount /dev/sdb3
Additional Information

root@kali:~/Documents# df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 1479720 0 1479720 0% /dev
tmpfs 300680 4920 295760 2% /run
/dev/sdb1 2709088 2709088 0 100% /lib/live/mount/persistence/sdb1
/dev/loop0 2459776 2459776 0 100% /lib/live/mount/rootfs/filesystem.squashfs
tmpfs 1503396 0 1503396 0% /lib/live/mount/overlay
/dev/sdb3 27978836 5591512 20943024 22% /lib/live/mount/persistence/sdb3
overlay 27978836 5591512 20943024 22% /
tmpfs 1503396 14584 1488812 1% /dev/shm
tmpfs 5120 0 5120 0% /run/lock
tmpfs 1503396 0 1503396 0% /sys/fs/cgroup
tmpfs 1503396 4 1503392 1% /tmp
tmpfs 300676 16 300660 1% /run/user/0
/dev/sdb2 684 658 26 97% /media/root/Kali Live

root@kali:~/Documents# dmesg |grep 'persistence'
[ 0.000000] Command line: BOOT_IMAGE=/live/vmlinuz boot=live noconfig=sudo username=root hostname=kali persistence initrd=/live/initrd.img
[ 0.000000] Kernel command line: BOOT_IMAGE=/live/vmlinuz boot=live noconfig=sudo username=root hostname=kali persistence initrd=/live/initrd.img
[ 77.960170] systemd[1]: Unnecessary job for USB_Flash_Drive persistence was removed.

root@kali:~/Documents# cat /etc/shadow
root:X014elvznJq7E:17682:0:99999:7:::

domhnall:$6$s3TBZfzz$2/Y2W1UxZJH.uDZaLRwkjAPPHxYyRz0vHgztgj4SyvT6gqulWrmiCMlHZgGEizVKDxlKVxkdHDSGwmC.FLswe.:17682:0:99999:7:::

================================================================================
root@kali:~/Documents# uname -rms
Linux 4.15.0-kali2-amd64 x86_64

root@kali:~/Documents# uname -a
Linux kali 4.15.0-kali2-amd64 0000001 SMP Debian 4.15.11-1kali1 (2018-03-21) x86_64 GNU/Linux

Attached Files

Activities

ccmcdee

ccmcdee

2018-05-31 22:52

reporter   ~0009193

uploaded file reflects before changing password, then changing password, then rebooting.

rootpw.txt (923 bytes)   
root@kali:~/Documents# cat /etc/shadow

root:X014elvznJq7E:17682:0:99999:7:::
domhnall:$6$s3TBZfzz$2/Y2W1UxZJH.uDZaLRwkjAPPHxYyRz0vHgztgj4SyvT6gqulWrmiCMlHZgGEizVKDxlKVxkdHDSGwmC.FLswe.:17682:0:99999:7:::

root@kali:~/Documents# date
Thu May 31 18:19:36 EDT 2018




root@kali:~/Documents# passwd
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

root@kali:~/Documents# cat /etc/shadow

root:$6$uhatBVfR$a7ZtAYLVCWcTrxUc2y20SwI8KTjgrU.vPTnl16aK.YIBQcK4BmEYs5b5DnO.UzY.3mM5nmmHpNOsgZuHJ0a6H.:17682:0:99999:7:::
domhnall:$6$s3TBZfzz$2/Y2W1UxZJH.uDZaLRwkjAPPHxYyRz0vHgztgj4SyvT6gqulWrmiCMlHZgGEizVKDxlKVxkdHDSGwmC.FLswe.:17682:0:99999:7:::

root@kali:~/Documents# date
Thu May 31 18:20:09 EDT 2018

=====================REBOOT=======================================

root@kali:~# cat /etc/shadow
root:X014elvznJq7E:17682:0:99999:7:::

root@kali:~# date
Thu May 31 18:49:48 EDT 2018

rootpw.txt (923 bytes)   
ccmcdee

ccmcdee

2018-06-01 18:14

reporter   ~0009196

domhnall@kali:/var/log/live$ cat boot.log

Begin: Running /scripts/live-realpremount ... done.
Begin: Mounting "/live/medium/live/filesystem.squashfs" on "//filesystem.squashfs" via "/dev/loop0" ... done.
mount: mounting /dev/sda10 on /live/persistence/sda10 failed: No such device
mount: mounting /dev/sda11 on /live/persistence/sda11 failed: No such device
mount: mounting /dev/sda12 on /live/persistence/sda12 failed: No such device
mount: mounting /dev/sda13 on /live/persistence/sda13 failed: No such device
mount: mounting /dev/sda14 on /live/persistence/sda14 failed: No such device
mount: mounting /dev/sda4 on /live/persistence/sda4 failed: No such device
mount: mounting /dev/sda5 on /live/persistence/sda5 failed: No such device
mount: mounting /dev/sda6 on /live/persistence/sda6 failed: No such device
mount: mounting /dev/sda7 on /live/persistence/sda7 failed: No such device
mount: mounting /dev/sda8 on /live/persistence/sda8 failed: No such device
mount: mounting /dev/sda9 on /live/persistence/sda9 failed: No such device
mount: mounting /dev/sda on /live/persistence/sda failed: No such device
mount: mounting /dev/sdb on /live/persistence/sdb failed: Device or resource busy
mount: mounting /dev/sr0 on /live/persistence/sr0 failed: No such device
mkdir: can't create directory '/live/persistence/sdb3/rw': File exists
mkdir: can't create directory '/live/persistence/sdb3/work': File exists
done.
Begin: Configuring fstab ... done.
Begin: Preconfiguring networking ... done.

ccmcdee

ccmcdee

2018-07-13 22:28

reporter   ~0009359

1) create usb-persistence from forensics live mode using the following steps:

(forgot to mention this step in replication box.. it was the first command I ran in all this.)
run end=Ngb # obviously N represents an integer value i.e 7.

open fdisk and create /dev/sdb3 using remaining disk. set at primary (p). it will create the proper size.

write the changes for new partition (w), fdisk will exit normally.

follow https://docs.kali.org/downloading/kali-linux-live-usb-persistence from step 3 - 4
#mkfs.ext4 -L persistence /dev/sdb3
#e2lable /dev/sdb3 persistence

#mkdir -p /mnt/my_usb
#mount /dev/sdb3 /mnt/my_usb
#echo "/ union" > /mnt/my_usb/persistence.conf
#umount /dev/sdb3
russm

russm

2018-07-14 05:42

reporter   ~0009360

Kali live boot unconditionally forces the root password to "toor". You should be able to get the behaviour you want by deleting /usr/lib/live/config/0031-root-password, changing the root password, and then rebooting.

elwood

elwood

2018-07-17 22:20

administrator   ~0009371

Comment 0009360 is correct.

This issue is discussed extensively on the kali forum (https://forums.kali.org/showthread.php?1890-Live-persistence-install-on-bootable-USB-not-saving-root-password-change). I suggest checking the forum first for issues like this.

Issue History

Date Modified Username Field Change
2018-05-31 21:24 ccmcdee New Issue
2018-05-31 22:52 ccmcdee File Added: rootpw.txt
2018-05-31 22:52 ccmcdee Note Added: 0009193
2018-06-01 18:14 ccmcdee Note Added: 0009196
2018-07-13 22:28 ccmcdee Note Added: 0009359
2018-07-14 05:42 russm Note Added: 0009360
2018-07-17 22:20 elwood Status new => closed
2018-07-17 22:20 elwood Resolution open => no change required
2018-07-17 22:20 elwood Note Added: 0009371