[kismac] [binaervarianz] r119 - in KisMACng: . KisMAC.xcodeproj Sources/Controller Sources/Core Sources/Crypto Sources/Preferences Sources/Preferences/PreferencePanes Sources/WaveDrivers

  • From: svn@xxxxxxxxxxxxxxxx
  • To: kismac@xxxxxxxxxxxxx
  • Date: Mon, 17 Apr 2006 09:39:42 +0200

Author: gkruse
Date: 2006-04-17 09:39:42 +0200 (Mon, 17 Apr 2006)
New Revision: 119

Added:
   KisMACng/Sources/Preferences/PreferencePanes/PrefsAdvanced.h
   KisMACng/Sources/Preferences/PreferencePanes/PrefsAdvanced.m
Modified:
   KisMACng/CHANGES
   KisMACng/KisMAC.xcodeproj/project.pbxproj
   KisMACng/Sources/Controller/ScanControllerMenus.m
   KisMACng/Sources/Core/WaveScanner.mm
   KisMACng/Sources/Crypto/AirCrackWrapper.m
   KisMACng/Sources/Preferences/PrefsController.m
   KisMACng/Sources/WaveDrivers/WaveDriverAirportExtreme.m
Log:
R119 - Advanced Prefs from themacuser


Modified: KisMACng/CHANGES
===================================================================
--- KisMACng/CHANGES    2006-04-17 07:14:27 UTC (rev 118)
+++ KisMACng/CHANGES    2006-04-17 07:39:42 UTC (rev 119)
@@ -1,3 +1,5 @@
+R119 - Advanced Prefs from themacuser
+
 R118: - Fixed AE Forever for real this time (maybe)
 
 R114: - Fixed APs not being drawn on map (closes #12)

Modified: KisMACng/KisMAC.xcodeproj/project.pbxproj
===================================================================
--- KisMACng/KisMAC.xcodeproj/project.pbxproj   2006-04-17 07:14:27 UTC (rev 
118)
+++ KisMACng/KisMAC.xcodeproj/project.pbxproj   2006-04-17 07:39:42 UTC (rev 
119)
@@ -466,6 +466,9 @@
                00FF593F06C630CC006C7F1E /* WaveDriverPrismGT.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 00FF593D06C630CC006C7F1E /* WaveDriverPrismGT.m 
*/; };
                6C03D77009B547F2005B2316 /* Growl.framework in Frameworks */ = 
{isa = PBXBuildFile; fileRef = 6C03D76F09B547F2005B2316 /* Growl.framework */; 
};
                6C03D77309B547F6005B2316 /* Growl.framework in CopyFiles */ = 
{isa = PBXBuildFile; fileRef = 6C03D76F09B547F2005B2316 /* Growl.framework */; 
};
+               6C1D31C009F37BC70005A9F8 /* PrefsAdvanced.h in Headers */ = 
{isa = PBXBuildFile; fileRef = 6C1D31BE09F37BC70005A9F8 /* PrefsAdvanced.h */; 
};
+               6C1D31C109F37BC70005A9F8 /* PrefsAdvanced.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 6C1D31BF09F37BC70005A9F8 /* PrefsAdvanced.m */; 
};
+               6C1D31C409F37BE10005A9F8 /* PrefsAdvanced.nib in Resources */ = 
{isa = PBXBuildFile; fileRef = 6C1D31C209F37BE10005A9F8 /* PrefsAdvanced.nib 
*/; };
                6CA3BCCB09B2A58F00DCB407 /* Accelerate.framework in Frameworks 
*/ = {isa = PBXBuildFile; fileRef = 6CA3BCCA09B2A58F00DCB407 /* 
Accelerate.framework */; };
                87CEBA8209AEF03700AEB0B8 /* GrowlController.h in Headers */ = 
{isa = PBXBuildFile; fileRef = 87CEBA8009AEF03700AEB0B8 /* GrowlController.h 
*/; };
                87CEBA8309AEF03700AEB0B8 /* GrowlController.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 87CEBA8109AEF03700AEB0B8 /* GrowlController.m 
*/; };
@@ -847,6 +850,10 @@
                29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = 
PBXFileReference; lastKnownFileType = wrapper.framework; name = 
Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; 
sourceTree = "<absolute>"; };
                32CA4F630368D1EE00C91783 /* KisMAC_Prefix.pch */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
KisMAC_Prefix.pch; sourceTree = "<group>"; };
                6C03D76F09B547F2005B2316 /* Growl.framework */ = {isa = 
PBXFileReference; lastKnownFileType = wrapper.framework; name = 
Growl.framework; path = Resources/Growl.framework; sourceTree = "<group>"; };
+               6C1D31BE09F37BC70005A9F8 /* PrefsAdvanced.h */ = {isa = 
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = 
PrefsAdvanced.h; sourceTree = "<group>"; };
+               6C1D31BF09F37BC70005A9F8 /* PrefsAdvanced.m */ = {isa = 
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; 
path = PrefsAdvanced.m; sourceTree = "<group>"; };
+               6C1D31C309F37BE10005A9F8 /* English */ = {isa = 
PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = 
Resources/Nibs/English.lproj/PrefsAdvanced.nib; sourceTree = SOURCE_ROOT; };
+               6C1D31C509F37BF40005A9F8 /* Spanish */ = {isa = 
PBXFileReference; lastKnownFileType = wrapper.nib; name = Spanish; path = 
Resources/Nibs/Spanish.lproj/PrefsAdvanced.nib; sourceTree = SOURCE_ROOT; };
                6CA3BCCA09B2A58F00DCB407 /* Accelerate.framework */ = {isa = 
PBXFileReference; lastKnownFileType = wrapper.framework; name = 
Accelerate.framework; path = /System/Library/Frameworks/Accelerate.framework; 
sourceTree = "<absolute>"; };
                87CEBA8009AEF03700AEB0B8 /* GrowlController.h */ = {isa = 
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = 
GrowlController.h; sourceTree = "<group>"; };
                87CEBA8109AEF03700AEB0B8 /* GrowlController.m */ = {isa = 
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; 
path = GrowlController.m; sourceTree = "<group>"; };
@@ -1157,6 +1164,8 @@
                003533DB06A5DD8500AB4577 /* PreferencePanes */ = {
                        isa = PBXGroup;
                        children = (
+                               6C1D31BE09F37BC70005A9F8 /* PrefsAdvanced.h */,
+                               6C1D31BF09F37BC70005A9F8 /* PrefsAdvanced.m */,
                                003533DC06A5DD8500AB4577 /* PrefsClient.h */,
                                003533DD06A5DD8500AB4577 /* PrefsClient.m */,
                                003533DE06A5DD8500AB4577 /* PrefsDriver.h */,
@@ -1322,6 +1331,7 @@
                00F57C1606A886350035AE2F /* Nibs */ = {
                        isa = PBXGroup;
                        children = (
+                               6C1D31C209F37BE10005A9F8 /* PrefsAdvanced.nib 
*/,
                                00F57C1706A886350035AE2F /* Crack.nib */,
                                00F57C1906A886350035AE2F /* CrashReporter.nib 
*/,
                                00F57C1B06A886350035AE2F /* DecryptDialog.nib 
*/,
@@ -1653,6 +1663,7 @@
                                0090B7CB07B2A43D005FEEB1 /* 
WaveStorageController.h in Headers */,
                                00DF456308B1E969003F3C7E /* 
WaveDriverAirportExtreme.h in Headers */,
                                87CEBA8209AEF03700AEB0B8 /* GrowlController.h 
in Headers */,
+                               6C1D31C009F37BC70005A9F8 /* PrefsAdvanced.h in 
Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
@@ -1937,6 +1948,7 @@
                                00D566B909C74A8200FB787B /* growl-probe.png in 
Resources */,
                                00D566BA09C74A8200FB787B /* growl-wep.png in 
Resources */,
                                00D566BB09C74A8200FB787B /* growl-wpa.png in 
Resources */,
+                               6C1D31C409F37BE10005A9F8 /* PrefsAdvanced.nib 
in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
@@ -2128,6 +2140,7 @@
                                0090B7CC07B2A43D005FEEB1 /* 
WaveStorageController.m in Sources */,
                                00DF456408B1E969003F3C7E /* 
WaveDriverAirportExtreme.m in Sources */,
                                87CEBA8309AEF03700AEB0B8 /* GrowlController.m 
in Sources */,
+                               6C1D31C109F37BC70005A9F8 /* PrefsAdvanced.m in 
Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
@@ -2313,6 +2326,16 @@
                        name = WayPointDialog.nib;
                        sourceTree = "<group>";
                };
+               6C1D31C209F37BE10005A9F8 /* PrefsAdvanced.nib */ = {
+                       isa = PBXVariantGroup;
+                       children = (
+                               6C1D31C309F37BE10005A9F8 /* English */,
+                               6C1D31C509F37BF40005A9F8 /* Spanish */,
+                       );
+                       name = PrefsAdvanced.nib;
+                       path = ../../Sources/WaveDrivers;
+                       sourceTree = "<group>";
+               };
 /* End PBXVariantGroup section */
 
 /* Begin XCBuildConfiguration section */

Modified: KisMACng/Sources/Controller/ScanControllerMenus.m
===================================================================
--- KisMACng/Sources/Controller/ScanControllerMenus.m   2006-04-17 07:14:27 UTC 
(rev 118)
+++ KisMACng/Sources/Controller/ScanControllerMenus.m   2006-04-17 07:39:42 UTC 
(rev 119)
@@ -537,7 +537,9 @@
        
 }
 - (IBAction)deautheticateNetwork:(id)sender {
-    if ([_deauthMenu state]==NSOffState && [self startActiveAttack] && 
[scanner deauthenticateNetwork:_curNet atInterval:100]) {
+       NSUserDefaults *defs;
+       defs = [NSUserDefaults standardUserDefaults];
+    if ([_deauthMenu state]==NSOffState && [self startActiveAttack] && 
[scanner deauthenticateNetwork:_curNet atInterval:[[defs 
objectForKey:@"pr_interval"] intValue]]) {
         [_deauthMenu setState:NSOnState];
         [_deauthMenu setTitle:[NSLocalizedString(@"Deauthenticating ", "menu 
item") stringByAppendingString:[_curNet BSSID]]];
     } else {

Modified: KisMACng/Sources/Core/WaveScanner.mm
===================================================================
--- KisMACng/Sources/Core/WaveScanner.mm        2006-04-17 07:14:27 UTC (rev 
118)
+++ KisMACng/Sources/Core/WaveScanner.mm        2006-04-17 07:39:42 UTC (rev 
119)
@@ -602,6 +602,8 @@
 
 - (void)doBeaconFloodNetwork:(WaveDriver*)w {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+       NSUserDefaults *defs;
+       defs = [NSUserDefaults standardUserDefaults];
     UInt16 x[3];
     int i = 0;
     
@@ -614,7 +616,7 @@
         memcpy(_beaconFrame.hdr.address3, x, 6); //needs to be random
     
         [w sendFrame:(UInt8*)&_beaconFrame withLength:sizeof(_beaconFrame) 
atInterval:0];
-        [NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
+        [NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:[[defs 
objectForKey:@"bf_interval"] floatValue]]];
         if (i++>600) break;
     }
     

Modified: KisMACng/Sources/Crypto/AirCrackWrapper.m
===================================================================
--- KisMACng/Sources/Crypto/AirCrackWrapper.m   2006-04-17 07:14:27 UTC (rev 
118)
+++ KisMACng/Sources/Crypto/AirCrackWrapper.m   2006-04-17 07:39:42 UTC (rev 
119)
@@ -89,14 +89,16 @@
 - (id)init {
     self = [super init];
     if (!self) return nil;
+       NSUserDefaults *defs;
+       defs = [NSUserDefaults standardUserDefaults];
         
     /* initialize all the data */
-    debug_lvl = 0;              /* # of keybytes fixed  */
-    stability = 0;              /* unstable attacks on  */
-    keyid  =  0;                /* WEP KeyID            */
-    weplen = 13;                /* WEP key length       */
-    ffact  =  2;                /* fudge threshold      */
-    nfork  =  1;                /* number of forks      */
+    debug_lvl = 0;                                                             
                /* # of keybytes fixed  */
+    stability = 0;                                                             
                /* unstable attacks on  */
+    keyid  =  0;                                                               
                /* WEP KeyID            */
+    weplen = 13;                                                               
                /* WEP key length       */
+    ffact  = [[defs objectForKey:@"ac_ff"] intValue];  /* fudge threshold      
*/
+    nfork  =  1;                                                               
                /* number of forks      */
 
     //find number of processors and setup the same number of cracking threads
     int value;

Added: KisMACng/Sources/Preferences/PreferencePanes/PrefsAdvanced.h
===================================================================
--- KisMACng/Sources/Preferences/PreferencePanes/PrefsAdvanced.h        
2006-04-17 07:14:27 UTC (rev 118)
+++ KisMACng/Sources/Preferences/PreferencePanes/PrefsAdvanced.h        
2006-04-17 07:39:42 UTC (rev 119)
@@ -0,0 +1,21 @@
+//
+//  PrefsAdvanced.h
+//  KisMAC
+//
+//  Created by themacuser on Mon Apr 3 2006.
+//
+
+#import <AppKit/AppKit.h>
+
+#import "PrefsClient.h"
+
+@interface PrefsAdvanced : PrefsClient
+{
+       IBOutlet id ac_ff; // aircrack fudge factor
+       IBOutlet id bf_interval; // beacon flood interval
+       IBOutlet id bpfdevice; // capture device
+       IBOutlet id bpfloc;  // bpf location
+       IBOutlet id pr_interval; //deauthenticate interval
+}
+
+@end

Added: KisMACng/Sources/Preferences/PreferencePanes/PrefsAdvanced.m
===================================================================
--- KisMACng/Sources/Preferences/PreferencePanes/PrefsAdvanced.m        
2006-04-17 07:14:27 UTC (rev 118)
+++ KisMACng/Sources/Preferences/PreferencePanes/PrefsAdvanced.m        
2006-04-17 07:39:42 UTC (rev 119)
@@ -0,0 +1,60 @@
+//
+//  PrefsAdvanced.h
+//  KisMAC
+//
+//  Created by themacuser on Mon Apr 3 2006.
+//
+
+#import "PrefsAdvanced.h"
+#import "WaveHelper.h"
+
+@implementation PrefsAdvanced
+
+-(void)updateUI {
+    [ac_ff setStringValue:[controller objectForKey:@"ac_ff"]];
+       [bf_interval setStringValue:[controller objectForKey:@"bf_interval"]];
+       [bpfdevice setStringValue:[controller objectForKey:@"bpfdevice"]];
+       [bpfloc setStringValue:[controller objectForKey:@"bpfloc"]];
+       [pr_interval setStringValue:[controller objectForKey:@"pr_interval"]];
+}
+
+-(BOOL)updateDictionary {
+       [controller setObject:[ac_ff stringValue] forKey:@"ac_ff"];
+       [controller setObject:[bf_interval stringValue] forKey:@"bf_interval"];
+       [controller setObject:[bpfdevice stringValue] forKey:@"bpfdevice"];
+       [controller setObject:[bpfloc stringValue] forKey:@"bpfloc"];
+       [controller setObject:[pr_interval stringValue] forKey:@"pr_interval"];
+    return YES;
+}
+
+-(IBAction)setValueForSender:(id)sender {
+   if(sender == ac_ff) {
+       [controller setObject:[ac_ff stringValue] forKey:@"ac_ff"];
+    } else if(sender == bf_interval) {
+               [controller setObject:[bf_interval stringValue] 
forKey:@"bf_interval"];
+    } else if(sender == bpfdevice) {
+               [controller setObject:[bpfdevice stringValue] 
forKey:@"bpfdevice"];
+    } else if(sender == bpfloc) {
+               [controller setObject:[bpfloc stringValue] forKey:@"bpfloc"];
+    } else if(sender == pr_interval) {
+       [controller setObject:[pr_interval stringValue] forKey:@"pr_interval"];
+       } else {
+        NSLog(@"Error: Invalid sender(%@) in setValueForSender:",sender);
+    }
+}
+
+-(IBAction)setDefaults:(id)sender {
+       [ac_ff setStringValue:@"2"];
+       [bf_interval setStringValue:@"0.1"];
+       [bpfdevice setStringValue:@"wlt1"];
+       [bpfloc setStringValue:@"/dev/bpf0"];
+       [pr_interval setStringValue:@"100"];
+}
+
+@end
+
+/* sample code
+NSUserDefaults *defs;
+defs = [NSUserDefaults standardUserDefaults];
+[defs objectForKey:@"bf_interval"]
+*/

Modified: KisMACng/Sources/Preferences/PrefsController.m
===================================================================
--- KisMACng/Sources/Preferences/PrefsController.m      2006-04-17 07:14:27 UTC 
(rev 118)
+++ KisMACng/Sources/Preferences/PrefsController.m      2006-04-17 07:39:42 UTC 
(rev 119)
@@ -169,6 +169,20 @@
                    [NSImage imageNamed:@"map"],
                    @selector(changeView:),
                    nil);
+       
+       [nibNamesDict setObject:@"PrefsAdvanced" forKey:@"Advanced"];
+    [classNamesDict setObject:@"PrefsAdvanced" forKey:@"Advanced"];
+    addToolbarItem(toolbarItems,
+                   @"Advanced",
+                   @"Advanced",
+                   @"Advanced",
+                   @"Advanced Options",
+                   self,
+                   @selector(setImage:),
+                   [NSImage imageNamed:@"EnergySaver"],
+                   @selector(changeView:),
+                   nil);
+       
     [nibNamesDict setObject:@"PrefsWebService" forKey:@"WebService"];
     [classNamesDict setObject:@"PrefsWebService" forKey:@"WebService"];
     addToolbarItem(toolbarItems,
@@ -259,7 +273,7 @@
 
 
 - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar {
-    return [NSArray arrayWithObjects:@"Scanning", @"Filter", @"Sounds", 
@"Driver", @"GPS", @"Map", @"Traffic", @"WebService", nil];
+    return [NSArray arrayWithObjects:@"Scanning", @"Filter", @"Sounds", 
@"Driver", @"GPS", @"Map", @"Traffic", @"WebService", @"Advanced", nil];
 }
 
 - (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar {

Modified: KisMACng/Sources/WaveDrivers/WaveDriverAirportExtreme.m
===================================================================
--- KisMACng/Sources/WaveDrivers/WaveDriverAirportExtreme.m     2006-04-17 
07:14:27 UTC (rev 118)
+++ KisMACng/Sources/WaveDrivers/WaveDriverAirportExtreme.m     2006-04-17 
07:39:42 UTC (rev 119)
@@ -28,9 +28,9 @@
 #import "WaveHelper.h"
 #import <BIGeneric/BIGeneric.h>
 
-#define devicePath @"wlt1"
+//#define devicePath @"wlt1"
 #define optionsFile 
@"/System/Library/Extensions/AppleAirPort2.kext/Contents/Info.plist"
-#define devFile @"/dev/bpf0"
+//#define devFile @"/dev/bpf0"
 
 static bool explicitlyLoadedAirportExtremeDriver = NO;
 
@@ -218,15 +218,17 @@
 #pragma mark -
 
 - (id)init {
+       NSUserDefaults *defs;
+    defs = [NSUserDefaults standardUserDefaults];
     char err[PCAP_ERRBUF_SIZE];
        
-       if (![[BLAuthentication sharedInstance] 
executeCommand:@"/usr/bin/chgrp" withArgs:[NSArray arrayWithObjects:@"admin", 
devFile, nil]]) return Nil;
-       if (![[BLAuthentication sharedInstance] executeCommand:@"/bin/chmod" 
withArgs:[NSArray arrayWithObjects:@"0660", devFile, nil]]) return Nil;
+       if (![[BLAuthentication sharedInstance] 
executeCommand:@"/usr/bin/chgrp" withArgs:[NSArray arrayWithObjects:@"admin", 
[defs objectForKey:@"bpfloc"], nil]]) return Nil;
+       if (![[BLAuthentication sharedInstance] executeCommand:@"/bin/chmod" 
withArgs:[NSArray arrayWithObjects:@"0660", [defs objectForKey:@"bpfloc"], 
nil]]) return Nil;
        [NSThread sleep:0.5];
        
-       _device = pcap_open_live([devicePath cString], 3000, 0, 2, err);
-       [[BLAuthentication sharedInstance] executeCommand:@"/usr/bin/chgrp" 
withArgs:[NSArray arrayWithObjects:@"admin", devFile, nil]];
-       [[BLAuthentication sharedInstance] executeCommand:@"/bin/chmod" 
withArgs:[NSArray arrayWithObjects:@"0660", devFile, nil]];
+       _device = pcap_open_live([[defs objectForKey:@"bpfdevice"] cString], 
3000, 0, 2, err);
+       [[BLAuthentication sharedInstance] executeCommand:@"/usr/bin/chgrp" 
withArgs:[NSArray arrayWithObjects:@"admin", [defs objectForKey:@"bpfloc"], 
nil]];
+       [[BLAuthentication sharedInstance] executeCommand:@"/bin/chmod" 
withArgs:[NSArray arrayWithObjects:@"0660", [defs objectForKey:@"bpfloc"], 
nil]];
 
        if (!_device) return Nil;
     


Other related posts:

  • » [kismac] [binaervarianz] r119 - in KisMACng: . KisMAC.xcodeproj Sources/Controller Sources/Core Sources/Crypto Sources/Preferences Sources/Preferences/PreferencePanes Sources/WaveDrivers