Edited the script for support files
authorDevon Kearns <dookie@kali.org>
Tue, 11 Dec 2012 00:20:37 +0000 (17:20 -0700)
committerDevon Kearns <dookie@kali.org>
Tue, 11 Dec 2012 00:20:37 +0000 (17:20 -0700)
debian/patches/edit-file-locations [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/edit-file-locations b/debian/patches/edit-file-locations
new file mode 100644 (file)
index 0000000..177fd33
--- /dev/null
@@ -0,0 +1,97 @@
+Coded the file locations to
+/usr/share/wol-e/
+--- a/wol-e.py
++++ b/wol-e.py
+@@ -52,14 +52,14 @@ class sniff:
+       
+         packet = str(EthDecoder().decode(data))
+-        writef("output.txt",packet) 
+-        lineList = readf('output.txt')
++        writef("/usr/share/wol-e/output.txt",packet) 
++        lineList = readf("/usr/share/wol-e/output.txt")
+         bcastframe = str(lineList[-7])
+         if len(packet) in range(509,514) and 'ffff' in bcastframe:
+           lastline1 = str(lineList[-1])
+           lastline = lastline1[0:14].replace(' ', '')
+           print "\t[*] Detected WOL Client power on: " + lastline + ". Saving to WOLClients.txt"
+-          writea("WOLClients.txt", lastline + " has been powed on using WOL\n")
++          writea("/usr/share/wol-e/WOLClients.txt", lastline + " has been powed on using WOL\n")
+         elif len(packet) > 514 and 'ffff' in bcastframe:
+           packet = str(packet)
+@@ -69,7 +69,7 @@ class sniff:
+           passofwol = hex(ord(password[0])).replace('0x', '') + ":" + hex(ord(password[1])).replace('0x', '') + ":" + hex(ord(password[2])).replace('0x', '') + ":" + hex(ord(password[3])).replace('0x', '') + ":" + hex(ord(password[4])).replace('0x', '') + ":" + hex(ord(password[5])).replace('0x', '')
+         print "\t[*] Detected WOL Client power on: " + lastline[0:2] + ":" + lastline[2:4] + ":" + lastline[4:6] + ":" + lastline[6:8] + ":" + lastline[8:10] + ":" + lastline[10:12]
+         print "\t[*] Password in Hex is: " + str(passofwol)
+-          writea("WOLClients.txt", str(lastline) + " has been powed on with a password of: " + str(passofwol) + "\n")
++          writea("/usr/share/wol-e/WOLClients.txt", str(lastline) + " has been powed on with a password of: " + str(passofwol) + "\n")
+           
+         else:
+           pass 
+@@ -122,11 +122,11 @@ def wake_on_lan(version):
+               for l in x2:
+                 if l in s and s not in x3:
+                   print "\t[*] Apple device detected: " + str(s) + ". saving to AppleTargets.txt"               
+-                  writea('AppleTargets.txt', str(s) + "\n")
++                  writea("/usr/share/wol-e/AppleTargets.txt", str(s) + "\n")
+              
+-          scanResults = readAndTrim('netscan.txt')
+-          loggedLines = readAndTrim('AppleMAC.lst')
+-          targetLines = readAndTrim('AppleTargets.txt')
++          scanResults = readAndTrim("/usr/share/wol-e/netscan.txt")
++          loggedLines = readAndTrim("/usr/share/wol-e/AppleMAC.lst")
++          targetLines = readAndTrim("/usr/share/wol-e/AppleTargets.txt")
+           
+           wOutput(scanResults,loggedLines,targetLines)
+           clearArp()
+@@ -136,7 +136,7 @@ def wake_on_lan(version):
+         def scan_and_print_neighbors(net, interface):
+           print "\t[*] arping", net, "on", interface
+           ans,unans = scapy.layers.l2.arping(net, iface=interface, timeout=1, verbose=False)#, verbose=True)
+-          d=open('netscan.txt', 'w')
++          d=open("/usr/share/wol-e/netscan.txt", 'w')
+           for s,r in ans.res:
+             array = []
+             array.append(r.sprintf("%Ether.src% %ARP.psrc%"))
+@@ -225,7 +225,7 @@ def wake_on_lan(version):
+     if sys.argv[1] == "-fa":
+         print "\n\t[*] WOL-E " + version + " [*]\n\t[*] Wake on LAN Explorer - WOL Detected Apple clients."
+         bcast = '255.255.255.255'
+-        apples = os.getcwd() + "/" + "AppleTargets.txt"
++        apples = "/usr/share/wol-e/AppleTargets.txt"
+         if os.path.exists(apples) == False:
+                 print "\n\t[*] Please ensure you have the AppleTargets.txt file in the current working directory.\n"
+                 sys.exit(2)
+@@ -261,7 +261,7 @@ def wake_on_lan(version):
+     if sys.argv[1] == "-a":
+         print "\n\t[*] WOL-E " + version + " [*]\n\t[*] Wake on LAN Explorer - WOL Bruteforce MAC ranges."
+         bcast = '255.255.255.255'
+-        macs = os.getcwd() + "/" + "bfmac.lst"
++        macs = "/usr/share/wol-e/bfmac.lst"
+     else:
+         print "\n\t[*] Unknown command, please see the help documentation for more information\n"
+         sys.exit(2)
+@@ -329,7 +329,7 @@ if __name__ == '__main__':
+           
+           print "\t-s"
+           print bold + "\t\tSniffing the network for WOL requests and passwords." + nobold
+-          print "\t\tAll captured WOL requests will be displayed on screen and written to WOLClients.txt."
++          print "\t\tAll captured WOL requests will be displayed on screen and written to /usr/share/wol-e/WOLClients.txt."
+           print bold + "\t\twol-e.py -s -i eth0\n" + nobold
+             
+           print "\t-a"
+@@ -342,11 +342,11 @@ if __name__ == '__main__':
+           
+           print "\t-f"
+           print bold + "\t\tDetecting Apple devices on the network for WOL enabling." + nobold
+-          print "\t\tThis will output to the screen and write to AppleTargets.txt for detected Apple MAC's."
++          print "\t\tThis will output to the screen and write to /usr/share/wol-e/AppleTargets.txt for detected Apple MAC's."
+           print bold + "\t\twol-e.py -f\n" + nobold
+           print "\t-fa"
+-          print bold + "\t\tAttempt to wake all detected Apple targets in AppleTargets.txt." + nobold
++          print bold + "\t\tAttempt to wake all detected Apple targets in /usr/share/wol-e/AppleTargets.txt." + nobold
+           print "\t\tThis will send a single WOL packet to each client in the list and tell you how many clients were attempted."
+           print bold + "\t\twol-e.py -fa\n" + nobold
+           
index 9b4d62d..4517546 100644 (file)
@@ -1 +1,2 @@
+edit-file-locations
 add-sys-path-append