diff --git a/src/exploit/checkm8_spray.c b/src/exploit/checkm8_spray.c index 4d66677..937c9f5 100644 --- a/src/exploit/checkm8_spray.c +++ b/src/exploit/checkm8_spray.c @@ -296,8 +296,17 @@ int checkm8_stage_spray(exploit_ctx_t *ctx) * * Wait 1 second to ensure all spray buffers are freed by the * device before stage 4's DFU_DNLOAD allocation. + * + * This delay is only required on usbipd-win, which is the setup + * that motivated it: the vhci layer adds latency and the buffers + * are freed late. On a native host the reference implementation + * goes straight from the spray to the overwrite, and the idle + * second is a window in which the device can leave dfuIDLE on its + * own. When that happens the next control transfer returns + * NO_DEVICE (-4) and the sequence fails at stage 4. */ - usleep(1000000); /* 1 s */ + if (getenv("WSL_DISTRO_NAME") != NULL) + usleep(1000000); /* 1 s -- usbipd-win only */ ctx->phase = EXPLOIT_PHASE_SPRAY; log_info("checkm8: stage 3 complete -- heap spray done");