Tag: devices

C#

Enumerate System Devices

Enumerate system devices using C#. You have to add a reference to the System.Management component. ManagementObjectSearcher devices = new ManagementObjectSearcher("Select Name, Description, Status from Win32_PnPEntity");   if (devices != null) foreach (ManagementObject device in devices.Get()) { Console.WriteLine("> Device name: {0} Device Desc: {1} Device Status: {2}.rn", device.GetPropertyValue("Name").ToString(), device.GetPropertyValue("Description").ToString(), device.GetPropertyValue("Status").ToString()); }ManagementObjectSearcher devices = new ManagementObjectSearcher("Select Name, …

Python

Obtain devices list with Python and pcapy

Install pcapy sudo apt-get install python-pcapysudo apt-get install python-pcapy Code import pcapy   devs = pcapy.findalldevs();   for dev in devs: print devimport pcapy devs = pcapy.findalldevs(); for dev in devs: print dev Run sudo python mysniffer.pysudo python mysniffer.py Output eth0 usbmon1 usbmon2 usbmon3 usbmon4 usbmon5 any loeth0 usbmon1 usbmon2 usbmon3 usbmon4 usbmon5 any lo …

Linux

List USB devices in Linux

1. Open terminal 2. Issue the following command: lsusblsusb Other options: -v, –verbose Increase verbosity (show descriptors) -s [[bus]:][devnum] Show only devices with specified device and/or bus numbers (in decimal) -d vendor:[product] Show only devices with the specified vendor and product ID numbers (in hexadecimal) -D device Selects which device lsusb will examine -t Dump …

Backtrack, Tools

Discover other computers or devices on the network

1. Open your BackTrack VM. 2. Goto Applications->BackTrack->Information Gathering->Network Analysis->Identify Live Hosts->netdiscover 3. Execute the following command to scan the local network: netdiscover -i eth1 -r xxx.xxx.x.0/24netdiscover -i eth1 -r xxx.xxx.x.0/24 to get a response similar to this: Currently scanning: Finished! | Screen View: Unique Hosts   8 Captured ARP Req/Rep packets, from 5 hosts. …