You are not logged in.

#1 2020-10-11 09:39:34

Windslab
Banned
Registered: 2020-03-11
Posts: 72

Finding a USB port by the device Manufacturer

sudo dmesg | grep -i usb:

[    1.529489] ACPI: bus type USB registered
[    1.529920] usbcore: registered new interface driver usbfs
[    1.529928] usbcore: registered new interface driver hub
[    1.530212] usbcore: registered new device driver usb
[    2.298385] usbcore: registered new interface driver usbserial_generic
[    2.298397] usbserial: USB Serial support registered for generic
[    3.026500] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    3.039929] ehci-pci 0000:02:03.0: new USB bus registered, assigned bus number 1
[    3.053971] ehci-pci 0000:02:03.0: USB 2.0 started, EHCI 1.00
[    3.054393] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.08
[    3.054395] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.054398] usb usb1: Product: EHCI Host Controller
[    3.054399] usb usb1: Manufacturer: Linux 5.8.14-arch1-1 ehci_hcd
[    3.054400] usb usb1: SerialNumber: 0000:02:03.0
[    3.054934] hub 1-0:1.0: USB hub found
[    3.060448] uhci_hcd: USB Universal Host Controller Interface driver
[    3.061992] uhci_hcd 0000:02:00.0: new USB bus registered, assigned bus number 2
[    3.070288] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 5.08
[    3.070299] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.070301] usb usb2: Product: UHCI Host Controller
[    3.070303] usb usb2: Manufacturer: Linux 5.8.14-arch1-1 uhci_hcd
[    3.070303] usb usb2: SerialNumber: 0000:02:00.0
[    3.074791] hub 2-0:1.0: USB hub found
[    3.080982] xhci_hcd 0000:03:00.0: new USB bus registered, assigned bus number 3
[    3.083266] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.08
[    3.083267] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.083268] usb usb3: Product: xHCI Host Controller
[    3.083269] usb usb3: Manufacturer: Linux 5.8.14-arch1-1 xhci-hcd
[    3.083269] usb usb3: SerialNumber: 0000:03:00.0
[    3.083693] hub 3-0:1.0: USB hub found
[    3.084469] xhci_hcd 0000:03:00.0: new USB bus registered, assigned bus number 4
[    3.084471] xhci_hcd 0000:03:00.0: Host supports USB 3.1 Enhanced SuperSpeed
[    3.084725] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
[    3.084745] usb usb4: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.08
[    3.084746] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.084747] usb usb4: Product: xHCI Host Controller
[    3.084747] usb usb4: Manufacturer: Linux 5.8.14-arch1-1 xhci-hcd
[    3.084748] usb usb4: SerialNumber: 0000:03:00.0
[    3.085417] hub 4-0:1.0: USB hub found
[    3.413596] usb 3-1: new full-speed USB device number 2 using xhci_hcd
[    3.555683] usb 3-1: New USB device found, idVendor=0e0f, idProduct=0003, bcdDevice= 1.03
[    3.555684] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    3.555687] usb 3-1: Product: VMware Virtual USB Mouse
[    3.555688] usb 3-1: Manufacturer: VMware
[    3.560814] usbcore: registered new interface driver usbhid
[    3.560815] usbhid: USB HID core driver
[    3.562319] input: VMware VMware Virtual USB Mouse as /devices/pci0000:00/0000:00:15.0/0000:03:00.0/usb3/3-1/3-1:1.0/0003:0E0F:0003.0001/input/input3
[    3.562534] hid-generic 0003:0E0F:0003.0001: input,hidraw0: USB HID v1.10 Mouse [VMware VMware Virtual USB Mouse] on usb-0000:03:00.0-1/input0
[  689.327169] usb 3-3: new full-speed USB device number 3 using xhci_hcd
[  689.476101] usb 3-3: New USB device found, idVendor=0e0f, idProduct=0002, bcdDevice= 1.00
[  689.476109] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  689.476111] usb 3-3: Product: VMware Virtual USB Hub
[  689.476113] usb 3-3: Manufacturer: VMware, Inc.
[  689.478817] hub 3-3:1.0: USB hub found
[  689.747359] usb 3-4: new high-speed USB device number 4 using xhci_hcd
[  689.888929] usb 3-4: New USB device found, idVendor=0e0f, idProduct=0002, bcdDevice= 1.00
[  689.888960] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  689.888962] usb 3-4: Product: VMware Virtual USB Hub
[  689.888964] usb 3-4: Manufacturer: VMware, Inc.
[  689.890281] hub 3-4:1.0: USB hub found
[  690.364659] usb 3-2: new full-speed USB device number 5 using xhci_hcd
[  690.695216] usb 3-2: New USB device found, idVendor=9ac4, idProduct=4b8f, bcdDevice= 1.00
[  690.695222] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  690.695225] usb 3-2: Product: proxmark3
[  690.695227] usb 3-2: Manufacturer: proxmark.org
[  690.695227] usb 3-2: SerialNumber: iceman
[  690.750693] cdc_acm 3-2:1.0: ttyACM0: USB ACM device
[  690.752569] usbcore: registered new interface driver cdc_acm
[  690.752570] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

For me interesting:

[  690.695227] usb 3-2: Manufacturer: proxmark.org
[  690.695227] usb 3-2: SerialNumber: iceman
[  690.750693] cdc_acm 3-2:1.0: ttyACM0: USB ACM device

In my case port is:

ttyACM0:

How i can get USB port in to variable for using it in my other script for lunching?
In other machines these can be ttyACM0/1/2 or other.

Lunch command:

./proxmark3 /dev/ttyACM0

Offline

#2 2020-10-11 11:26:16

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 995
Website

Re: Finding a USB port by the device Manufacturer

Well, grep for "cdc_acm" and "ttyACM" and use cut, awk or the likes to filter out the relevant part. The respective man pages are your friend.
By the way: It's "launch". I just had lunch. scnr.

Last edited by schard (2020-10-11 11:26:55)

Offline

#3 2020-10-11 11:36:19

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 10,027
Website

Re: Finding a USB port by the device Manufacturer

Please post the full dmesg output, not just the lines that mention USB.

dmesg|& curl -F 'f:1=<-' ix.io 

Sakura:-
Mobo: MSI X299 TOMAHAWK ARCTIC // Processor: Intel Core i7-7820X 3.6GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 5x 1TB HDD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2020-10-11 12:01:34

Windslab
Banned
Registered: 2020-03-11
Posts: 72

Re: Finding a USB port by the device Manufacturer

WorMzy wrote:

Please post the full dmesg output, not just the lines that mention USB.

dmesg|& curl -F 'f:1=<-' ix.io 

Please find data by using this link:
http://ix.io/2AnM

Offline

#5 2020-10-11 12:01:57

solskog
Member
Registered: 2020-09-05
Posts: 247

Re: Finding a USB port by the device Manufacturer

The proxmark usb device will be detected by systemd-udevd service, you can use $env{DEVNAME} variabe to cache the name, in your case /dev/ttyACM0. Write a udev.rule to trigger the script ./proxmark3 maybe is a better way to do it?

Offline

#6 2020-10-11 12:59:44

Windslab
Banned
Registered: 2020-03-11
Posts: 72

Re: Finding a USB port by the device Manufacturer

solskog wrote:

The proxmark usb device will be detected by systemd-udevd service, you can use $env{DEVNAME} variabe to cache the name, in your case /dev/ttyACM0. Write a udev.rule to trigger the script ./proxmark3 maybe is a better way to do it?

As I have understood this is different way for fixation ttyACM0 for devace ID. Not make sure, becouse each device have different ID. Manufacter is the same always Manufacturer: proxmark.org

But if your solution better please write how create a rule. This my layoout from:

udevadm info --attribute-walk --path=$(udevadm info --query=path --name=/dev/ttyACM0) | & curl -F 'f:1=<-' ix.io

http://ix.io/2Aoa

Offline

#7 2020-10-11 13:29:53

solskog
Member
Registered: 2020-09-05
Posts: 247

Re: Finding a USB port by the device Manufacturer

I would use this to catch "DEVNAME" when plugin proxymark usb device.

udevadm monitor --environment --udev

and example proxmark.rule, you may need change/add to it.

ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="9ac4", ATTRS{idProduct}=="4b8f", RUN+="./proxmark3 $env{DEVNAME}"

Last edited by solskog (2020-10-11 13:31:43)

Offline

#8 2020-10-11 14:41:12

Windslab
Banned
Registered: 2020-03-11
Posts: 72

Re: Finding a USB port by the device Manufacturer

solskog wrote:

I would use this to catch "DEVNAME" when plugin proxymark usb device.

udevadm monitor --environment --udev

and example proxmark.rule, you may need change/add to it.

ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="9ac4", ATTRS{idProduct}=="4b8f", RUN+="./proxmark3 $env{DEVNAME}"

Okay what I need to do?

cd /etc/udev/rules.d/
sh -c 'printf "ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="9ac4", ATTRS{idProduct}=="4b8f", RUN+="./proxmark3 $env{DEVNAME}"" > proxmark.rule'

If I need to do

cd ~/proxmark3/client

before this one:

./proxmark3 $env{DEVNAME}

Last edited by Windslab (2020-10-11 14:41:29)

Offline

#9 2020-10-11 15:15:16

Windslab
Banned
Registered: 2020-03-11
Posts: 72

Re: Finding a USB port by the device Manufacturer

No not working at all. And ATTRS{idProduct}=="4b8f" can be different on antoher device.

Better to grep usb port. Do any bodey know how this to do?

@WorMzy maybe you know how this to do? I gave to you full debug of my system as you wrote.

Last edited by Windslab (2020-10-11 15:17:53)

Offline

#10 2020-10-11 16:15:31

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 24,454
Website

Re: Finding a USB port by the device Manufacturer

dmesg | grep -om1 ttyACM.

And stop using sudo for no reason.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#11 2020-10-11 16:43:06

Windslab
Banned
Registered: 2020-03-11
Posts: 72

Re: Finding a USB port by the device Manufacturer

Trilby wrote:
dmesg | grep -om1 ttyACM.

And stop using sudo for no reason.

Wow thanks! It's works perfect smile

Do you have good guide for Grep?

Last edited by Windslab (2020-10-11 16:43:14)

Offline

#12 2020-10-11 17:26:25

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 24,454
Website

Re: Finding a USB port by the device Manufacturer

man grep


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

Board footer

Powered by FluxBB