summaryrefslogtreecommitdiff
path: root/recipes/aircrack/files/silent_patch.diff
blob: b3ed5d3b49b3ad1579fccfd8d1a22e65b17aee29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
--- aircrack.c.o	2005-02-14 01:10:25.000000000 +0100
+++ aircrack.c	2005-02-14 01:11:00.000000000 +0100
@@ -44,6 +44,7 @@
 "\n"
 "  usage: aircrack [options] <pcap file> <pcap file> ...\n"
 "\n"
+"      -S         : silent - usefull for embedded devices\n"
 "      -d <start> : debug - specify beginning of the key\n"
 "      -f <fudge> : bruteforce fudge factor (default: 2)\n"
 "      -m <maddr> : MAC address to filter usable packets\n"
@@ -53,6 +54,7 @@
 
 /* command-line parameters */
 
+int silent = 0;                 /* Silent, just display wep key if found  */
 int debug_lvl = 0;              /* # of keybytes fixed  */
 int macfilter = 0;              /* BSSID check flag     */
 int stability = 0;              /* unstable attacks on  */
@@ -803,7 +805,10 @@
 
         wepkey[B] = wpoll[B][depth[B]].index;
 
-        show_stats( B );
+        if (! silent)
+        {
+           show_stats( B );
+        }
 
         if( B == 4 && weplen == 13 )
         {
@@ -832,14 +837,20 @@
 
                 /* we have a valid key */
 
+               if (! silent )
+               {
                 show_stats( B );
-
                 printf( "                 \33[31;1mKEY FOUND! [ " );
-
                 for( i = 0; i < weplen; i++ )
                     printf( "%02X", wepkey[i] );
-
                 printf( " ]\33[0m\n\n" );
+               } else
+               {
+                printf( "KEY FOUND! [ " );
+                for( i = 0; i < weplen; i++ )
+                    printf( "%02X", wepkey[i] );
+                printf( "]\n\n" );
+               }
 
                 kill( 0, SIGTERM );
 
@@ -893,7 +904,7 @@
 
     while( 1 )
     {
-        int option = getopt( argc, argv, "d:f:m:n:p:s:" );
+        int option = getopt( argc, argv, "Sd:f:m:n:p:s:" );
 
         if( option < 0 ) break;
 
@@ -997,6 +1008,10 @@
 
                 break;
 
+            case 'S':
+		silent=1;
+                break;
+
             default : goto usage;
         }
     }
@@ -1072,7 +1087,11 @@
     tm_start = time( NULL );
     tm_prev  = time( NULL );
 
-    printf( "\33[2J" );
+    if (!silent)
+    {
+      printf( "\33[2J" );
+    }
+
     fflush( stdout );
 
     return( do_wep_crack( 0 ) );