-
Notifications
You must be signed in to change notification settings - Fork 0
/
heartbleed
executable file
·58 lines (47 loc) · 1.37 KB
/
heartbleed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env php
<?php
require_once('config.php');
//Load library functions and setup Zend Framework entrypoint.
error_reporting(E_ALL);
//Setup framework libraries
define('APP_PATH', realpath(dirname(__FILE__)));
$paths = array(
APP_PATH,
ZFW_PREFIX . DIRECTORY_SEPARATOR . 'ZendFramework-'. ZFW_VERSION . DIRECTORY_SEPARATOR. 'library',
get_include_path()
);
set_include_path(implode(PATH_SEPARATOR, $paths));
//Load the framework entry point
require_once('Zend/Loader/Autoloader.php');
//Setup class autoloading
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->setFallbackAutoloader(true);
// Console GetOpt (Format: example|e[=-]{1}[type(i,s){1}] )
$getopt = new Zend_Console_Getopt(array(
'command|c=s' => 'What to do. Options: test',
'server|s=s' => 'What server to test.',
'port|p-s' => 'Port (defaults 443)',
'verbose|v' => 'Display verbose information',
'help|h' => 'Display usage information'
));
try {
$getopt->parse();
}
catch(Zend_Console_Getopt_Exception $e) {
echo $e->getUsageMessage();
exit(1);
}
// Usage help
if($getopt->getOption('h')) {
echo $getopt->getUsageMessage();
exit(0);
}
//Start Commands
if(isset($getopt->c)) {
$command = new HeartBleed();
$status = $command->run($getopt);
exit($status);
}
//Nothing ran, show help, exit with error
echo $getopt->getUsageMessage();
exit(1);