new: hid.inject now supports non visible devices (talking directly to the dongle) via the hid.force.type parameter

This commit is contained in:
evilsocket 2019-03-09 11:16:18 +01:00
commit d8d208ae17
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
4 changed files with 58 additions and 10 deletions

View file

@ -5,6 +5,7 @@ package hid
import (
"fmt"
"strings"
"sync"
"time"
@ -29,6 +30,7 @@ type HIDRecon struct {
writeLock *sync.Mutex
sniffAddrRaw []byte
sniffAddr string
sniffType string
pingPayload []byte
inSniffMode bool
inPromMode bool
@ -121,6 +123,13 @@ func NewHIDRecon(s *session.Session) *HIDRecon {
"500",
"Time in milliseconds to automatically sniff payloads from a device, once it's detected, in order to determine its type."))
builders := availBuilders()
mod.AddParam(session.NewStringParameter("hid.force.type",
"logitech",
fmt.Sprintf("(%s)", strings.Join(builders, "|")),
fmt.Sprintf("If the device is not visible or its type has not being detected, force the device type to this value. Accepted values: %s", strings.Join(builders, ", "))))
mod.parser = DuckyParser{mod}
mod.selector = utils.ViewSelectorFor(&mod.SessionModule, "hid.show", []string{"mac", "seen"}, "mac desc")