1
0
mirror of https://github.com/bettercap/bettercap.git synced 2025-03-12 04:36:03 -07:00

added frame retransmission for hid.inject

This commit is contained in:
evilsocket 2019-02-21 15:23:49 +01:00
parent 7c68c138e5
commit 8884cb4a18
No known key found for this signature in database
GPG Key ID: 1564D7F30393A456

@ -110,8 +110,16 @@ func (mod *HIDRecon) doInjection() {
for i, cmd := range cmds {
for j, frame := range cmd.Frames {
if err := mod.dongle.TransmitPayload(frame.Data, 500, 3); err != nil {
mod.Warning("error sending frame #%d of HID command #%d: %v", j, i, err)
for attempt := 0; attempt < 3; attempt++ {
if err := mod.dongle.TransmitPayload(frame.Data, 500, 1); err != nil {
if attempt < 2 {
mod.Warning("error sending frame #%d of HID command #%d: %v, retrying ...", j, i, err)
} else {
mod.Error("error sending frame #%d of HID command #%d: %v", j, i, err)
}
} else {
break
}
}
if frame.Delay > 0 {