From 16b33a3013db3e86a70a846bb3a33b1efcc1a5be Mon Sep 17 00:00:00 2001 From: Tinram Date: Mon, 20 May 2024 17:25:43 +0100 Subject: [PATCH] update mysqlbrute.c --- mysqlbrute.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/mysqlbrute.c b/mysqlbrute.c index 3c4c9be..189e5fb 100644 --- a/mysqlbrute.c +++ b/mysqlbrute.c @@ -3,11 +3,11 @@ * MySQL Brute * mysqlbrute.c * - * MySQLd bruteforcer using word lists. + * mysqld bruteforcer using word lists. * * @author Martin Latter * @copyright Martin Latter, 27/05/2017 - * @version 0.11 + * @version 0.12 * @license GNU GPL version 3.0 (GPL v3); https://www.gnu.org/licenses/gpl-3.0.html * @link https://github.com/Tinram/MySQL-Brute.git * @@ -26,12 +26,13 @@ #include #include #include + #include #include #define APP_NAME "MySQL Brute" -#define MB_VERSION "0.11" +#define MB_VERSION "0.12" #define MAX_WORD_LEN 50 @@ -48,14 +49,20 @@ unsigned int iPort = 3306; int main(int iArgCount, char* aArgV[]) { + pProgname = aArgV[0]; + + if (iArgCount <= 2) { + + menu(pProgname); + return EXIT_FAILURE; + } + unsigned int iMenu = options(iArgCount, aArgV); if ( ! iMenu) { return EXIT_FAILURE; } - pProgname = aArgV[0]; - MYSQL* pConn; FILE* pWordlist; clock_t tStart; @@ -147,11 +154,10 @@ unsigned int options(int iArgCount, char* aArgV[]) { struct option aLongOpts[] = { {"help", no_argument, 0, 'i'}, - {"version", no_argument, 0, 'v'}, {0, 0, 0, 0} }; - while ((iOpts = getopt_long(iArgCount, aArgV, "ivh:w:u:f:p:", aLongOpts, &iOptsIdx)) != -1) { + while ((iOpts = getopt_long(iArgCount, aArgV, "ih:w:u:f:p:", aLongOpts, &iOptsIdx)) != -1) { switch (iOpts) { @@ -159,10 +165,6 @@ unsigned int options(int iArgCount, char* aArgV[]) { iHelp = 1; break; - case 'v': - iVersion = 1; - break; - case 'h': pHost = optarg; break;