text: #!/usr/bin/env python
  # Copyright (c) 2014 >> Muhammad Adeel
  
  import re, urllib, sys, os, time
  from designer import *
  from Functions import *
  from Modules import *
  
  class Logger(object):
      def __init__(self):
          self.terminal = sys.stdout
          self.log = open("Pentester-Toolkit.log", "a")
  
      def write(self, message):
          self.terminal.write(message)
          self.log.write(message)  
  
  sys.stdout = Logger()
  os.system('clear')
  print COLOR.bold + COLOR.green + '''
    ___         _          _              _____         _ _   _ _   
   | _ \___ _ _| |_ ___ __| |_ ___ _ _ __|_   _|__  ___| | |_(_) |_ 
   |  _/ -_) ' \  _/ -_|_-<  _/ -_) '_|___|| |/ _ \/ _ \ | / / |  _|
   |_| \___|_||_\__\___/__/\__\___|_|      |_|\___/\___/_|_\_\_|\__|
   
   ==================================================================
   # 'Pentester Toolkit' Modern WebApps Scanner                     #
   #  Version: 2.0                                                  #
   #  Author: Muhammad Adeel                                        #
   #  Mail - Chaudhary1337@gmail.com                                #
   #  Blog - http://urdusecurity.blogspot.com                       #
   #  Commands: 'help','scan','exit'                                #
   ==================================================================\n''' + COLOR.die
  print COLOR.bold + "[!] Always Check 'Pentester-Toolkit.log' For Your Scan results.\n" + COLOR.die
  
  def RunScan():
  	get_input = raw_input('1. Scan a Single URL\n2. Scan Multiple URLs\n\n(Select)>  ')
  	if get_input == '1':
  		optns = raw_input('(Command)> ')
  		if optns == 'scan':
  			url = raw_input('(URL)> ')
  			if not url.startswith('http'):
  				print COLOR.green + "Invalid URL" + COLOR.die + " Inser Url Like This: " + COLOR.red + "http://somesite.com" + COLOR.die
  				sys.exit()
  			if '?' not in url:
  				url = url + '/index.php?id=x'
  				CheckServer(url)
  				HttpOnly(url)
  				XframeOptions(url)
  				XxssPro(url)
  				xContentType(url)
  				SSLTLS(url)
  				secPol(url)
  				AccessControl(url)
  				Xdownload(url)
  				cache(url)
  				DNSMiscon(url)
  				Backup(url)
  				httpTrace(url)
  				RemoteCodeExecution(url)
  				XssTest(url)
  				ErrBsdSQLi(url)
  				dirTrans(url)
  			elif '?' in url:
  				CheckServer(url)
  				HttpOnly(url)
  				XframeOptions(url)
  				XxssPro(url)
  				xContentType(url)
  				SSLTLS(url)
  				secPol(url)
  				AccessControl(url)
  				Xdownload(url)
  				cache(url)
  				DNSMiscon(url)
  				Backup(url)
  				httpTrace(url)
  				RemoteCodeExecution(url)
  				XssTest(url)
  				ErrBsdSQLi(url)
  				dirTrans(url)
  			else:
  				lnk = line.strip()
  				url = lnk
  				print COLOR.bold + "[!] Invalid Url: {0}".format(url) + COLOR.die
  				sys.exit()
  		elif optns == 'help':
  			print COLOR.bold + "[!] Choose 'scan' option to Launch a Scan.\n" + COLOR.die
  			sys.exit()
  		else:
  			print COLOR.red + '[+] Exiting.. ' + COLOR.die
  			sys.exit()
  	elif get_input == '2':
  		lst = raw_input('(List Name[Ex:filename.txt])> ')
  		optns = raw_input('(Command)> ')
  		if optns == 'scan':
  			opnLst = open(lst).readlines()
  			for line in opnLst:
  				lnk = line.strip()
  				url = lnk
  				print COLOR.green + "\n[+] Now Scanning: {0}".format(url) + COLOR.die
  				if '?' not in url:
  					url = url + '/index.php?id=x'
  					CheckServer(url)
  					HttpOnly(url)
  					XframeOptions(url)
  					XxssPro(url)
  					xContentType(url)
  					SSLTLS(url)
  					secPol(url)
  					AccessControl(url)
  					Xdownload(url)
  					cache(url)
  					DNSMiscon(url)
  					Backup(url)
  					httpTrace(url)
  					RemoteCodeExecution(url)
  					XssTest(url)
  					ErrBsdSQLi(url)
  					dirTrans(url)
  				elif '?' in url:
  					CheckServer(url)
  					HttpOnly(url)
  					XframeOptions(url)
  					XxssPro(url)
  					xContentType(url)
  					SSLTLS(url)
  					secPol(url)
  					AccessControl(url)
  					Xdownload(url)
  					cache(url)
  					DNSMiscon(url)
  					Backup(url)
  					httpTrace(url)
  					RemoteCodeExecution(url)
  					XssTest(url)
  					ErrBsdSQLi(url)
  					dirTrans(url)
  				else:
  					lnk = line.strip()
  					url = lnk
  					print COLOR.bold + "[!] Invalid Url: {0}".format(url) + COLOR.die
  					sys.exit()
  		elif optns == 'help':
  			print COLOR.bold + "[!] Choose 'scan' option to Launch a Scan.\n" + COLOR.die
  			sys.exit()
  		else:
  			print COLOR.red + '[+] Exiting.. ' + COLOR.die
  			sys.exit()
  	else:
  		print COLOR.red + "[!] Invallid Choice" + COLOR.die
  		sys.exit()			
  
  RunScan()
  
  def main():
  	if __name__ == '__main__':
  		main()
  