Wednesday, September 27, 2006

hacking usb device drivers->part 1

This is the first article from “Hacking USB device drivers” series. In this part briefly review of one very simple hack: adding missed vendor and product IDs for USB drivers.

  • Adding vendor and product IDs for USB drivers
    • Introduction
    • Changing USB IDs database
    • Result
  • Adding support for new devices to USB drivers (read)

Adding vendor and product IDs for USB drivers

Introduction
I have USB Bluetooth adapter and after plugging this device i got the following new strings in dmesg:
ubt0 at uhub2 port 2 configuration 1 interface 0
ubt0: vendor 0x1131 ISSCBTA, rev 1.10/3.73, addr 2
That’s mean: driver ubt(4) support this device, but vendor and product IDs not present in /usr/src/sys/dev/usb/usbdevs file. Let’s fix it!

Changing USB IDs database
Add the following lines to /usr/src/sys/dev/usb/usbdevs file:
vendor ISSC 0x1131 Integrated System Solution Corp.
...
/* ISSC products */
product ISSC ISSCBTA 0x1001 KY-BT100
Vendor ID must be placed to beginning of file, after vendor with lesser ID. Product IDs must be written in alphabetical order of vendor string. This patch illustrate this rule. And, finally, run make in /usr/src/sys/dev/usb directory for updating usbdevs.h and usbdevs_data.h files.

Result
Now you can build new kernel. Reboot, attach the device and run dmesg. Here is what you finally got:
ubt0 at uhub2 port 2 configuration 1 interface 0
ubt0: Integrated System Solution Corp. KY-BT100, rev 1.10/3.73, addr 2

Friday, September 8, 2006

scan with netcat

nc(1) can be used for simple and fast network scan. Here is sample of localhost scan (ports range: 1-1024).

$ nc -v -z 127.0.0.1 1-1024
localhost [127.0.0.1] 80 (www) open
localhost [127.0.0.1] 25 (smtp) open
localhost [127.0.0.1] 22 (ssh) open

Thursday, September 7, 2006

secure surfing from public place

Use OpenSSH port forwarding to browse web from public place.
ssh(1) can act as a SOCKS server. SOCKS4 and SOCKS5 protocols are supported. All you need is shell access to remote machine.
Example:

ssh -D 4545 user@IP
Now you can specify “localhost” as SOCKS host and “4545” as SOCKS port in connections settings of your browser.

security engineering - the book

Available online now for downloading by chapters.
Security Engineering: A Guide to Building Dependable Distributed Systems