rapid7 / meterpreter

THIS REPO IS OBSOLETE. USE https://github.com/rapid7/metasploit-payloads INSTEAD
Other
326 stars 144 forks source link

Implement a sleep in windows that lasts longer #169

Closed OJ closed 9 years ago

OJ commented 9 years ago

There were valid concerns that the use of Sleep() on Windows wasn't going to provide enough time given that the limit of using a DWORD for timeouts that are specified in milliseconds result in a limitation of approximately 49 days (thanks @bcook-r7 for pointing that out).

This PR uses the hidden NtDelayExecution function that is in ntdll.dll instead of Sleep where possible and falls back on Sleep if not found. This function can sleep for way longer (see code comments).

Verification

metasploit-public-bot commented 9 years ago

Test PASSED. Refer to this link for build results (access rights to CI server needed): https://ci.metasploit.com//job/GPR-MeterpreterWin/201/ Test PASSED.

metasploit-public-bot commented 9 years ago

Test PASSED. Refer to this link for build results (access rights to CI server needed): https://ci.metasploit.com//job/GPR-MeterpreterWin/202/ Test PASSED.

metasploit-public-bot commented 9 years ago

Test PASSED. Refer to this link for build results (access rights to CI server needed): https://ci.metasploit.com//job/GPR-MeterpreterWin/203/ Test PASSED.

metasploit-public-bot commented 9 years ago

Test PASSED. Refer to this link for build results (access rights to CI server needed): https://ci.metasploit.com//job/GPR-MeterpreterWin/204/ Test PASSED.

bcook-r7 commented 9 years ago

Works for me, thanks.

OJ commented 9 years ago

Thank you sir!