Читать книгу Kali Linux Penetration Testing Bible - Gus Khawaja - Страница 52
Linux Hardware Information
ОглавлениеFrom time to time, you will probably use special commands related to your PC or VM hardware.
To get the CPU information of your Linux host, you need to open /proc/cpuinfo
:
root@kali:/# cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 158 model name : Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz stepping : 10 microcode : 0xd6 cpu MHz : 3192.001 cache size : 12288 KB […]
To get the RAM information of your Kali host, then you will need to open the configuration file /proc/meminfo
:
root@kali:/# cat /proc/meminfo MemTotal: 8676820 kB MemFree: 6183876 kB MemAvailable: 7781928 kB Buffers: 55444 kB Cached: 1739668 kB SwapCached: 0 kB […]
To display the attached devices (e.g., disk drives, partitions, etc.), then you have a choice of two commands: either fdisk
(which displays more information) or lsblk
:
$fdisk -l root@kali:/# fdisk -l Disk /dev/sda: 80 GiB, 85899345920 bytes, 167772160 sectors Disk model: VMware Virtual S Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x4a6f3195 Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 163579903 163577856 78G 83 Linux /dev/sda2 163581950 167770111 4188162 2G 5 Extended /dev/sda5 163581952 167770111 4188160 2G 82 Linux swap / Solaris $lsblk root@kali:/# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 80G 0 disk ⌙sda1 8:1 0 78G 0 part / ⌙sda2 8:2 0 1K 0 part ⌙sda5 8:5 0 2G 0 part [SWAP] sr0 11:0 1 1024M 0 rom
To display the list of USB devices (e.g., mouse, keyboard, USB stick, etc.), then you have to execute the lsusb
command:
$lsusb root@kali:/# lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 004: ID 0e0f:0008 VMware, Inc. VMware Virtual USB Mouse Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
To display all the mounted directories into the file system, then you will need to execute the mount
command:
$mount root@kali:/# mount sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) udev on /dev type devtmpfs (rw,nosuid,noexec,relatime,size=4308020k,nr_inodes=1077005,mode=755) […]