peass-ng / PEASS-ng

PEASS - Privilege Escalation Awesome Scripts SUITE (with colors)
https://book.hacktricks.xyz
Other
15.75k stars 3.06k forks source link

List Block Devices #23

Closed ghost closed 4 years ago

ghost commented 4 years ago

Do you think listing block devices would be useful? lsblk

carlospolop commented 4 years ago

Hi @unKn0wnUser453,

That information looks interesting but linpeas is already executing df -h which shows very similar information. Which advantages do you see to the use of lsblk instead of/in conjunction with df -h?

ghost commented 4 years ago

df -h Filesystem Size Used Avail Use% Mounted on udev 954M 0 954M 0% /dev tmpfs 197M 11M 187M 6% /run /dev/sda2 15G 4.2G 9.9G 30% / tmpfs 985M 0 985M 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 985M 0 985M 0% /sys/fs/cgroup /dev/loop2 55M 55M 0 100% /snap/lxd/10756 /dev/loop1 67M 67M 0 100% /snap/lxd/9239 /dev/loop4 55M 55M 0 100% /snap/lxd/12631 /dev/loop0 90M 90M 0 100% /snap/core/8268 /dev/loop3 90M 90M 0 100% /snap/core/8039 /dev/sdb1 487M 2.3M 456M 1% /root /dev/sda4 992M 25M 850M 3% /home /dev/sda3 976M 148M 762M 17% /boot overlay 15G 4.2G 9.9G 30% /var/lib/docker/overlay2/7f71470684f0bd04336e5e345dde41c27a0ae531132eac5ebc1f7dd8646bc84c/merged shm 64M 0 64M 0% /var/lib/docker/containers/ef468ee5729af69648c81ef75993f23d7a8e8008984fbad9dc72641482e17b0c/mounts/shm

lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 0 89.1M 1 loop /snap/core/8268 loop1 7:1 0 66.7M 1 loop /snap/lxd/9239 loop2 7:2 0 54.2M 1 loop /snap/lxd/10756 loop3 7:3 0 89.1M 1 loop /snap/core/8039 loop4 7:4 0 54.9M 1 loop /snap/lxd/12631 sda 8:0 0 25G 0 disk ├─sda1 8:1 0 1M 0 part ├─sda2 8:2 0 16G 0 part / ├─sda3 8:3 0 1G 0 part /boot └─sda4 8:4 0 2G 0 part /home sdb 8:16 0 512M 0 disk └─sdb1 8:17 0 511M 0 part /root sr0 11:0 1 1024M 0 rom

df looks at the filesystem, lsblk at the partition Is it helpful including both? Looks like df has more info, but I like the tree layout of lsblk

carlospolop commented 4 years ago

This looks interesting but from the point of view of security/hardening I think that it's enough to use df -h or lsblk, but not both. I'm going to update linpeas so if the dh binary is not found it tries to execute lsblk.

Thank you.