Aircrack-ng forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Aircrack-ng 1.6 release


Post reply

Name:
Email:
Subject:
Message icon:

Attach:
(Clear Attachment)
(more attachments)
Restrictions: maximum individual size 10240KB
Note that any files attached will not be displayed until approved by a moderator.
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
Which Aircrack-ng program captures traffic? Lowercase:

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: misterx
« on: June 11, 2021, 12:40:26 am »

You first have to isolate the handshake, then parse the different items, as they are spread over several frames. You'll have to look into aircrack-ng source code.
Posted by: Fpa
« on: June 10, 2021, 05:42:51 pm »

Umm anyone know how to fix this method??
using popen_noshell_

use wpa_passphrase program like so... but with fork threads...
"wpa_passphrase essid passphrase"
Code: [Select]
popen_noshell_set_fork_mode(POPEN_NOSHELL_MODE_POSIX_SPAWN);

char *exec_file = (char *) "wpa_passphrase";
char *arg1 = g_essid;
char *arg2 = g_key;
char *arg3 = (char *) NULL; /* last element */
char *argv[] = {exec_file, arg1, arg2, arg3};
/* NOTE! The first argv[] must be the executed *exec_file itself */

  fp = popen_noshell(argv[0], (const char * const *)argv, "r", &pclose_arg, 0);

parse remove the output
Code: [Select]
strcpy(pmk, replace_str(g_pmk, " psk=","")); //Parse

call calc mic
Code: [Select]
calc_mic( g_keyver, stmac, bssid, anonce, snonce, eapol, pmk, ptk, mic ); //HELP < NOT RETURNING PROPER MIC WITH POPEN METHOD

how do i read the data from .cap file for keyver, stmac, bssid, anonce, snonce, eapol, ... ?
any help would be greatly appreciated!!! please help fix calc_mic()
Posted by: misterx
« on: July 21, 2019, 07:42:46 pm »

If you want, aircrack-ng has a benchmark option: -S
There is also a script that allows to benchmark (build/benchmark) your system, trying different amount of CPU and generates a CSV that can be turned into a graph.
Posted by: Fpa
« on: July 21, 2019, 07:17:00 am »

Code: [Select]
#include "popen_noshell.h"
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <alloca.h>
#include <pthread.h> //Gimme thread stuff

#include <omp.h>
#include "popen_noshell.c"

// Shared between thread and main
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
long long int global_stopped;
long long int global_running;

long long int nb_kprev; /* last  # of keys tried        */
long long int nb_tried; /* total # of keys tried        */

int MAX_THREADS = 16;

//static const char num_charset[] = "0123456789";
//static const char hexl_charset[] = "0123456789abcdef";
//static const char hexu_charset[] = "0123456789ABCDEF";
//static const char azl_charset[] = "abcdefghijklmnopqrstuvwxyz";
//static const char azu_charset[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
//static const char a0l_charset[] = "0123456789abcdefghijklmnopqrstuvwxyz";
//static const char a0u_charset[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
static const char charset[] = "0123456789ABCDEF";
static const int charset_size = sizeof(charset) - 1;

char g_essid[36];
char g_passphrase[63];

char *replace_str(char *str, char *orig, char *rep){

    static char buffer[1024];
    char *p;
    int i = 0;

    if (!(p = strstr(str + i, orig))){
        return str;
    }

    while (str[i]){
        if (!(p = strstr(str + i, orig))){
            strcat(buffer, str + i);
            break; //return str;
        }
       
        strncpy(buffer + strlen(buffer), str + i, (p - str) - i);
        buffer[p - str] = '\0';
        strcat(buffer, rep);
        //printf("STR: %s\n", buffer);
        i = (p - str) + strlen(orig);
    }

    return buffer;
}

void* getPMK(void *unused){

FILE *pipein_fp;  // handle for reading
char readbuf[120]; // data from command
int stopped = 0, running = 0; // status of processes
int xPos;

char g_pmk[65];

#pragma omp parallel for
int status;
struct popen_noshell_pass_to_pclose pclose_arg;
/* constants to use with popen_noshell_set_fork_mode() */
// POPEN_NOSHELL_MODE_CLONE /* default, faster */
// POPEN_NOSHELL_MODE_FORK /* slower */
// POPEN_NOSHELL_MODE_POSIX_SPAWN /* the fastest, if implemented properly by libc: see issue #11 */
// COMMENTED OUT popen_noshell.c Line 357 COULD NOT COMPILE
popen_noshell_set_fork_mode(POPEN_NOSHELL_MODE_POSIX_SPAWN);

char *exec_file = (char *) "wpa_passphrase";
char *arg1 = g_essid;
char *arg2 = g_passphrase;
char *arg3 = (char *) NULL; /* last element */
char *argv[] = {exec_file, arg1, arg2, arg3};
/* NOTE! The first argv[] must be the executed *exec_file itself */

        /* Create one way pipe line with call to popen() */

pipein_fp = popen_noshell(argv[0], (const char * const *)argv, "r", &pclose_arg, 0);
if (!pipein_fp) {
err(EXIT_FAILURE, "popen_noshell()");
}

xPos = 1;

        /* Processing loop */
while (fgets(readbuf, sizeof(readbuf)-1, pipein_fp)) {
//while(fgets(readbuf, 80, pipein_fp)){
if(xPos == 4){
//GETS LINE INPUT
strcpy(g_pmk, readbuf);
strcpy(g_pmk, replace_str(g_pmk, " psk=","")); //Parse
//ToUp(g_pmk);

static const char g_psk[] = "64337e87eede4b6444bfa8ca80f2fd9b5ac6e7fe1503f32182c97933c93c85a2"; //PMK 9000th try hexu_charset 00000E71 ?
//static const char g_psk[] = "c3e7973f656e91ecd75b1ec456b4d693af3dc7503d997725c7d4ce5d2dd04841"; //PMK 1st try hexu_charset 00000000

//KEEP THIS CHECK FOR NOW (WORKS)
int xCheck = 0;

for ( int x = 0; x < 32; x++ ) {
if(g_pmk[x] == g_psk[x]){
  xCheck = 1;
} else {
  xCheck = 0;
  break;
}
}

if (xCheck == 1) {

printf("PMK: %s", g_pmk);
printf("PSK: %s\n", g_psk);

printf("\nKEY FOUND: %s\n", g_passphrase);

exit(0);
}


}

xPos++;
nb_tried++;

if(nb_tried == 1){
printf("[%d] TRYING: %s\n%s\n", nb_tried, g_passphrase, g_pmk); // print to screen //nb_tried
}

if(nb_tried == nb_kprev + 1000){
printf("[%d] TRYING: %s\n%s\n", nb_tried, g_passphrase, g_pmk); // print to screen
nb_kprev = nb_tried;
}

}

/* Close the pipes */
pclose_noshell(&pclose_arg);
        return(0);

}

void ToUp (char *p){
while(*p) {
*p = toupper(*p);
p++;
}
}

void brute_impl(char * str, int index, int max_depth) {

/* Declaring an array for 16 threads.*/
pthread_t getDataThread[MAX_THREADS];

    int j;

    for (int i = 0; i < charset_size; ++i) {
str[index] = charset[i];

if (index == max_depth - 1) {

strcpy(g_passphrase, str);

if(j < MAX_THREADS){
pthread_create (&getDataThread[j], NULL, getPMK, NULL);
// Sleep 1 second  ... Thread still working
//sleep(1);
pthread_join (getDataThread[j], NULL);
} else {
j = 0;
break;
}

j++;

} else {
    brute_impl(str, index + 1, max_depth);
}

    }
}

void brute_sequential(int max_len) {

    char * buf = malloc(max_len + 1);
    int i;

    memset(buf, 0, max_len + 1);

    for (i = 1; i <= max_len; ++i) {
        memset(buf, 0, max_len + 1);

    for(i = 0; i < 8; i++){
buf[i] = charset[0];
    }

        brute_impl(buf, 0, i);
    }

    free(buf);
}

int main(void){
strcpy(g_essid, "wifi");

brute_sequential(63); //Change to 64, after done, and restart with HEX_ONLY alphabet
printf("\nKEY NOT FOUND!\n");
exit(0);

}

Code: [Select]
gcc -o ./wpa3scan wpa3scan.c -lpthread

Compares PSK and PMK at max of 16 threads ~500 PMK's /sec (popen_noshell pthreads)
Still needs to compare MIC's.
Posted by: Fpa
« on: July 21, 2019, 02:50:05 am »

Im trying tests to make a faster mic eapol check than aircrack-ng
Posted by: misterx
« on: July 20, 2019, 05:59:10 pm »

What is that?
Posted by: Fpa
« on: July 20, 2019, 10:06:50 am »

Quote
/*
Trying to merge wpa3scan.c and aircrack-ng\test\cryptounittest\test-calc-mic.c
Threads need to be fixed a little bit.

#include "popen_noshell.c" //Would be nice too.

*/

wpa3scan.c
aircrack-ng\test\cryptounittest\test-calc-mic.c
popen_noshell.c
popen_noshell.h
popen_noshell_ex.c
popen_noshell_tests.c
popen_noshell_tests.cpp

Code: [Select]
gcc -o ./wpa3scan wpa3scan.c -lpthread

If anyone can help out...