@@ -2635,6 +2635,28 @@ target_add(struct TargetList *targets, const char *hostname)
2635
2635
}
2636
2636
2637
2637
2638
+ /******************************************************************************
2639
+ * Called by the configuration-reading function for processing options
2640
+ * specified on the command-line, in configuration files, in environmental
2641
+ * variables, and so forth.
2642
+ ******************************************************************************/
2643
+ static void
2644
+ print_usage ()
2645
+ {
2646
+ printf ("\n" );
2647
+ printf ("usage:\n" );
2648
+ printf (" heartleech --scanlist <file> [--threads <n>]\n" );
2649
+ printf (" scans the listed targets for heartbleed vulnerability\n" );
2650
+ printf (" heartleech <hostname> --dump <file> [--threads <n>]\n" );
2651
+ printf (" aggressively dumps heartbleed info to file for later processing\n" );
2652
+ printf (" heartleech --cert <cert> --read <file>\n" );
2653
+ printf (" looks for matching private key in dump file\n" );
2654
+ printf (" heartleech <hostname> --autopwn [--threads <n>]\n" );
2655
+ printf (" automatically scans vulnerable host for private key\n" );
2656
+ printf ("use '-d' option to debug what's going wrong\n" );
2657
+ exit (1 );
2658
+ }
2659
+
2638
2660
/******************************************************************************
2639
2661
* Called by the configuration-reading function for processing options
2640
2662
* specified on the command-line, in configuration files, in environmental
@@ -2666,6 +2688,9 @@ heartleech_set_parameter(struct DumpArgs *args,
2666
2688
memcpy (args -> dump_filename , value , strlen (value )+ 1 );
2667
2689
args -> op = Op_Dump ;
2668
2690
return 1 ;
2691
+ } else if (EQUALS ("help" , name )) {
2692
+ print_usage ();
2693
+ return 0 ;
2669
2694
} else if (EQUALS ("ipv4" , name )) {
2670
2695
args -> ip_ver = 4 ;
2671
2696
return 0 ;
@@ -2844,7 +2869,7 @@ read_configuration(struct DumpArgs *args, int argc, char *argv[])
2844
2869
* -t www.google.com
2845
2870
*/
2846
2871
c = argv [i ][1 ];
2847
- if (c == 'd' || c == 'a' || c == 'S' )
2872
+ if (c == 'd' || c == 'a' || c == 'S' || c == 'h' || c == '?' )
2848
2873
;
2849
2874
else if (argv [i ][2 ] == '\0' ) {
2850
2875
arg = argv [++ i ];
@@ -2869,6 +2894,9 @@ read_configuration(struct DumpArgs *args, int argc, char *argv[])
2869
2894
case 'p' : heartleech_set_parameter (args , "port" , arg ); break ;
2870
2895
case 'S' : heartleech_set_parameter (args , "rand" , arg ); break ;
2871
2896
case 'v' : heartleech_set_parameter (args , "ipver" , arg ); break ;
2897
+ case '?' : heartleech_set_parameter (args , "help" , arg ); break ;
2898
+ case 'h' : heartleech_set_parameter (args , "help" , arg ); break ;
2899
+ case 'H' : heartleech_set_parameter (args , "help" , arg ); break ;
2872
2900
default :
2873
2901
fprintf (stderr , "[-] -%c: unknown argument\n" , c );
2874
2902
exit (1 );
@@ -3079,11 +3107,15 @@ main(int argc, char *argv[])
3079
3107
args .cfg_loopcount = 1000000 ;
3080
3108
args .timeout = 6 ;
3081
3109
3082
- fprintf (stderr , "\n--- heartleech/1.0.0h ---\n" );
3110
+ fprintf (stderr , "\n--- heartleech/1.0.0i ---\n" );
3083
3111
fprintf (stderr , "https://github.com/robertdavidgraham/heartleech\n" );
3084
3112
3085
- load_pcre ();
3086
-
3113
+ /*
3114
+ * NOT HERE YET
3115
+ * In the future, I'm going to load PCRE and search the dumped data for
3116
+ * patterns, such as as Cookies and passwords
3117
+ */
3118
+ //load_pcre();
3087
3119
//pattern_add(&args.patterns, "[a-zA-Z]*[sS][eE][sS][sS][iI][oO][nN][a-zA-Z0-9=]*;");
3088
3120
//pattern_add(&args.patterns, "ASPSESSION[A-Z]*=[A-Z]*;");
3089
3121
@@ -3093,13 +3125,7 @@ main(int argc, char *argv[])
3093
3125
*/
3094
3126
if (argc <= 1 ) {
3095
3127
usage :
3096
- printf ("\n" );
3097
- printf ("usage:\n heartleech <hostname> -f<filename>"
3098
- " [-p<port>] ...\n" );
3099
- printf (" <hostname> is a DNS name or IP address of the target\n" );
3100
- printf (" <filename> is where the heartbleed information is stored\n" );
3101
- printf (" <port> is the port number, defaulting to 443\n" );
3102
- return 1 ;
3128
+ print_usage ();
3103
3129
}
3104
3130
3105
3131
/*
0 commit comments