pith. machine review for the scientific record. sign in

arxiv: 2604.15845 · v1 · submitted 2026-04-17 · 💻 cs.CR

Recognition: unknown

QUACK! Making the (Rubber) Ducky Talk: A Systematic Study of Keystroke Dynamics for HID Injection Detection

Alessandro Lotto, Francesco Marchiori, Mauro Conti

Authors on Pith no claims yet

Pith reviewed 2026-05-10 08:12 UTC · model grok-4.3

classification 💻 cs.CR
keywords keystroke dynamicsHID injection detectiontiming featuresprivacy-preserving detectionUSB attacksmachine learning classificationhuman vs machine discrimination
0
0 comments X

The pith

Keystroke timing patterns alone enable robust detection of automated HID injection attacks without accessing typed content or building user profiles.

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

The paper sets out to show that timing information from keystrokes can separate human typing from machine-generated sequences produced by USB injection tools. This matters because current defenses rely on weak checks like overall speed that attackers can bypass with simple randomization, while stronger alternatives often require reading the actual input and raise privacy problems. By testing multiple research questions on real and generated data, the work finds that lightweight models trained only on timing succeed when exposed to varied attack strategies rather than when made more complex. It also maps out how many keystrokes are needed before detection becomes reliable, giving concrete guidance on early interception.

Core claim

Through a systematic study guided by five research questions, we characterize keystroke dynamics for distinguishing human input from machine-generated HID injections. We demonstrate that lightweight models relying only on timing features achieve robust detection, independent of user identity. Our findings indicate that robustness stems from exposure to diverse attack generation strategies rather than model complexity, and we identify optimal sequence lengths for balancing detection speed and reliability.

What carries the argument

Lightweight machine learning classifiers that use only inter-keystroke timing intervals to perform human-versus-automated discrimination on HID input streams.

If this is right

  • Detection performance improves more from training on structurally different attack generators than from increasing model size or complexity.
  • Reliable classification becomes practical after only a modest number of keystrokes, allowing early intervention before an attack sequence completes.
  • Simple speed or regularity heuristics are insufficient because they can be evaded, whereas timing-based models resist basic randomization.
  • No user-specific profiles or inspection of actual keystroke content is required, removing major privacy and deployment barriers.

Where Pith is reading between the lines

These are editorial extensions of the paper, not claims the author makes directly.

  • Operating systems could incorporate these timing checks at the input driver level to block physical-access USB attacks by default.
  • The same timing-only approach might extend to other automated input vectors such as scripted mouse movements or touch events.
  • Organizations could add the detection layer to existing security monitoring without new consent or data-retention obligations.

Load-bearing premise

Human keystroke timing distributions stay distinct enough from machine-generated ones even when attackers apply sophisticated randomization, and models trained on known strategies will still work against new ones.

What would settle it

A new attack generator that produces keystroke timing sequences matching the statistical distribution of human typists on previously unseen input lengths, causing the trained timing models to classify them as human at high rates.

Figures

Figures reproduced from arXiv: 2604.15845 by Alessandro Lotto, Francesco Marchiori, Mauro Conti.

Figure 1
Figure 1. Figure 1: System and Threat model. The attacker injects synthetic malicious keystrokes [PITH_FULL_IMAGE:figures/full_fig_p007_1.png] view at source ↗
Figure 2
Figure 2. Figure 2: Implemented methodology pipeline. family includes several synthetic datasets built from different keystroke generators that implement different approaches within the same attacker model. This diversity enables fine-grained evaluation of detector sensitivity to specific generation strategies. For each human session, we produce a synthetic session preserving the original VK sequence while synthetically gener… view at source ↗
Figure 3
Figure 3. Figure 3: ROC-AUC training curve on the Naive Dataset. [PITH_FULL_IMAGE:figures/full_fig_p012_3.png] view at source ↗
Figure 4
Figure 4. Figure 4: ROC-AUC training curve on the Statistical Dataset. [PITH_FULL_IMAGE:figures/full_fig_p012_4.png] view at source ↗
Figure 5
Figure 5. Figure 5: ROC-AUC training curve on the Adaptive Dataset. [PITH_FULL_IMAGE:figures/full_fig_p013_5.png] view at source ↗
Figure 6
Figure 6. Figure 6: Single-Generator training results for RF detector with 70 keystrokes. [PITH_FULL_IMAGE:figures/full_fig_p014_6.png] view at source ↗
Figure 7
Figure 7. Figure 7: Mixed-Generators training evaluation results. [PITH_FULL_IMAGE:figures/full_fig_p015_7.png] view at source ↗
Figure 8
Figure 8. Figure 8: ROC-AUC vs keystroke size for balanced configurations, RF detector. [PITH_FULL_IMAGE:figures/full_fig_p016_8.png] view at source ↗
Figure 9
Figure 9. Figure 9: ROC-AUC vs keystroke size for unbalanced configurations, RF detector. [PITH_FULL_IMAGE:figures/full_fig_p016_9.png] view at source ↗
Figure 10
Figure 10. Figure 10: RF detector inference cost analysis. 6 Discussion and Takeaways In this section, we discuss the results obtained from our evaluation and provide answers (A1-A5) to the identified RQs (RQ1 - RQ5). RQ1 – Lightweight and privacy-preserving keystroke injection detection. Our methodology explicitly excludes VKs as input to the detector during training and evaluation. Instead, synthetic keystroke detection reli… view at source ↗
read the original abstract

Modern computing systems inherently trust human input devices, creating an exploitable attack surface for adversarial automation. USB Human Interface Device (HID) emulation attacks, such as those enabled by the USB Rubber Ducky, exploit this assumption to inject arbitrary keystroke sequences while bypassing traditional defenses. Existing countermeasures rely on simple heuristics based on typing speed or timing regularity, which can be easily evaded through basic randomization. Keystroke dynamics analysis offers a more robust alternative by modeling temporal typing behavior. However, prior work frames this problem as behavioral authentication, verifying whether input originates from a specific user rather than detecting automated injection. An alternative approach is continuous monitoring via keylogging integrated with intrusion detection systems, but this requires access to input content, raising significant privacy concerns. In this paper, we provide the first systematic characterization of keystroke dynamics for human-vs-machine discrimination, independent of user identity. Guided by five research questions, we show that robust, privacy-preserving detection is achievable using lightweight models operating solely on timing features, eliminating the need for content access or user profiling. Our analysis reveals that attacker sophistication does not monotonically translate into improved evasion. Instead, robustness depends on exposure to structurally diverse generation strategies rather than increased model complexity. Finally, we quantify the trade-off between detection timeliness and reliability across varying keystroke sequence lengths, identifying practical operating points for early and effective attack interception.

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, simulated authors' rebuttal, and a circularity audit. Tearing a paper down is the easy half of reading it; the pith above is the substance, this is the friction.

Referee Report

2 major / 2 minor

Summary. The paper provides the first systematic characterization of keystroke timing dynamics for distinguishing human typing from automated HID injection attacks (e.g., USB Rubber Ducky), independent of user identity or content. Guided by five research questions, it evaluates timing features for privacy-preserving detection using lightweight models, examines how attacker randomization and sophistication affect evasion, and quantifies the timeliness-reliability trade-off across keystroke sequence lengths. The central claims are that robust detection is achievable without content access or profiling, that robustness depends more on exposure to diverse generation strategies than model complexity, and that attacker sophistication does not monotonically improve evasion.

Significance. If the empirical results hold, the work offers a practical advance in defending against HID emulation attacks by demonstrating effective, lightweight, content-agnostic detection based solely on timing features. The systematic framing via five RQs, the counterintuitive finding on attacker sophistication, and the analysis of sequence-length trade-offs provide actionable insights for IDS design. Strengths include the focus on reproducible timing-based models and explicit privacy benefits over keylogging approaches.

major comments (2)
  1. [Section 4] Section 4 and RQ results: performance is shown only on the fixed corpus of Rubber Ducky variants plus the studied randomization heuristics. The headline claim of robustness to any future adaptive attacker requires either a covering argument that these strategies span the space of possible inter-keystroke timing distributions or an explicit limitation statement; without it, generalization rests on empirical coverage alone.
  2. [Research Questions and Evaluation] Methodology and datasets (implied in the five RQs): the abstract and high-level claims rest on experiments whose full participant count, dataset sizes, exact feature definitions, and cross-validation details are needed to verify the reported separation between human and machine timing distributions under randomization.
minor comments (2)
  1. [Abstract] The abstract could briefly note the scale of the human typing corpus and the number of attack variants evaluated to give readers immediate context for the quantitative claims.
  2. [Background and Features] Notation for timing features (e.g., inter-keystroke intervals, first- and second-order statistics) should be defined consistently in the main text before the results sections.

Simulated Author's Rebuttal

2 responses · 0 unresolved

We appreciate the referee's detailed feedback, which has helped us identify areas to strengthen the presentation of our results and claims. We address the major comments below and will incorporate revisions accordingly.

read point-by-point responses
  1. Referee: [Section 4] Section 4 and RQ results: performance is shown only on the fixed corpus of Rubber Ducky variants plus the studied randomization heuristics. The headline claim of robustness to any future adaptive attacker requires either a covering argument that these strategies span the space of possible inter-keystroke timing distributions or an explicit limitation statement; without it, generalization rests on empirical coverage alone.

    Authors: We acknowledge that our evaluation is limited to the Rubber Ducky variants and randomization heuristics described in the paper. A formal covering argument for the entire space of possible inter-keystroke timing distributions is not feasible, as this space is continuous and unbounded. However, our central finding is that robustness arises primarily from training on structurally diverse generation strategies rather than model complexity. To address the concern, we will add an explicit limitations paragraph in Section 4 (and the conclusion) stating that while our results demonstrate strong performance against the studied attacks, generalization to arbitrary future adaptive attackers remains an empirical question and may require retraining as new attack strategies emerge. This clarifies that our claims are grounded in the evaluated corpus. revision: yes

  2. Referee: [Research Questions and Evaluation] Methodology and datasets (implied in the five RQs): the abstract and high-level claims rest on experiments whose full participant count, dataset sizes, exact feature definitions, and cross-validation details are needed to verify the reported separation between human and machine timing distributions under randomization.

    Authors: We thank the referee for highlighting the need for complete methodological details. The participant count, dataset sizes, exact feature definitions, and cross-validation procedure are detailed in Section 3 and Appendix A of the manuscript. To improve accessibility and address the concern, we will add a concise summary of these elements, including a table of key parameters, in the main body of the paper near the description of the research questions. This will ensure that the abstract and high-level claims are transparently supported by the full experimental setup. revision: yes

Circularity Check

0 steps flagged

No significant circularity; empirical study is self-contained

full rationale

The paper presents an empirical characterization of keystroke timing features for human-vs-machine discrimination in HID attacks. All claims rest on experimental results from collected datasets, model training, and evaluations across attack variants and sequence lengths. No derivation, prediction, or uniqueness claim reduces by construction to fitted parameters, self-definitions, or self-citation chains. Generalization concerns are empirical coverage issues, not circular reductions in the reported analysis.

Axiom & Free-Parameter Ledger

1 free parameters · 1 axioms · 0 invented entities

The detection approach rests on the domain assumption that timing variability differs between humans and machines, plus standard machine learning assumptions about data distributions; no new entities are postulated.

free parameters (1)
  • model hyperparameters and thresholds
    Lightweight models require choices for architecture, training parameters, and decision thresholds that are typically tuned on data.
axioms (1)
  • domain assumption Human keystroke timing exhibits natural variability that automated generators cannot perfectly replicate even with randomization
    Core premise enabling discrimination without content or identity information.

pith-pipeline@v0.9.0 · 5551 in / 1120 out tokens · 38817 ms · 2026-05-10T08:12:51.330649+00:00 · methodology

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Reference graph

Works this paper leans on

28 extracted references · 17 canonical work pages · 1 internal anchor

  1. [1]

    Collection of rubberducky-like payloads,https://github.com/topics/ ducky-payloads?o=desc&s=updated

  2. [2]

    Fbi warns cybercriminals have tried to hack us firms by mailing malicious usb drives, https://edition.cnn.com/2022/01/07/politics/fbi-usb-hackers-warning

  3. [3]

    In: 2021 International Conference on Computing, Communication, and Intelligent Systems (ICCCIS)

    Arora, L., Thakur, N., Yadav, S.K.: Usb rubber ducky detection by us- ing heuristic rules. In: 2021 International Conference on Computing, Communication, and Intelligent Systems (ICCCIS). pp. 156–160 (2021). https://doi.org/10.1109/ICCCIS51004.2021.9397064

  4. [4]

    In: 2024 International Conference on Intelligent Systems for Cybersecurity (ISCS)

    Arun Jothi, N.T., Anu, S., Harsha, K., Devi Priya, R.: Usb rubber ducky hunter a proactive defense against malicious usb attacks domain: Cybersecurity. In: 2024 International Conference on Intelligent Systems for Cybersecurity (ISCS). pp. 1–6 (2024).https://doi.org/10.1109/ISCS61804.2024.10581045

  5. [5]

    Caudill, A., Wilson, B.: Making badusb work for you,https://www.youtube.com/ watch?v=xcsxeJz3blI

  6. [6]

    International Journal of Information Security24(2), 79 (2025)

    Chillara, A.K., Saxena, P., Maiti, R.R.: Usb-gate: Usb-based gan-augmented transformer reinforced defense framework for adversarial keystroke injection attacks. International Journal of Information Security24(2), 79 (2025)

  7. [7]

    In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops

    DeAlcala, D., Morales, A., Tolosana, R., Acién, A., Fierrez, J., Hernández, S., Ferrer, M.A., Diaz, M.: Becaptcha-type: Biometric keystroke data generation for improved bot detection. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops. pp. 1051–1060 (June 2023)

  8. [8]

    Computers & Security85, 240–269 (2019).https://doi.org/https: //doi.org/10.1016/j.cose.2019.05.008,https://www.sciencedirect.com/ science/article/pii/S0167404818309957

    Farhi, N., Nissim, N., Elovici, Y.: Malboard: A novel user keystroke imper- sonation attack and trusted detection framework based on side-channel anal- ysis. Computers & Security85, 240–269 (2019).https://doi.org/https: //doi.org/10.1016/j.cose.2019.05.008,https://www.sciencedirect.com/ science/article/pii/S0167404818309957

  9. [9]

    Gaines, R.S., Lisowski, W., Press, S.J., Shapiro, N.: Authentication by keystroke timing: Some preliminary results. Tech. rep. (1980)

  10. [10]

    Calot, Jorge S

    González, N., Calot, E.P., Ierache, J.S., Hasperué, W.: Towards live- ness detection in keystroke dynamics: Revealing synthetic forgeries. Sys- tems and Soft Computing4, 200037 (2022).https://doi.org/https: //doi.org/10.1016/j.sasc.2022.200037,https://www.sciencedirect.com/ science/article/pii/S2772941922000047

  11. [11]

    In: Guyon, I., Luxburg, U.V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., Garnett, R

    Gulrajani, I., Ahmed, F., Arjovsky, M., Dumoulin, V., Courville, A.C.: Im- proved training of wasserstein gans. In: Guyon, I., Luxburg, U.V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., Garnett, R. (eds.) Advances in Neural Information Processing Systems. vol. 30. Curran Associates, Inc. (2017),https://proceedings.neurips.cc/paper_files/paper/2...

  12. [12]

    Product page,https://shop.hak5.org/products/ usb-rubber-ducky

    Hak5 LLC: USB Rubber Ducky. Product page,https://shop.hak5.org/products/ usb-rubber-ducky

  13. [13]

    Applied Soft Computing85, 105798 (2019).https://doi.org/https: //doi.org/10.1016/j.asoc.2019.105798,https://www.sciencedirect.com/ science/article/pii/S1568494619305794

    Hazan, I., Margalit, O., Rokach, L.: Securing keystroke dynamics from replay attacks. Applied Soft Computing85, 105798 (2019).https://doi.org/https: //doi.org/10.1016/j.asoc.2019.105798,https://www.sciencedirect.com/ science/article/pii/S1568494619305794

  14. [14]

    Killourhy and Roy A

    Killourhy, K.S., Maxion, R.A.: Comparing anomaly-detection algorithms for keystroke dynamics. In: 2009 IEEE/IFIP International Conference on Dependable Systems & Networks. pp. 125–134 (2009).https://doi.org/10.1109/DSN.2009.5270346 QUACK! Making the (Rubber) Ducky Talk 23

  15. [15]

    In: 2019 International Conference on Cyberworlds (CW)

    Mhenni, A., Migdal, D., Cherrier, E., Rosenberger, C., Essoukri Ben Amara, N.: Vulnerability of adaptive strategies of keystroke dynamics based authentication against different attack types. In: 2019 International Conference on Cyberworlds (CW). pp. 274–278 (2019).https://doi.org/10.1109/CW.2019.00052

  16. [16]

    Migdal, D., Rosenberger, C.: Statistical modeling of keystroke dynamics samples for the generation of synthetic datasets. Future Generation Computer Systems100, 907–920 (2019).https://doi.org/https://doi.org/10.1016/j.future.2019.03.056, https://www.sciencedirect.com/science/article/pii/S0167739X18331212

  17. [17]

    Mirza, M., Osindero, S.: Conditional generative adversarial nets (2014), https://arxiv.org/abs/1411.1784

  18. [18]

    In: 2015 IEEE 7th International Confer- ence on Biometrics Theory, Applications and Systems (BTAS)

    Monaco, J.V., Ali, M.L., Tappert, C.C.: Spoofing key-press latencies with a generative keystroke dynamics model. In: 2015 IEEE 7th International Confer- ence on Biometrics Theory, Applications and Systems (BTAS). pp. 1–8 (2015). https://doi.org/10.1109/BTAS.2015.7358795

  19. [19]

    Future Generation Computer Systems16(4), 351–359 (2000)

    Monrose, F., Rubin, A.D.: Keystroke dynamics as a biometric for authen- tication. Future Generation Computer Systems16(4), 351–359 (2000). https://doi.org/https://doi.org/10.1016/S0167-739X(99)00059-X, https://www.sciencedirect.com/science/article/pii/S0167739X9900059X

  20. [20]

    In: 2021 8th International Conference on Signal Processing and Integrated Networks (SPIN)

    Negi,A.,Rathore,S.S.,Sadhya,D.:Usbkeypressinjectionattackdetectionviafree-text keystroke dynamics. In: 2021 8th International Conference on Signal Processing and Integrated Networks (SPIN). pp. 681–685 (2021)

  21. [21]

    Computers & Security70, 675– 688 (2017).https://doi.org/https://doi.org/10.1016/j.cose.2017.08.002, https://www.sciencedirect.com/science/article/pii/S0167404817301578

    Nissim, N., Yahalom, R., Elovici, Y.: Usb-based attacks. Computers & Security70, 675– 688 (2017).https://doi.org/https://doi.org/10.1016/j.cose.2017.08.002, https://www.sciencedirect.com/science/article/pii/S0167404817301578

  22. [22]

    In: CVPR 2011 WORKSHOPS

    Rahman, K.A., Balagani, K.S., Phoha, V.V.: Making impostor pass rates mean- ingless: A case of snoop-forge-replay attack on continuous cyber-behavioral verification with keystrokes. In: CVPR 2011 WORKSHOPS. pp. 31–38 (2011). https://doi.org/10.1109/CVPRW.2011.5981729

  23. [23]

    ACM Trans

    Serwadda, A., Phoha, V.V.: Examining a large keystroke biometrics dataset for statistical-attack openings. ACM Trans. Inf. Syst. Secur.16(2) (Sep 2013). https://doi.org/10.1145/2516960,https://doi.org/10.1145/2516960

  24. [24]

    In: Proceedings of the Sixth ACMConferenceonDataandApplicationSecurityandPrivacy.p.105–112.CODASPY ’16, Association for Computing Machinery, New York, NY, USA (2016).https://doi

    Stanciu, V.D., Spolaor, R., Conti, M., Giuffrida, C.: On the effectiveness of sensor- enhanced keystroke dynamics against statistical attacks. In: Proceedings of the Sixth ACMConferenceonDataandApplicationSecurityandPrivacy.p.105–112.CODASPY ’16, Association for Computing Machinery, New York, NY, USA (2016).https://doi. org/10.1145/2857705.2857748,https:/...

  25. [25]

    Computers & Security31(1), 109–121 (2012).https://doi.org/https://doi.org/10.1016/j.cose.2011.10.001, https://www.sciencedirect.com/science/article/pii/S0167404811001179

    Stefan, D., Shu, X., (Daphne) Yao, D.: Robustness of keystroke-dynamics based biometrics against synthetic forgeries. Computers & Security31(1), 109–121 (2012).https://doi.org/https://doi.org/10.1016/j.cose.2011.10.001, https://www.sciencedirect.com/science/article/pii/S0167404811001179

  26. [26]

    In: 6th International Conference on Collaborative Computing: Net- working, Applications and Worksharing (CollaborateCom 2010)

    Stefan, D., Yao, D.: Keystroke-dynamics authentication against synthetic forgeries. In: 6th International Conference on Collaborative Computing: Net- working, Applications and Worksharing (CollaborateCom 2010). pp. 1–8 (2010). https://doi.org/10.4108/icst.collaboratecom.2010.16

  27. [27]

    University of Amsterdam, System and Network Engineering Master Research Project (2015)

    Vouteva, S., Verbij, R., Roos, J.: Feasibility and deployment of bad usb. University of Amsterdam, System and Network Engineering Master Research Project (2015)

  28. [28]

    In: Wallach, H., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E., Garnett, R

    Yoon, J., Jarrett, D., van der Schaar, M.: Time-series generative adversarial networks. In: Wallach, H., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E., Garnett, R. (eds.) Advances in Neural Information Processing Systems. vol. 32. Curran Associates, Inc. (2019),https://proceedings.neurips.cc/paper_files/paper/2019/file/ c9efe5f26cd17ba6216bbe2...