Skip to content

Commit

Permalink
Added missing re-formatted files.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbenden committed Sep 25, 2018
1 parent bb69b52 commit 61bf121
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 67 deletions.
2 changes: 1 addition & 1 deletion src/airbase-ng.c
Expand Up @@ -174,7 +174,7 @@ char usage[]
" -q : quiet (do not print statistics)\n"
" -v : verbose (print more messages)\n"
//" -M : M-I-T-M between [specified] clients and
//bssids\n"
// bssids\n"
" -A : Ad-Hoc Mode (allows other clients to peer)\n"
" -Y in|out|both : external packet processing\n"
" -c channel : sets the channel the AP is running on\n"
Expand Down
137 changes: 90 additions & 47 deletions src/aircrack-ng.c
Expand Up @@ -537,7 +537,8 @@ static int parse_ivs2(struct AP_info * ap_cur,
memcpy(ap_cur->ivbuf + n, buffer, 5);
uniqueiv_mark(ap_cur->uiv_root, buffer);
ap_cur->nb_ivs++;
// all_ivs[256*256*buffer[0] + 256*buffer[1] + buffer[2]].used
// all_ivs[256*256*buffer[0] + 256*buffer[1] +
// buffer[2]].used
// |= GOT_IV;
}
}
Expand All @@ -558,7 +559,8 @@ static int parse_ivs2(struct AP_info * ap_cur,
memcpy(weight,
buffer + clearsize - 15 * sizeof(int),
16 * sizeof(int));
// printf("weight 1: %d, weight 2: %d\n", weight[0],
// printf("weight 1: %d, weight 2: %d\n",
// weight[0],
// weight[1]);

if (PTW_addsession(
Expand Down Expand Up @@ -2312,10 +2314,12 @@ static int crack_wep_thread(void * arg)

for (i = j = 0; i < q; i++)
{
// i can never be 3+opt.keylen or exceed it, as i runs
//from 0 to q and q is defined as 3+B (with B the keybyte to
//attack)
// jj[i] = j = ( j + S[i] + K[i % (3 + opt.keylen)] ) &
// i can never be 3+opt.keylen or exceed it, as i
//runs
// from 0 to q and q is defined as 3+B (with B the keybyte to
// attack)
// jj[i] = j = ( j + S[i] + K[i % (3 + opt.keylen)] )
// &
// 0xFF;
jj[i] = j = (j + S[i] + K[i]) & 0xFF;
SWAP(S[i], S[j]);
Expand Down Expand Up @@ -2356,19 +2360,23 @@ static int crack_wep_thread(void * arg)
Kq = 2 - dq;
votes[A_neg][Kq]++;
// to signal general usage
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// USE_IV;
// to know which attack used this iv
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1 <<
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1
// <<
// (4+A_neg);
}
else if (o2 == 0)
{
Kq = 2 - dq;
votes[A_neg][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1 <<
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1
// <<
// (4+A_neg);
}
}
Expand All @@ -2378,9 +2386,11 @@ static int crack_wep_thread(void * arg)
{
Kq = 2 - dq;
votes[A_u15][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1 <<
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1
// <<
// (4+A_u15);
}
}
Expand All @@ -2393,7 +2403,8 @@ static int crack_wep_thread(void * arg)
votes[A_neg][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1 <<
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1
// <<
// (4+A_neg);
}

Expand All @@ -2405,7 +2416,8 @@ static int crack_wep_thread(void * arg)
votes[A_neg][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1 <<
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1
// <<
// (4+A_neg);
}

Expand All @@ -2415,18 +2427,22 @@ static int crack_wep_thread(void * arg)
{
Kq = Si[0] - dq;
votes[A_s13][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1 <<
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1
// <<
// (4+A_s13);
}
else if (((1 - q - o1) & 0xFF) == 0)
{
Kq = io1 - dq;
votes[A_u13_1][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1 <<
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1
// <<
// (4+A_u13_1);
}
else if (io1 < q)
Expand All @@ -2437,9 +2453,11 @@ static int crack_wep_thread(void * arg)
{
Kq = jq - dq;
votes[A_u5_1][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// 1 << (4+A_u5_1);
}
}
Expand All @@ -2451,7 +2469,8 @@ static int crack_wep_thread(void * arg)
votes[A_u5_2][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1 <<
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1
// <<
// (4+A_u5_2);
}

Expand All @@ -2461,28 +2480,34 @@ static int crack_wep_thread(void * arg)
{
Kq = 1 - dq;
votes[A_u13_2][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1 <<
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1
// <<
// (4+A_u13_2);
}
else if ((((1 - q - S1) & 0xFF) == 0) && (o1 == S1))
{
Kq = 1 - dq;
votes[A_u13_3][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1 <<
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1
// <<
// (4+A_u13_3);
}
else if ((S1 >= ((-q) & 0xFF))
&& (((q + S1 - io1) & 0xFF) == 0))
{
Kq = 1 - dq;
votes[A_u5_3][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1 <<
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1
// <<
// (4+A_u5_3);
}
}
Expand All @@ -2494,7 +2519,8 @@ static int crack_wep_thread(void * arg)
votes[A_s5_1][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1 <<
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1
// <<
// (4+A_s5_1);
}

Expand All @@ -2508,9 +2534,11 @@ static int crack_wep_thread(void * arg)
{
Kq = jq - dq;
votes[A_s5_2][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// 1 << (4+A_s5_2);
}
}
Expand All @@ -2522,9 +2550,11 @@ static int crack_wep_thread(void * arg)
{
Kq = jq - dq;
votes[A_s5_3][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// 1 << (4+A_s5_3);
}
}
Expand All @@ -2542,9 +2572,11 @@ static int crack_wep_thread(void * arg)
{
Kq = io2 - dq;
votes[A_s3][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// 1 << (4+A_s3);
}
}
Expand All @@ -2558,9 +2590,11 @@ static int crack_wep_thread(void * arg)
{
Kq = Si[0] - dq;
votes[A_4_s13][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// 1 << (4+A_4_s13);
}
else
Expand All @@ -2569,18 +2603,22 @@ static int crack_wep_thread(void * arg)
{
Kq = Si[254] - dq;
votes[A_4_u5_1][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] +
// all_ivs[256*256*K[0] + 256*K[1]
// +
// K[2]].used |= USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] +
// all_ivs[256*256*K[0] + 256*K[1]
// +
// K[2]].used |= 1 << (4+A_4_u5_1);
}
if ((jj[1] == 2) && (io2 == 2))
{
Kq = Si[255] - dq;
votes[A_4_u5_2][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] +
// all_ivs[256*256*K[0] + 256*K[1]
// +
// K[2]].used |= USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] +
// all_ivs[256*256*K[0] + 256*K[1]
// +
// K[2]].used |= 1 << (4+A_4_u5_2);
}
}
Expand All @@ -2590,9 +2628,11 @@ static int crack_wep_thread(void * arg)
{
Kq = io2 - dq;
votes[A_u5_4][Kq]++;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |=
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used
// |=
// USE_IV;
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1 <<
// all_ivs[256*256*K[0] + 256*K[1] + K[2]].used |= 1
// <<
// (4+A_u5_4);
}
}
Expand Down Expand Up @@ -4887,8 +4927,9 @@ static int next_key(char ** key, int keysize)
textcolor_fg(TEXT_GREEN);
}

// printf( "\nPassphrase not in dictionary \"%s\" \n",
//opt.dicts[opt.nbdict] );
// printf( "\nPassphrase not in dictionary \"%s\"
//\n",
// opt.dicts[opt.nbdict] );
if (next_dict(opt.nbdict + 1) != 0)
{
free(tmpref);
Expand Down Expand Up @@ -4947,8 +4988,9 @@ static int next_key(char ** key, int keysize)
textcolor_fg(TEXT_GREEN);
}

// printf( "\nPassphrase not in dictionary \"%s\" \n",
//opt.dicts[opt.nbdict] );
// printf( "\nPassphrase not in dictionary \"%s\"
//\n",
// opt.dicts[opt.nbdict] );
if (next_dict(opt.nbdict + 1) != 0)
{
free(tmpref);
Expand Down Expand Up @@ -6104,7 +6146,8 @@ int main(int argc, char * argv[])
/* wait until each thread reaches EOF */

// #ifndef DO_PGO_DUMP
// signal( SIGINT, SIG_DFL ); /* we want sigint to stop and dump pgo
// signal( SIGINT, SIG_DFL ); /* we want sigint to stop and dump
// pgo
// data */
// #endif

Expand Down
5 changes: 3 additions & 2 deletions src/aircrack-osdep/linux.c
Expand Up @@ -1843,8 +1843,9 @@ static int do_linux_open(struct wif * wi, char * iface)

if (!iwpriv)
{
fprintf(stderr, "Required wireless tools when compiled without libnl "
"could not be found, exiting.\n");
fprintf(stderr,
"Required wireless tools when compiled without libnl "
"could not be found, exiting.\n");
goto close_in;
}
#endif
Expand Down
8 changes: 4 additions & 4 deletions src/aircrack-ptw-lib.c
Expand Up @@ -236,11 +236,11 @@ rc4test_amd64_sse2(uint8_t * key, int keylen, uint8_t * iv, uint8_t * keystream)
"movzbl %b2, %k8 \n\t" /* scratch2 = j */
"movl (" state
",%q8,4), %k7 \n\t" /* s2 = state[scratch2] */
"movl %k7, (%q1) \n\t" /* state[i] = s2 */
"addq $4, %q1 \n\t" /* i++ */
"movl %k7, (%q1) \n\t" /* state[i] = s2 */
"addq $4, %q1 \n\t" /* i++ */
"movl %k5, (" state ",%q8,4) \n\t" /* state[scratch2] = s1 */
"cmpq %q1, %q3 \n\t" /* state == &state[0x100]
*/
"cmpq %q1, %q3 \n\t" /* state == &state[0x100]
*/
"jne .init_loop \n\t"

// restore keystream variable
Expand Down
2 changes: 1 addition & 1 deletion src/airdecloak-ng.c
Expand Up @@ -1521,7 +1521,7 @@ static void usage(void)
"cloaked.\n"
" --disable-base_filter : Do not apply base filter.\n"
//" --disable-retry : Disable retry check, don't care about
//retry bit.\n"
// retry bit.\n"
" --drop-frag : Drop fragmented packets\n"
"\n"
" --help : Displays this usage screen\n"
Expand Down
5 changes: 3 additions & 2 deletions src/airodump-ng.c
Expand Up @@ -1799,7 +1799,8 @@ static int dump_add_packet(unsigned char * h80211,

st_cur->probe_index = (st_cur->probe_index + 1) % NB_PRB;
memset(st_cur->probes[st_cur->probe_index], 0, 256);
memcpy(st_cur->probes[st_cur->probe_index], p + 2, n); // twice?!
memcpy(
st_cur->probes[st_cur->probe_index], p + 2, n); // twice?!
st_cur->ssid_length[st_cur->probe_index] = n;

if (verifyssid((const unsigned char *)
Expand Down Expand Up @@ -2919,7 +2920,7 @@ static int dump_add_packet(unsigned char * h80211,
{
/* RTS || CTS || ACK || CF-END || CF-END&CF-ACK*/
//(h80211[0] == 0xB4 || h80211[0] == 0xC4 || h80211[0] == 0xD4 ||
//h80211[0] == 0xE4 || h80211[0] == 0xF4)
// h80211[0] == 0xE4 || h80211[0] == 0xF4)

/* use general control frame detection, as the structure is always the
* same: mac(s) starting at [4] */
Expand Down

0 comments on commit 61bf121

Please sign in to comment.