Basic commands for hardware
**QUICK**
Code:
lspci; lsusb; dmesg; lsmod
lspci (man page)
List all PCI devices (e.g. Internal devices).
Code:
root@kali:~# lspci
00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)
00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
00:07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10)
00:0f.0 VGA compatible controller: VMware SVGA II Adapter
00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01)
00:11.0 PCI bridge: VMware PCI bridge (rev 02)
00:15.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.4 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.5 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.6 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.7 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.4 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.5 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.6 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.7 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.4 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.5 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.6 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.7 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.4 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.5 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.6 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.7 PCI bridge: VMware PCI Express Root Port (rev 01)
02:00.0 USB controller: VMware USB1.1 UHCI Controller
02:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 10)
02:02.0 Multimedia audio controller: Ensoniq ES1371 [AudioPCI-97] (rev 02)
02:03.0 USB controller: VMware USB2 EHCI Controller
02:05.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 10)
root@kali:~#
lsusb (man page)
List all USB devices (e.g. External devices).
Code:
root@kali:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
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
root@kali:~#
dmesg (man page)
Displays the contents of the kernel buffer (Whats in the kernel log).
Note: Warning, this may produce a very large output
Code:
root@kali:~# dmesg
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.12-kali1-686-pae ([email protected]) (gcc version 4.7.2 (Debian 4.7.2-5) ) #1 SMP Debian 3.12.6-2kali1 (2014-01-06)
[ 0.000000] Disabled fast string operations
...snip...
[ 3.367400] EXT4-fs (sda1): re-mounted. Opts: (null)
[ 3.407412] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro
[ 3.499360] loop: module loaded
[ 4.180582] Netfilter messages via NETLINK v0.30.
[ 4.350865] pcnet32 0000:02:01.0 eth0: link up
[ 5.224520] pcnet32 0000:02:05.0 eth1: link up
[ 7.826665] [drm] width 1024
[ 7.826704] [drm] height 768
[ 7.826716] [drm] bpp 32
[ 7.826771] [drm] Fifo max 0x00200000 min 0x00001000 cap 0x0000077f
[ 7.843755] [drm] width 1024
[ 7.843764] [drm] height 768
[ 7.843771] [drm] bpp 32
[ 7.843827] [drm] Fifo max 0x00200000 min 0x00001000 cap 0x0000077f
[ 187.769500] sda1: WRITE SAME failed. Manually zeroing.
root@kali:~#
lsmod (man page)
Displays the status of modules in the Linux Kernel (e.g. what drivers have been loaded)
Code:
root@kali:~# lsmod
Module Size Used by
nfnetlink_log 17065 0
nfnetlink 12853 1 nfnetlink_log
binfmt_misc 12733 1
loop 21962 0
dm_crypt 22008 0
hid_generic 12369 0
usbhid 39684 0
hid 80998 2 hid_generic,usbhid
vmw_balloon 12502 0
psmouse 76538 0
serio_raw 12737 0
coretemp 12734 0
evdev 17172 4
parport_pc 25991 0
parport 35171 1 parport_pc
processor 27662 0
battery 12949 0
ac 12588 0
thermal_sys 22960 1 processor
snd_ens1371 22679 2
snd_ac97_codec 96188 1 snd_ens1371
snd_rawmidi 22278 1 snd_ens1371
snd_seq_device 12980 1 snd_rawmidi
snd_pcm 69436 2 snd_ac97_codec,snd_ens1371
snd_page_alloc 12882 1 snd_pcm
snd_timer 22002 1 snd_pcm
vmwgfx 109623 1
snd 50767 10 snd_ac97_codec,snd_timer,snd_pcm,snd_rawmidi,snd_ens1371,snd_seq_device
soundcore 12890 1 snd
button 12824 0
ac97_bus 12462 1 snd_ac97_codec
gameport 13316 1 snd_ens1371
ttm 55536 1 vmwgfx
drm 198264 3 ttm,vmwgfx
i2c_piix4 12592 0
i2c_core 23371 2 drm,i2c_piix4
shpchp 30673 0
vmw_vmci 54642 0
ext4 442562 1
crc16 12327 1 ext4
mbcache 12938 1 ext4
jbd2 73110 1 ext4
dm_mod 78673 1 dm_crypt
sr_mod 21563 0
cdrom 34540 1 sr_mod
sg 25628 0
ata_generic 12450 0
sd_mod 43598 3
crct10dif_generic 12517 1
crc_t10dif 12399 1 sd_mod
crct10dif_common 12340 2 crct10dif_generic,crc_t10dif
crc32_pclmul 12809 0
crc32c_intel 12659 0
aesni_intel 17934 0
aes_i586 16647 1 aesni_intel
xts 12583 1 aesni_intel
lrw 12645 1 aesni_intel
gf128mul 12834 2 lrw,xts
ablk_helper 12508 1 aesni_intel
cryptd 14160 1 ablk_helper
floppy 51966 0
ehci_pci 12432 0
uhci_hcd 26356 0
ehci_hcd 43677 1 ehci_pci
pcnet32 34875 0
usbcore 137931 4 uhci_hcd,ehci_hcd,ehci_pci,usbhid
mii 12595 1 pcnet32
usb_common 12408 1 usbcore
ata_piix 29336 0
libata 153595 2 ata_generic,ata_piix
mptspi 21663 2
scsi_transport_spi 23201 1 mptspi
mptscsih 22262 1 mptspi
mptbase 68288 2 mptspi,mptscsih
scsi_mod 151284 7 sg,scsi_transport_spi,libata,mptspi,sd_mod,sr_mod,mptscsih
root@kali:~#