Skip to content

Commit

Permalink
update mysqlbrute.c
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinram committed May 20, 2024
1 parent db48a36 commit 16b33a3
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions mysqlbrute.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -26,12 +26,13 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>

#include <getopt.h>
#include <mysql.h>


#define APP_NAME "MySQL Brute"
#define MB_VERSION "0.11"
#define MB_VERSION "0.12"
#define MAX_WORD_LEN 50


Expand All @@ -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;
Expand Down Expand Up @@ -147,22 +154,17 @@ 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) {

case 'i':
iHelp = 1;
break;

case 'v':
iVersion = 1;
break;

case 'h':
pHost = optarg;
break;
Expand Down

0 comments on commit 16b33a3

Please sign in to comment.