├── Dev ├── Devploit.desktop └── kali-Devploit.png ├── Devploit ├── README.md ├── install ├── modules ├── discovery │ ├── DNS │ │ ├── Base.py │ │ ├── Base.pyc │ │ ├── Class.py │ │ ├── Class.pyc │ │ ├── Lib.py │ │ ├── Lib.pyc │ │ ├── Opcode.py │ │ ├── Opcode.pyc │ │ ├── Status.py │ │ ├── Status.pyc │ │ ├── Type.py │ │ ├── Type.pyc │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── lazy.py │ │ ├── lazy.pyc │ │ └── win32dns.py │ ├── IPy.py │ ├── IPy.pyc │ ├── __init__.py │ ├── __init__.pyc │ ├── asksearch.py │ ├── baidusearch.py │ ├── baidusearch.pyc │ ├── bingsearch.py │ ├── bingsearch.pyc │ ├── crtsh.py │ ├── crtsh.pyc │ ├── dnssearch-threads.py │ ├── dnssearch.py │ ├── dnssearch.pyc │ ├── dogpilesearch.py │ ├── dogpilesearch.pyc │ ├── exaleadsearch.py │ ├── exaleadsearch.pyc │ ├── googleCSE.py │ ├── googleCSE.pyc │ ├── googleplussearch.py │ ├── googleplussearch.pyc │ ├── googlesearch.py │ ├── googlesearch.pyc │ ├── googlesets.py │ ├── googlesets.pyc │ ├── jigsaw.py │ ├── jigsaw.pyc │ ├── linkedinsearch.py │ ├── linkedinsearch.pyc │ ├── netcraft.py │ ├── netcraft.pyc │ ├── pgpsearch.py │ ├── pgpsearch.pyc │ ├── shodan │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── api.py │ │ ├── api.pyc │ │ └── wps.py │ ├── shodansearch.py │ ├── shodansearch.pyc │ ├── twittersearch.py │ ├── twittersearch.pyc │ ├── virustotal.py │ ├── virustotal.pyc │ ├── yahoosearch.py │ ├── yahoosearch.pyc │ ├── yandexsearch.py │ └── yandexsearch.pyc ├── lib │ ├── __init__.py │ ├── __init__.pyc │ ├── graphs.py │ ├── graphs.pyc │ ├── hostchecker.py │ ├── hostchecker.pyc │ ├── htmlExport.py │ ├── htmlExport.pyc │ ├── markup.py │ └── markup.pyc ├── myparser.py ├── tests │ └── myparser_test.py └── theHarvester.py └── update.py /Dev/Devploit.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Devploit 3 | Encoding=UTF-8 4 | Exec=sh -c "Devploit;${SHELL:-bash}" 5 | Icon=kali-Devploit.png 6 | StartupNotify=false 7 | Terminal=true 8 | Type=Application 9 | Categories=01-info-gathering;01-04-network-scanners;02-vulnerability-analysis; 10 | X-Kali-Package=Devploit 11 | Name[C]=Devploit 12 | -------------------------------------------------------------------------------- /Dev/kali-Devploit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/Dev/kali-Devploit.png -------------------------------------------------------------------------------- /Devploit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #______ _ _ _ 3 | #| _ \ | | (_) | 4 | #| | | |_____ ___ __ | | ___ _| |_ 5 | #| | | / _ \ \ / / '_ \| |/ _ \| | __| 6 | #| |/ / __/\ V /| |_) | | (_) | | |_ 7 | #|___/ \___| \_/ | .__/|_|\___/|_|\__|2.3 8 | # | | 9 | # |_| 10 | # 11 | # Devploit . Version 2.3 12 | # Devploit - Information Gathering Tool 13 | ############################################ 14 | # Coder : Joker-Security 15 | # Twitter : https://twitter.com/SecurityJoker 16 | # YouTuB : https://www.youtube.com/c/Professionalhacker25 17 | # FaCeBook: https://www.facebook.com/kali.linux.pentesting.tutorials 18 | ############################################ 19 | from urllib2 import * 20 | from platform import system 21 | import sys 22 | def clear(): 23 | if system() == 'Linux': 24 | os.system("clear") 25 | if system() == 'Windows': 26 | os.system('cls') 27 | os.system('color a') 28 | else: 29 | pass 30 | def slowprint(s): 31 | for c in s + '\n': 32 | sys.stdout.write(c) 33 | sys.stdout.flush() 34 | time.sleep(4. / 100) 35 | banner = ''' 36 | , \033[96m 37 | |'. , ... \033[93m Devploit \033[91m - \033[92m Information Gathering Tool \033[91m 38 | | '-._ / ) 39 | .' .._ ', /_'-, 40 | ' / _'.'_\ /._)') \033[91m 41 | : / '_' '_' / _.' 42 | |E | |Q| |Q| / / 43 | .' _\ '-' '-' / 44 | .'--.(S ,__` ) / 45 | '-. _.' / \033[92m 46 | __.--'----( / 47 | _.-' : __\ / 48 | ( __.' :' :Y 49 | '. '._, : :| \033[96m 50 | '. ) :.__:| 51 | \ \______/ 52 | '._L/_H____] 53 | ==[[ .:: Name : Devploit ::.]]==\033[91m 54 | ==[[ .:: Version: 2.3 ::.]]==\033[96m 55 | ==[[ .:: Author : Joker-Security ::.]]==\033[92m 56 | ==[[ .:: Github : http://www.github.com/joker25000 ::.]]==\033[93m 57 | ==[[ .:: Twitter: https://twitter.com/SecurityJoker ::.]]==\033[95m 58 | ''' 59 | print banner 60 | def menu(): 61 | print''' 62 | \033[91m 1 \033[96m} \033[91m --\033[93m> \033[92m DNS Lookup 63 | \033[91m 2 \033[96m} \033[91m --\033[93m> \033[92m Whois Lookup 64 | \033[91m 3 \033[96m} \033[91m --\033[93m> \033[92m GeoIP Lookup 65 | \033[91m 4 \033[96m} \033[91m --\033[93m> \033[92m Subnet Lookup 66 | \033[91m 5 \033[96m} \033[91m --\033[93m> \033[92m Port Scanner 67 | \033[91m 6 \033[96m} \033[91m --\033[93m> \033[92m Extract Links 68 | \033[91m 7 \033[96m} \033[91m --\033[93m> \033[92m Zone Transfer 69 | \033[91m 8 \033[96m} \033[91m --\033[93m> \033[92m HTTP Header 70 | \033[91m 9 \033[96m} \033[91m --\033[93m> \033[92m Host Finder 71 | \033[91m 10\033[96m} \033[91m --\033[93m> \033[92m IP-Locator 72 | \033[91m 11\033[96m} \033[91m --\033[93m> \033[92m Traceroute 73 | \033[91m 12\033[96m} \033[91m --\033[93m> \033[92m Host DNS Finder 74 | \033[91m 13\033[96m} \033[91m --\033[93m> \033[92m Revrse IP Lookup 75 | \033[91m 14\033[96m} \033[91m --\033[93m> \033[92m Collection Email 76 | \033[91m 15\033[96m} \033[91m --\033[93m> \033[92m Install & Update 77 | \033[91m 16\033[96m} \033[91m --\033[93m> \033[92m About Me 78 | \033[91m 00\033[96m} \033[91m --\033[93m> \033[92m Exit 79 | ''' 80 | 81 | slowprint("\033[1;91mThis Is Simple Script By :\033[92m Joker-Security " + "\n \033[93m Let's Start \033[96m --> --> --> \033[91m ") 82 | 83 | menu() 84 | def ext(): 85 | ex = raw_input ('\033[92mContinue/Exit->-> ') 86 | if ex[0].upper() == 'E' : 87 | print 'Good-bye!!!' 88 | exit() 89 | else: 90 | clear() 91 | print banner 92 | menu() 93 | select() 94 | 95 | def select(): 96 | try: 97 | joker = input("\033[96mEnter \033[92m00/\033[91m16 -> -> ") 98 | if joker == 2: 99 | dz = raw_input('\033[91mEnter IP Address : \033[91m') 100 | whois = "http://api.hackertarget.com/whois/?q=" + dz 101 | dev = urlopen(whois).read() 102 | print (dev) 103 | ext() 104 | elif joker == 13: 105 | dz = raw_input('\033[92mEnter IP Address : \033[92m') 106 | revrse = "http://api.hackertarget.com/reverseiplookup/?q=" + dz 107 | lookup = urlopen(revrse).read() 108 | print (lookup) 109 | ext() 110 | elif joker == 1: 111 | dz = raw_input('\033[96mEntre Your Domain :\033[96m') 112 | dns = "http://api.hackertarget.com/dnslookup/?q=" + dz 113 | joker = urlopen(dns).read() 114 | print (joker) 115 | ext() 116 | elif joker == 3: 117 | dz = raw_input('\033[91mEnter IP Address : \033[91m') 118 | geo = "http://api.hackertarget.com/geoip/?q=" + dz 119 | ip = urlopen(geo).read() 120 | print (ip) 121 | ext() 122 | elif joker == 4: 123 | dz = raw_input('\033[92mEnter IP Address : \033[92m') 124 | sub = "http://api.hackertarget.com/subnetcalc/?q=" + dz 125 | net = urlopen(sub).read() 126 | print (net) 127 | ext() 128 | elif joker == 5: 129 | dz = raw_input('\033[96mEnter IP Address : \033[96m') 130 | port = "http://api.hackertarget.com/nmap/?q=" + dz 131 | scan = urlopen(port).read() 132 | print (scan) 133 | ext() 134 | elif joker == 6: 135 | dz = raw_input('\033[91mEntre Your Domain :\033[91m') 136 | get = "https://api.hackertarget.com/pagelinks/?q=" + dz 137 | page = urlopen(get).read() 138 | print(page) 139 | ext() 140 | elif joker == 7: 141 | dz = raw_input('\033[92mEntre Your Domain :\033[92m') 142 | zon = "http://api.hackertarget.com/zonetransfer/?q=" + dz 143 | tran = urlopen(zon).read() 144 | print (tran) 145 | ext() 146 | elif joker == 8: 147 | dz = raw_input('\033[96mEntre Your Domain :\033[96m') 148 | hea = "http://api.hackertarget.com/httpheaders/?q=" + dz 149 | der = urlopen(hea).read() 150 | print (der) 151 | ext() 152 | elif joker == 9: 153 | dz = raw_input('\033[91mEntre Your Domain :\033[91m') 154 | host = "http://api.hackertarget.com/hostsearch/?q=" + dz 155 | finder = urlopen(host).read() 156 | print (finder) 157 | ext() 158 | elif joker == 10: 159 | dz = raw_input('\033[91mEntre Your IP Address :\033[91m') 160 | host = "http://ip-api.com/json/" + dz 161 | kader = urlopen(host).read() 162 | print (kader) 163 | ext() 164 | elif joker == 11: 165 | dz = raw_input('\033[1;91mEnter Domain: \033[1;m') 166 | host = "http://api.hackertarget.com/findshareddns/?q=" + dz 167 | dns = urlopen(host).read() 168 | print (dns) 169 | ext() 170 | elif joker == 12: 171 | dz = raw_input('\033[91mEntre Your Domain :\033[91m') 172 | get = "https://api.hackertarget.com/mtr/?q=" + dz 173 | page = urlopen(get).read() 174 | print(page) 175 | ext() 176 | elif joker == 14: 177 | dz = raw_input('\033[91mEntre Your Domain :\033[91m') 178 | path = os.getcwd() 179 | os.system('cd ' + path + '/modules && python2 theHarvester.py -d %s -b all' % dz) 180 | ext() 181 | elif joker == 15: 182 | print("This property operates only in Linux systems\033[92m") 183 | path = os.getcwd() 184 | os.system('cd ' + path + ' && bash install') 185 | os.system('cd ' + path + ' && python2 update.py') 186 | ext() 187 | elif joker == 16: 188 | slowprint("............... ") 189 | slowprint("Name : Devploit \033[92m") 190 | slowprint("...............") 191 | slowprint("Version : 2.3 \033[91m") 192 | slowprint(".............") 193 | slowprint("Author: Joker-Security \033[96m") 194 | slowprint("......................") 195 | slowprint("Github : http://www.github.com/joker25000 \033[92m") 196 | slowprint(".........................................") 197 | slowprint("Twitter : https://twitter.com/SecurityJoker \033[91m") 198 | slowprint("...........................................") 199 | slowprint("Youtube : https://www.youtube.com/c/Professionalhacker25 \033[96m") 200 | slowprint("........................................................") 201 | slowprint("Facebook : http://facebook.com/kali.linux.pentesting.tutorials \033[96m ") 202 | slowprint(".............................................................. ") 203 | ext() 204 | elif joker == 00: 205 | print "Good-bye!!" 206 | except(KeyboardInterrupt): 207 | print "\nCtrl + C -> Exiting!!" 208 | select() 209 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Version](https://img.shields.io/badge/Devploit-v2.3-brightgreen.svg?maxAge=259200)]() 2 | [![Python 2.x](https://img.shields.io/badge/python-2.x-blue.svg)]() 3 | [![Stage](https://img.shields.io/badge/Release-Stable-brightgreen.svg)]() 4 | [![Build](https://img.shields.io/badge/Supported_OS-Ubuntu,Kali,Mint,Parrot-blue,Windows,Android.svg)]() 5 | [![AUR](https://img.shields.io/aur/license/yaourt.svg)]() 6 | ## ★ Devploit . version 2.3 7 | 8 | Author: Joker-Security [ dev-labs ] 9 | 10 | ## ★ Description: 11 | 12 | Devploit is a simple python script to Information Gathering 13 | 14 | ## ★ Download: 15 | 16 | ● git clone https://github.com/joker25000/Devploit 17 | 18 | ## ★ How to use: 19 | 20 | cd Devploit 21 | 22 | chmod +x install 23 | 24 | ./install 25 | 26 | Run in Terminal 27 | 28 | Devploit 29 | 30 | (To run in Android you do not install file Run direct python2 Devploit) 31 | ## ★ Properties : 32 | 33 | ● DNS Lookup 34 | ● Whois Lookup 35 | ● GeoIP Lookup 36 | ● Subnet Lookup 37 | ● Port Scanner 38 | ● Extract Links 39 | ● Zone Transfer 40 | ● HTTP Header 41 | ● Host Finder 42 | ● IP-Locator 43 | ● Traceroute 44 | ● Host DNS Finder 45 | ● Revrse IP Lookup 46 | ● Collection Email 47 | ● Install & Update 48 | ● About Me 49 | ● Exit 50 | 51 | ## ★ Screenshot: 52 | 53 | 54 | 55 | 56 | ## ★ video tutorial: 57 | 58 | [![ Devploit - Information Gathering Tool (Version 2.3) ](https://i.ytimg.com/vi/jJ9cZ-IcLg4/hqdefault.jpg)](https://www.youtube.com/watch?v=jJ9cZ-IcLg4) 59 | 60 | ## ★ About: 61 | 62 | ● YOUTUBE : https://www.youtube.com/c/Professionalhacker25 63 | 64 | ● Twitter : https://twitter.com/SecurityJoker 65 | 66 | ● FACE Pg : https://facebook.com/kali.linux.pentesting.tutorials 67 | 68 | ● Tested On : Windows / Linux / Android Phone (Termux No root) 69 | 70 | -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | # author : Joker-Security 5 | # Tested on Kali Linux / lxle-linux / Parrot Os 6 | # Simple script for Install Devploit 7 | #Colors 8 | cyan='\e[0;36m' 9 | green='\e[0;32m' 10 | lightgreen='\e[1;32m' 11 | white='\e[1;37m' 12 | red='\e[1;31m' 13 | yellow='\e[1;33m' 14 | blue='\e[1;34m' 15 | #Options 16 | path=`pwd` # Path 17 | VeR="V2.3" # Version 18 | #Check root exist 19 | [[ `id -u` -eq 0 ]] > /dev/null 2>&1 || { echo $red "You must be root to run the script"; exit 1; } 20 | echo -e $cyan "" 21 | echo " ____ __ _ __ "; 22 | echo " / __ \___ _ ______ / /___ (_) /_ "; 23 | echo " / / / / _ \ | / / __ \/ / __ \/ / __/ "; 24 | echo " / /_/ / __/ |/ / /_/ / / /_/ / / /_ "; 25 | echo "/_____/\___/|___/ .___/_/\____/_/\__/$VeR "; 26 | echo " /_/ "; 27 | echo -e $white "------------------------------" 28 | echo -e $red "[ ✔ ] Installer The Tool [ ✔ ] "; 29 | echo -e $white "------------------------------" 30 | echo -e $green "[ ! ] Moving Devploit folder " 31 | mkdir /usr/share/Devploit 32 | cp install /usr/share/Devploit 33 | cp Devploit /usr/share/Devploit 34 | cp update.py /usr/share/Devploit 35 | cp -r modules /usr/share/Devploit 36 | echo -e $blue "[ ✔ ]Done" 37 | echo "#!/bin/sh" >> /usr/bin/Devploit 38 | echo "cd /usr/share/Devploit" >> /usr/bin/Devploit 39 | echo "exec python Devploit \"\$@\"" >> /usr/bin/Devploit 40 | cp $path/Dev/Devploit.desktop /usr/share/applications/Devploit.desktop 41 | cp $path/Dev/kali-Devploit.png /usr/share/icons/kali-Devploit.png 42 | cp Devploit /usr/local/sbin/Devploit 43 | chmod +x /usr/local/sbin/Devploit 44 | chmod +x Devploit 45 | echo -e $white "------------------------------------------------------------------------" 46 | echo -e $red "[ ✔ ] Devploit Is Installed In Application (information gathering) [ ✔ ]" 47 | echo -e $white "------------------------------------------------------------------------" 48 | echo -e $green"╔────────────────────────────╗ " 49 | echo -e $blue "|Run in Terminal<(Devploit)> | " 50 | echo -e $green"╚────────────────────────────╝ " 51 | exit 52 | -------------------------------------------------------------------------------- /modules/discovery/DNS/Base.py: -------------------------------------------------------------------------------- 1 | """ 2 | $Id: Base.py,v 1.12.2.4 2007/05/22 20:28:31 customdesigned Exp $ 3 | 4 | This file is part of the pydns project. 5 | Homepage: http://pydns.sourceforge.net 6 | 7 | This code is covered by the standard Python License. 8 | 9 | Base functionality. Request and Response classes, that sort of thing. 10 | """ 11 | 12 | import socket 13 | import string 14 | import types 15 | import time 16 | import Type 17 | import Class 18 | import Opcode 19 | import asyncore 20 | 21 | 22 | class DNSError(Exception): 23 | pass 24 | 25 | defaults = {'protocol': 'udp', 'port': 53, 'opcode': Opcode.QUERY, 26 | 'qtype': Type.A, 'rd': 1, 'timing': 1, 'timeout': 30} 27 | 28 | defaults['server'] = [] 29 | 30 | 31 | def ParseResolvConf(resolv_path): 32 | global defaults 33 | try: 34 | lines = open(resolv_path).readlines() 35 | except: 36 | print "error in path" + resolv_path 37 | for line in lines: 38 | line = string.strip(line) 39 | if not line or line[0] == ';' or line[0] == '#': 40 | continue 41 | fields = string.split(line) 42 | if len(fields) < 2: 43 | continue 44 | if fields[0] == 'domain' and len(fields) > 1: 45 | defaults['domain'] = fields[1] 46 | if fields[0] == 'search': 47 | pass 48 | if fields[0] == 'options': 49 | pass 50 | if fields[0] == 'sortlist': 51 | pass 52 | if fields[0] == 'nameserver': 53 | defaults['server'].append(fields[1]) 54 | 55 | 56 | def DiscoverNameServers(): 57 | import sys 58 | if sys.platform in ('win32', 'nt'): 59 | import win32dns 60 | defaults['server'] = win32dns.RegistryResolve() 61 | else: 62 | return ParseResolvConf() 63 | 64 | 65 | class DnsRequest: 66 | 67 | """ high level Request object """ 68 | 69 | def __init__(self, *name, **args): 70 | self.donefunc = None 71 | self.async = None 72 | self.defaults = {} 73 | self.argparse(name, args) 74 | self.defaults = self.args 75 | 76 | def argparse(self, name, args): 77 | if not name and 'name' in self.defaults: 78 | args['name'] = self.defaults['name'] 79 | if isinstance(name, types.StringType): 80 | args['name'] = name 81 | else: 82 | if len(name) == 1: 83 | if name[0]: 84 | args['name'] = name[0] 85 | for i in defaults.keys(): 86 | if i not in args: 87 | if i in self.defaults: 88 | args[i] = self.defaults[i] 89 | else: 90 | args[i] = defaults[i] 91 | if isinstance(args['server'], types.StringType): 92 | args['server'] = [args['server']] 93 | self.args = args 94 | 95 | def socketInit(self, a, b): 96 | self.s = socket.socket(a, b) 97 | 98 | def processUDPReply(self): 99 | import time 100 | import select 101 | if self.args['timeout'] > 0: 102 | r, w, e = select.select([self.s], [], [], self.args['timeout']) 103 | if not len(r): 104 | raise DNSError('Timeout') 105 | self.reply = self.s.recv(1024) 106 | self.time_finish = time.time() 107 | self.args['server'] = self.ns 108 | return self.processReply() 109 | 110 | def processTCPReply(self): 111 | import time 112 | import Lib 113 | self.f = self.s.makefile('r') 114 | header = self.f.read(2) 115 | if len(header) < 2: 116 | raise DNSError('EOF') 117 | count = Lib.unpack16bit(header) 118 | self.reply = self.f.read(count) 119 | if len(self.reply) != count: 120 | raise DNSError('incomplete reply') 121 | self.time_finish = time.time() 122 | self.args['server'] = self.ns 123 | return self.processReply() 124 | 125 | def processReply(self): 126 | import Lib 127 | self.args['elapsed'] = (self.time_finish - self.time_start) * 1000 128 | u = Lib.Munpacker(self.reply) 129 | r = Lib.DnsResult(u, self.args) 130 | r.args = self.args 131 | # self.args=None # mark this DnsRequest object as used. 132 | return r 133 | #### TODO TODO TODO #### 134 | # if protocol == 'tcp' and qtype == Type.AXFR: 135 | # while 1: 136 | # header = f.read(2) 137 | # if len(header) < 2: 138 | # print '========== EOF ==========' 139 | # break 140 | # count = Lib.unpack16bit(header) 141 | # if not count: 142 | # print '========== ZERO COUNT ==========' 143 | # break 144 | # print '========== NEXT ==========' 145 | # reply = f.read(count) 146 | # if len(reply) != count: 147 | # print '*** Incomplete reply ***' 148 | # break 149 | # u = Lib.Munpacker(reply) 150 | # Lib.dumpM(u) 151 | 152 | def conn(self): 153 | self.s.connect((self.ns, self.port)) 154 | 155 | def req(self, *name, **args): 156 | " needs a refactoring " 157 | import time 158 | import Lib 159 | self.argparse(name, args) 160 | # if not self.args: 161 | # raise DNSError,'reinitialize request before reuse' 162 | protocol = self.args['protocol'] 163 | self.port = self.args['port'] 164 | opcode = self.args['opcode'] 165 | rd = self.args['rd'] 166 | server = self.args['server'] 167 | if isinstance(self.args['qtype'], types.StringType): 168 | try: 169 | qtype = getattr(Type, string.upper(self.args['qtype'])) 170 | except AttributeError: 171 | raise DNSError('unknown query type') 172 | else: 173 | qtype = self.args['qtype'] 174 | if 'name' not in self.args: 175 | print self.args 176 | raise DNSError('nothing to lookup') 177 | qname = self.args['name'] 178 | if qtype == Type.AXFR: 179 | print 'Query type AXFR, protocol forced to TCP' 180 | protocol = 'tcp' 181 | # print 'QTYPE %d(%s)' % (qtype, Type.typestr(qtype)) 182 | m = Lib.Mpacker() 183 | # jesus. keywords and default args would be good. TODO. 184 | m.addHeader(0, 185 | 0, opcode, 0, 0, rd, 0, 0, 0, 186 | 1, 0, 0, 0) 187 | m.addQuestion(qname, qtype, Class.IN) 188 | self.request = m.getbuf() 189 | try: 190 | if protocol == 'udp': 191 | self.sendUDPRequest(server) 192 | else: 193 | self.sendTCPRequest(server) 194 | except socket.error as reason: 195 | raise DNSError(reason) 196 | if self.async: 197 | return None 198 | else: 199 | return self.response 200 | 201 | def sendUDPRequest(self, server): 202 | "refactor me" 203 | self.response = None 204 | self.socketInit(socket.AF_INET, socket.SOCK_DGRAM) 205 | for self.ns in server: 206 | try: 207 | # TODO. Handle timeouts &c correctly (RFC) 208 | #self.s.connect((self.ns, self.port)) 209 | self.conn() 210 | self.time_start = time.time() 211 | if not self.async: 212 | self.s.send(self.request) 213 | self.response = self.processUDPReply() 214 | # except socket.error: 215 | except None: 216 | continue 217 | break 218 | if not self.response: 219 | if not self.async: 220 | raise DNSError('no working nameservers found') 221 | 222 | def sendTCPRequest(self, server): 223 | " do the work of sending a TCP request " 224 | import time 225 | import Lib 226 | self.response = None 227 | for self.ns in server: 228 | try: 229 | self.socketInit(socket.AF_INET, socket.SOCK_STREAM) 230 | self.time_start = time.time() 231 | self.conn() 232 | self.s.send(Lib.pack16bit(len(self.request)) + self.request) 233 | self.s.shutdown(1) 234 | self.response = self.processTCPReply() 235 | except socket.error: 236 | continue 237 | break 238 | if not self.response: 239 | raise DNSError('no working nameservers found') 240 | 241 | # class DnsAsyncRequest(DnsRequest): 242 | 243 | 244 | class DnsAsyncRequest(DnsRequest, asyncore.dispatcher_with_send): 245 | 246 | " an asynchronous request object. out of date, probably broken " 247 | 248 | def __init__(self, *name, **args): 249 | DnsRequest.__init__(self, *name, **args) 250 | # XXX todo 251 | if 'done' in args and args['done']: 252 | self.donefunc = args['done'] 253 | else: 254 | self.donefunc = self.showResult 255 | # self.realinit(name,args) # XXX todo 256 | self.async = 1 257 | 258 | def conn(self): 259 | import time 260 | self.connect((self.ns, self.port)) 261 | self.time_start = time.time() 262 | if 'start' in self.args and self.args['start']: 263 | asyncore.dispatcher.go(self) 264 | 265 | def socketInit(self, a, b): 266 | self.create_socket(a, b) 267 | asyncore.dispatcher.__init__(self) 268 | self.s = self 269 | 270 | def handle_read(self): 271 | if self.args['protocol'] == 'udp': 272 | self.response = self.processUDPReply() 273 | if self.donefunc: 274 | self.donefunc(*(self,)) 275 | 276 | def handle_connect(self): 277 | self.send(self.request) 278 | 279 | def handle_write(self): 280 | pass 281 | 282 | def showResult(self, *s): 283 | self.response.show() 284 | 285 | # 286 | # $Log: Base.py,v $ 287 | # Revision 1.12.2.4 2007/05/22 20:28:31 customdesigned 288 | # Missing import Lib 289 | # 290 | # Revision 1.12.2.3 2007/05/22 20:25:52 customdesigned 291 | # Use socket.inetntoa,inetaton. 292 | # 293 | # Revision 1.12.2.2 2007/05/22 20:21:46 customdesigned 294 | # Trap socket error 295 | # 296 | # Revision 1.12.2.1 2007/05/22 20:19:35 customdesigned 297 | # Skip bogus but non-empty lines in resolv.conf 298 | # 299 | # Revision 1.12 2002/04/23 06:04:27 anthonybaxter 300 | # attempt to refactor the DNSRequest.req method a little. after doing a bit 301 | # of this, I've decided to bite the bullet and just rewrite the puppy. will 302 | # be checkin in some design notes, then unit tests and then writing the sod. 303 | # 304 | # Revision 1.11 2002/03/19 13:05:02 anthonybaxter 305 | # converted to class based exceptions (there goes the python1.4 compatibility :) 306 | # 307 | # removed a quite gross use of 'eval()'. 308 | # 309 | # Revision 1.10 2002/03/19 12:41:33 anthonybaxter 310 | # tabnannied and reindented everything. 4 space indent, no tabs. 311 | # yay. 312 | # 313 | # Revision 1.9 2002/03/19 12:26:13 anthonybaxter 314 | # death to leading tabs. 315 | # 316 | # Revision 1.8 2002/03/19 10:30:33 anthonybaxter 317 | # first round of major bits and pieces. The major stuff here (summarised 318 | # from my local, off-net CVS server :/ this will cause some oddities with 319 | # the 320 | # 321 | # tests/testPackers.py: 322 | # a large slab of unit tests for the packer and unpacker code in DNS.Lib 323 | # 324 | # DNS/Lib.py: 325 | # placeholder for addSRV. 326 | # added 'klass' to addA, make it the same as the other A* records. 327 | # made addTXT check for being passed a string, turn it into a length 1 list. 328 | # explicitly check for adding a string of length > 255 (prohibited). 329 | # a bunch of cleanups from a first pass with pychecker 330 | # new code for pack/unpack. the bitwise stuff uses struct, for a smallish 331 | # (disappointly small, actually) improvement, while addr2bin is much 332 | # much faster now. 333 | # 334 | # DNS/Base.py: 335 | # added DiscoverNameServers. This automatically does the right thing 336 | # on unix/ win32. No idea how MacOS handles this. *sigh* 337 | # Incompatible change: Don't use ParseResolvConf on non-unix, use this 338 | # function, instead! 339 | # a bunch of cleanups from a first pass with pychecker 340 | # 341 | # Revision 1.5 2001/08/09 09:22:28 anthonybaxter 342 | # added what I hope is win32 resolver lookup support. I'll need to try 343 | # and figure out how to get the CVS checkout onto my windows machine to 344 | # make sure it works (wow, doing something other than games on the 345 | # windows machine :) 346 | # 347 | # Code from Wolfgang.Strobl@gmd.de 348 | # win32dns.py from 349 | # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66260 350 | # 351 | # Really, ParseResolvConf() should be renamed "FindNameServers" or 352 | # some such. 353 | # 354 | # Revision 1.4 2001/08/09 09:08:55 anthonybaxter 355 | # added identifying header to top of each file 356 | # 357 | # Revision 1.3 2001/07/19 07:20:12 anthony 358 | # Handle blank resolv.conf lines. 359 | # Patch from Bastian Kleineidam 360 | # 361 | # Revision 1.2 2001/07/19 06:57:07 anthony 362 | # cvs keywords added 363 | # 364 | # 365 | -------------------------------------------------------------------------------- /modules/discovery/DNS/Base.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/DNS/Base.pyc -------------------------------------------------------------------------------- /modules/discovery/DNS/Class.py: -------------------------------------------------------------------------------- 1 | """ 2 | $Id: Class.py,v 1.6 2002/04/23 12:52:19 anthonybaxter Exp $ 3 | 4 | This file is part of the pydns project. 5 | Homepage: http://pydns.sourceforge.net 6 | 7 | This code is covered by the standard Python License. 8 | 9 | CLASS values (section 3.2.4) 10 | """ 11 | 12 | 13 | IN = 1 # the Internet 14 | CS = 2 # the CSNET class (Obsolete - used only for examples in 15 | # some obsolete RFCs) 16 | CH = 3 # the CHAOS class. When someone shows me python running on 17 | # a Symbolics Lisp machine, I'll look at implementing this. 18 | HS = 4 # Hesiod [Dyer 87] 19 | 20 | # QCLASS values (section 3.2.5) 21 | 22 | ANY = 255 # any class 23 | 24 | 25 | # Construct reverse mapping dictionary 26 | 27 | _names = dir() 28 | classmap = {} 29 | for _name in _names: 30 | if _name[0] != '_': 31 | classmap[eval(_name)] = _name 32 | 33 | 34 | def classstr(klass): 35 | if klass in classmap: 36 | return classmap[klass] 37 | else: 38 | return repr(klass) 39 | 40 | # 41 | # $Log: Class.py,v $ 42 | # Revision 1.6 2002/04/23 12:52:19 anthonybaxter 43 | # cleanup whitespace. 44 | # 45 | # Revision 1.5 2002/03/19 12:41:33 anthonybaxter 46 | # tabnannied and reindented everything. 4 space indent, no tabs. 47 | # yay. 48 | # 49 | # Revision 1.4 2002/03/19 12:26:13 anthonybaxter 50 | # death to leading tabs. 51 | # 52 | # Revision 1.3 2001/08/09 09:08:55 anthonybaxter 53 | # added identifying header to top of each file 54 | # 55 | # Revision 1.2 2001/07/19 06:57:07 anthony 56 | # cvs keywords added 57 | # 58 | # 59 | -------------------------------------------------------------------------------- /modules/discovery/DNS/Class.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/DNS/Class.pyc -------------------------------------------------------------------------------- /modules/discovery/DNS/Lib.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/DNS/Lib.py -------------------------------------------------------------------------------- /modules/discovery/DNS/Lib.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/DNS/Lib.pyc -------------------------------------------------------------------------------- /modules/discovery/DNS/Opcode.py: -------------------------------------------------------------------------------- 1 | """ 2 | $Id: Opcode.py,v 1.6 2002/04/23 10:51:43 anthonybaxter Exp $ 3 | 4 | This file is part of the pydns project. 5 | Homepage: http://pydns.sourceforge.net 6 | 7 | This code is covered by the standard Python License. 8 | 9 | Opcode values in message header. RFC 1035, 1996, 2136. 10 | """ 11 | 12 | 13 | QUERY = 0 14 | IQUERY = 1 15 | STATUS = 2 16 | NOTIFY = 4 17 | UPDATE = 5 18 | 19 | # Construct reverse mapping dictionary 20 | 21 | _names = dir() 22 | opcodemap = {} 23 | for _name in _names: 24 | if _name[0] != '_': 25 | opcodemap[eval(_name)] = _name 26 | 27 | 28 | def opcodestr(opcode): 29 | if opcode in opcodemap: 30 | return opcodemap[opcode] 31 | else: 32 | return repr(opcode) 33 | 34 | # 35 | # $Log: Opcode.py,v $ 36 | # Revision 1.6 2002/04/23 10:51:43 anthonybaxter 37 | # Added UPDATE, NOTIFY. 38 | # 39 | # Revision 1.5 2002/03/19 12:41:33 anthonybaxter 40 | # tabnannied and reindented everything. 4 space indent, no tabs. 41 | # yay. 42 | # 43 | # Revision 1.4 2002/03/19 12:26:13 anthonybaxter 44 | # death to leading tabs. 45 | # 46 | # Revision 1.3 2001/08/09 09:08:55 anthonybaxter 47 | # added identifying header to top of each file 48 | # 49 | # Revision 1.2 2001/07/19 06:57:07 anthony 50 | # cvs keywords added 51 | # 52 | # 53 | -------------------------------------------------------------------------------- /modules/discovery/DNS/Opcode.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/DNS/Opcode.pyc -------------------------------------------------------------------------------- /modules/discovery/DNS/Status.py: -------------------------------------------------------------------------------- 1 | """ 2 | $Id: Status.py,v 1.7 2002/04/23 12:52:19 anthonybaxter Exp $ 3 | 4 | This file is part of the pydns project. 5 | Homepage: http://pydns.sourceforge.net 6 | 7 | This code is covered by the standard Python License. 8 | 9 | Status values in message header 10 | """ 11 | 12 | NOERROR = 0 # No Error [RFC 1035] 13 | FORMERR = 1 # Format Error [RFC 1035] 14 | SERVFAIL = 2 # Server Failure [RFC 1035] 15 | NXDOMAIN = 3 # Non-Existent Domain [RFC 1035] 16 | NOTIMP = 4 # Not Implemented [RFC 1035] 17 | REFUSED = 5 # Query Refused [RFC 1035] 18 | YXDOMAIN = 6 # Name Exists when it should not [RFC 2136] 19 | YXRRSET = 7 # RR Set Exists when it should not [RFC 2136] 20 | NXRRSET = 8 # RR Set that should exist does not [RFC 2136] 21 | NOTAUTH = 9 # Server Not Authoritative for zone [RFC 2136] 22 | NOTZONE = 10 # Name not contained in zone [RFC 2136] 23 | BADVERS = 16 # Bad OPT Version [RFC 2671] 24 | BADSIG = 16 # TSIG Signature Failure [RFC 2845] 25 | BADKEY = 17 # Key not recognized [RFC 2845] 26 | BADTIME = 18 # Signature out of time window [RFC 2845] 27 | BADMODE = 19 # Bad TKEY Mode [RFC 2930] 28 | BADNAME = 20 # Duplicate key name [RFC 2930] 29 | BADALG = 21 # Algorithm not supported [RFC 2930] 30 | 31 | # Construct reverse mapping dictionary 32 | 33 | _names = dir() 34 | statusmap = {} 35 | for _name in _names: 36 | if _name[0] != '_': 37 | statusmap[eval(_name)] = _name 38 | 39 | 40 | def statusstr(status): 41 | if status in statusmap: 42 | return statusmap[status] 43 | else: 44 | return repr(status) 45 | 46 | # 47 | # $Log: Status.py,v $ 48 | # Revision 1.7 2002/04/23 12:52:19 anthonybaxter 49 | # cleanup whitespace. 50 | # 51 | # Revision 1.6 2002/04/23 10:57:57 anthonybaxter 52 | # update to complete the list of response codes. 53 | # 54 | # Revision 1.5 2002/03/19 12:41:33 anthonybaxter 55 | # tabnannied and reindented everything. 4 space indent, no tabs. 56 | # yay. 57 | # 58 | # Revision 1.4 2002/03/19 12:26:13 anthonybaxter 59 | # death to leading tabs. 60 | # 61 | # Revision 1.3 2001/08/09 09:08:55 anthonybaxter 62 | # added identifying header to top of each file 63 | # 64 | # Revision 1.2 2001/07/19 06:57:07 anthony 65 | # cvs keywords added 66 | # 67 | # 68 | -------------------------------------------------------------------------------- /modules/discovery/DNS/Status.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/DNS/Status.pyc -------------------------------------------------------------------------------- /modules/discovery/DNS/Type.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/DNS/Type.py -------------------------------------------------------------------------------- /modules/discovery/DNS/Type.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/DNS/Type.pyc -------------------------------------------------------------------------------- /modules/discovery/DNS/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | # $Id: __init__.py,v 1.8.2.2 2007/05/22 21:06:52 customdesigned Exp $ 3 | # 4 | # This file is part of the pydns project. 5 | # Homepage: http://pydns.sourceforge.net 6 | # 7 | # This code is covered by the standard Python License. 8 | # 9 | 10 | # __init__.py for DNS class. 11 | 12 | __version__ = '2.3.1' 13 | 14 | import Type 15 | import Opcode 16 | import Status 17 | import Class 18 | from Base import DnsRequest, DNSError 19 | from Lib import DnsResult 20 | from Base import * 21 | from Lib import * 22 | Error = DNSError 23 | from lazy import * 24 | Request = DnsRequest 25 | Result = DnsResult 26 | 27 | # 28 | # $Log: __init__.py,v $ 29 | # Revision 1.8.2.2 2007/05/22 21:06:52 customdesigned 30 | # utf-8 in __init__.py 31 | # 32 | # Revision 1.8.2.1 2007/05/22 20:39:20 customdesigned 33 | # Release 2.3.1 34 | # 35 | # Revision 1.8 2002/05/06 06:17:49 anthonybaxter 36 | # found that the old README file called itself release 2.2. So make 37 | # this one 2.3... 38 | # 39 | # Revision 1.7 2002/05/06 06:16:15 anthonybaxter 40 | # make some sort of reasonable version string. releasewards ho! 41 | # 42 | # Revision 1.6 2002/03/19 13:05:02 anthonybaxter 43 | # converted to class based exceptions (there goes the python1.4 compatibility :) 44 | # 45 | # removed a quite gross use of 'eval()'. 46 | # 47 | # Revision 1.5 2002/03/19 12:41:33 anthonybaxter 48 | # tabnannied and reindented everything. 4 space indent, no tabs. 49 | # yay. 50 | # 51 | # Revision 1.4 2001/11/26 17:57:51 stroeder 52 | # Added __version__ 53 | # 54 | # Revision 1.3 2001/08/09 09:08:55 anthonybaxter 55 | # added identifying header to top of each file 56 | # 57 | # Revision 1.2 2001/07/19 06:57:07 anthony 58 | # cvs keywords added 59 | # 60 | # 61 | -------------------------------------------------------------------------------- /modules/discovery/DNS/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/DNS/__init__.pyc -------------------------------------------------------------------------------- /modules/discovery/DNS/lazy.py: -------------------------------------------------------------------------------- 1 | # $Id: lazy.py,v 1.5.2.1 2007/05/22 20:23:38 customdesigned Exp $ 2 | # 3 | # This file is part of the pydns project. 4 | # Homepage: http://pydns.sourceforge.net 5 | # 6 | # This code is covered by the standard Python License. 7 | # 8 | 9 | # routines for lazy people. 10 | import Base 11 | import string 12 | 13 | 14 | def revlookup(name): 15 | "convenience routine for doing a reverse lookup of an address" 16 | if Base.defaults['server'] == []: 17 | Base.DiscoverNameServers() 18 | a = string.split(name, '.') 19 | a.reverse() 20 | b = string.join(a, '.') + '.in-addr.arpa' 21 | # this will only return one of any records returned. 22 | return Base.DnsRequest(b, qtype='ptr').req().answers[0]['data'] 23 | 24 | 25 | def mxlookup(name): 26 | """ 27 | convenience routine for doing an MX lookup of a name. returns a 28 | sorted list of (preference, mail exchanger) records 29 | """ 30 | if Base.defaults['server'] == []: 31 | Base.DiscoverNameServers() 32 | a = Base.DnsRequest(name, qtype='mx').req().answers 33 | l = sorted(map(lambda x: x['data'], a)) 34 | return l 35 | 36 | # 37 | # $Log: lazy.py,v $ 38 | # Revision 1.5.2.1 2007/05/22 20:23:38 customdesigned 39 | # Lazy call to DiscoverNameServers 40 | # 41 | # Revision 1.5 2002/05/06 06:14:38 anthonybaxter 42 | # reformat, move import to top of file. 43 | # 44 | # Revision 1.4 2002/03/19 12:41:33 anthonybaxter 45 | # tabnannied and reindented everything. 4 space indent, no tabs. 46 | # yay. 47 | # 48 | # Revision 1.3 2001/08/09 09:08:55 anthonybaxter 49 | # added identifying header to top of each file 50 | # 51 | # Revision 1.2 2001/07/19 06:57:07 anthony 52 | # cvs keywords added 53 | # 54 | # 55 | -------------------------------------------------------------------------------- /modules/discovery/DNS/lazy.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/DNS/lazy.pyc -------------------------------------------------------------------------------- /modules/discovery/DNS/win32dns.py: -------------------------------------------------------------------------------- 1 | """ 2 | $Id: win32dns.py,v 1.3.2.1 2007/05/22 20:26:49 customdesigned Exp $ 3 | 4 | Extract a list of TCP/IP name servers from the registry 0.1 5 | 0.1 Strobl 2001-07-19 6 | Usage: 7 | RegistryResolve() returns a list of ip numbers (dotted quads), by 8 | scouring the registry for addresses of name servers 9 | 10 | Tested on Windows NT4 Server SP6a, Windows 2000 Pro SP2 and 11 | Whistler Pro (XP) Build 2462 and Windows ME 12 | ... all having a different registry layout wrt name servers :-/ 13 | 14 | Todo: 15 | 16 | Program doesn't check whether an interface is up or down 17 | 18 | (c) 2001 Copyright by Wolfgang Strobl ws@mystrobl.de, 19 | License analog to the current Python license 20 | """ 21 | 22 | import string 23 | import re 24 | import _winreg 25 | 26 | 27 | def binipdisplay(s): 28 | "convert a binary array of ip adresses to a python list" 29 | if len(s) % 4 != 0: 30 | raise EnvironmentError # well ... 31 | ol = [] 32 | for i in range(len(s) / 4): 33 | s1 = s[:4] 34 | s = s[4:] 35 | ip = [] 36 | for j in s1: 37 | ip.append(str(ord(j))) 38 | ol.append(string.join(ip, '.')) 39 | return ol 40 | 41 | 42 | def stringdisplay(s): 43 | '''convert "d.d.d.d,d.d.d.d" to ["d.d.d.d","d.d.d.d"]. 44 | also handle u'd.d.d.d d.d.d.d', as reporting on SF 45 | ''' 46 | import re 47 | return map(str, re.split("[ ,]", s)) 48 | 49 | 50 | def RegistryResolve(): 51 | nameservers = [] 52 | x = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE) 53 | try: 54 | y = _winreg.OpenKey(x, 55 | r"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters") 56 | except EnvironmentError: # so it isn't NT/2000/XP 57 | # windows ME, perhaps? 58 | try: # for Windows ME 59 | y = _winreg.OpenKey(x, 60 | r"SYSTEM\CurrentControlSet\Services\VxD\MSTCP") 61 | nameserver, dummytype = _winreg.QueryValueEx(y, 'NameServer') 62 | if nameserver and not (nameserver in nameservers): 63 | nameservers.extend(stringdisplay(nameserver)) 64 | except EnvironmentError: 65 | pass 66 | return nameservers # no idea 67 | try: 68 | nameserver = _winreg.QueryValueEx(y, "DhcpNameServer")[0].split() 69 | except: 70 | nameserver = _winreg.QueryValueEx(y, "NameServer")[0].split() 71 | if nameserver: 72 | nameservers = nameserver 73 | nameserver = _winreg.QueryValueEx(y, "NameServer")[0] 74 | _winreg.CloseKey(y) 75 | try: # for win2000 76 | y = _winreg.OpenKey(x, 77 | r"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DNSRegisteredAdapters") 78 | for i in range(1000): 79 | try: 80 | n = _winreg.EnumKey(y, i) 81 | z = _winreg.OpenKey(y, n) 82 | dnscount, dnscounttype = _winreg.QueryValueEx(z, 83 | 'DNSServerAddressCount') 84 | dnsvalues, dnsvaluestype = _winreg.QueryValueEx(z, 85 | 'DNSServerAddresses') 86 | nameservers.extend(binipdisplay(dnsvalues)) 87 | _winreg.CloseKey(z) 88 | except EnvironmentError: 89 | break 90 | _winreg.CloseKey(y) 91 | except EnvironmentError: 92 | pass 93 | # 94 | try: # for whistler 95 | y = _winreg.OpenKey(x, 96 | r"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces") 97 | for i in range(1000): 98 | try: 99 | n = _winreg.EnumKey(y, i) 100 | z = _winreg.OpenKey(y, n) 101 | try: 102 | nameserver, dummytype = _winreg.QueryValueEx( 103 | z, 'NameServer') 104 | if nameserver and not (nameserver in nameservers): 105 | nameservers.extend(stringdisplay(nameserver)) 106 | except EnvironmentError: 107 | pass 108 | _winreg.CloseKey(z) 109 | except EnvironmentError: 110 | break 111 | _winreg.CloseKey(y) 112 | except EnvironmentError: 113 | # print "Key Interfaces not found, just do nothing" 114 | pass 115 | # 116 | _winreg.CloseKey(x) 117 | return nameservers 118 | 119 | if __name__ == "__main__": 120 | print "Name servers:", RegistryResolve() 121 | 122 | # 123 | # $Log: win32dns.py,v $ 124 | # Revision 1.3.2.1 2007/05/22 20:26:49 customdesigned 125 | # Fix win32 nameserver discovery. 126 | # 127 | # Revision 1.3 2002/05/06 06:15:31 anthonybaxter 128 | # apparently some versions of windows return servers as unicode 129 | # string with space sep, rather than strings with comma sep. 130 | # *sigh* 131 | # 132 | # Revision 1.2 2002/03/19 12:41:33 anthonybaxter 133 | # tabnannied and reindented everything. 4 space indent, no tabs. 134 | # yay. 135 | # 136 | # Revision 1.1 2001/08/09 09:22:28 anthonybaxter 137 | # added what I hope is win32 resolver lookup support. I'll need to try 138 | # and figure out how to get the CVS checkout onto my windows machine to 139 | # make sure it works (wow, doing something other than games on the 140 | # windows machine :) 141 | # 142 | # Code from Wolfgang.Strobl@gmd.de 143 | # win32dns.py from 144 | # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66260 145 | # 146 | # Really, ParseResolvConf() should be renamed "FindNameServers" or 147 | # some such. 148 | # 149 | # 150 | -------------------------------------------------------------------------------- /modules/discovery/IPy.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/IPy.pyc -------------------------------------------------------------------------------- /modules/discovery/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = ["bingsearch", 2 | "googlesearch", 3 | "googleplussearch", 4 | "pgpsearch", 5 | "linkedinsearch", 6 | "exaleadsearch", 7 | "yandexsearch", 8 | "googlesets", 9 | "dnssearch", 10 | "shodansearch", 11 | "jigsaw", 12 | "twittersearch", 13 | "dogpilesearch", 14 | "baidusearch", 15 | "yahoosearch", 16 | "netcraft", 17 | "crtsh", 18 | "virustotal", 19 | "googleCSE"] 20 | -------------------------------------------------------------------------------- /modules/discovery/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/__init__.pyc -------------------------------------------------------------------------------- /modules/discovery/asksearch.py: -------------------------------------------------------------------------------- 1 | import string 2 | import httplib 3 | import sys 4 | import myparser 5 | import re 6 | 7 | 8 | class search_ask: 9 | 10 | def __init__(self, word, limit): 11 | self.word = word.replace(' ', '%20') 12 | self.results = "" 13 | self.totalresults = "" 14 | self.server = "www.ask.com" 15 | self.hostname = "www.ask.com" 16 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6" 17 | self.quantity = "100" 18 | self.limit = int(limit) 19 | self.counter = 0 20 | 21 | def do_search(self): 22 | h = httplib.HTTP(self.server) 23 | h.putrequest( 24 | 'GET', 25 | "/web?q=%40" + 26 | self.word + 27 | "&pu=100&page=" + 28 | self.counter) 29 | h.putheader('User-agent', self.userAgent) 30 | h.endheaders() 31 | returncode, returnmsg, headers = h.getreply() 32 | self.results = h.getfile().read() 33 | self.totalresults += self.results 34 | 35 | def check_next(self): 36 | renext = re.compile('> Next <') 37 | nextres = renext.findall(self.results) 38 | if nextres != []: 39 | nexty = "1" 40 | else: 41 | nexty = "0" 42 | return nexty 43 | 44 | def get_people(self): 45 | rawres = myparser.parser(self.totalresults, self.word) 46 | return rawres.people_jigsaw() 47 | 48 | def process(self): 49 | while (self.counter < self.limit): 50 | self.do_search() 51 | more = self.check_next() 52 | if more == "1": 53 | self.counter += 100 54 | else: 55 | break 56 | -------------------------------------------------------------------------------- /modules/discovery/baidusearch.py: -------------------------------------------------------------------------------- 1 | import httplib 2 | import myparser 3 | import time 4 | import sys 5 | 6 | 7 | class search_baidu: 8 | 9 | def __init__(self, word, limit): 10 | self.word = word 11 | self.total_results = "" 12 | self.server = "www.baidu.com" 13 | self.hostname = "www.baidu.com" 14 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6" 15 | self.limit = limit 16 | self.counter = 0 17 | 18 | def do_search(self): 19 | h = httplib.HTTP(self.server) 20 | 21 | h.putrequest('GET', "/s?wd=%40" + self.word 22 | + "&pn=" + str(self.counter)) 23 | h.putheader('Host', self.hostname) 24 | h.putheader('User-agent', self.userAgent) 25 | h.endheaders() 26 | returncode, returnmsg, headers = h.getreply() 27 | 28 | self.total_results += h.getfile().read() 29 | 30 | def process(self): 31 | while self.counter <= self.limit and self.counter <= 1000: 32 | self.do_search() 33 | time.sleep(1) 34 | 35 | print "\tSearching " + str(self.counter) + " results..." 36 | self.counter += 10 37 | 38 | def get_emails(self): 39 | rawres = myparser.parser(self.total_results, self.word) 40 | return rawres.emails() 41 | 42 | def get_hostnames(self): 43 | rawres = myparser.parser(self.total_results, self.word) 44 | return rawres.hostnames() 45 | -------------------------------------------------------------------------------- /modules/discovery/baidusearch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/baidusearch.pyc -------------------------------------------------------------------------------- /modules/discovery/bingsearch.py: -------------------------------------------------------------------------------- 1 | import string 2 | import httplib 3 | import sys 4 | import myparser 5 | import re 6 | import time 7 | 8 | 9 | class search_bing: 10 | 11 | def __init__(self, word, limit, start): 12 | self.word = word.replace(' ', '%20') 13 | self.results = "" 14 | self.totalresults = "" 15 | self.server = "www.bing.com" 16 | self.apiserver = "api.search.live.net" 17 | self.hostname = "www.bing.com" 18 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6" 19 | self.quantity = "50" 20 | self.limit = int(limit) 21 | self.bingApi = "" 22 | self.counter = start 23 | 24 | def do_search(self): 25 | h = httplib.HTTP(self.server) 26 | h.putrequest('GET', "/search?q=%40" + self.word + 27 | "&count=50&first=" + str(self.counter)) 28 | h.putheader('Host', self.hostname) 29 | h.putheader('Cookie', 'SRCHHPGUSR=ADLT=DEMOTE&NRSLT=50') 30 | h.putheader('Accept-Language', 'en-us,en') 31 | h.putheader('User-agent', self.userAgent) 32 | h.endheaders() 33 | returncode, returnmsg, headers = h.getreply() 34 | self.results = h.getfile().read() 35 | self.totalresults += self.results 36 | 37 | def do_search_api(self): 38 | h = httplib.HTTP(self.apiserver) 39 | h.putrequest('GET', "/xml.aspx?Appid=" + self.bingApi + "&query=%40" + 40 | self.word + "&sources=web&web.count=40&web.offset=" + str(self.counter)) 41 | h.putheader('Host', "api.search.live.net") 42 | h.putheader('User-agent', self.userAgent) 43 | h.endheaders() 44 | returncode, returnmsg, headers = h.getreply() 45 | self.results = h.getfile().read() 46 | self.totalresults += self.results 47 | 48 | def do_search_vhost(self): 49 | h = httplib.HTTP(self.server) 50 | h.putrequest('GET', "/search?q=ip:" + self.word + 51 | "&go=&count=50&FORM=QBHL&qs=n&first=" + str(self.counter)) 52 | h.putheader('Host', self.hostname) 53 | h.putheader( 54 | 'Cookie', 'mkt=en-US;ui=en-US;SRCHHPGUSR=NEWWND=0&ADLT=DEMOTE&NRSLT=50') 55 | h.putheader('Accept-Language', 'en-us,en') 56 | h.putheader('User-agent', self.userAgent) 57 | h.endheaders() 58 | returncode, returnmsg, headers = h.getreply() 59 | self.results = h.getfile().read() 60 | self.totalresults += self.results 61 | 62 | def get_emails(self): 63 | rawres = myparser.parser(self.totalresults, self.word) 64 | return rawres.emails() 65 | 66 | def get_hostnames(self): 67 | rawres = myparser.parser(self.totalresults, self.word) 68 | return rawres.hostnames() 69 | 70 | def get_allhostnames(self): 71 | rawres = myparser.parser(self.totalresults, self.word) 72 | return rawres.hostnames_all() 73 | 74 | def process(self, api): 75 | if api == "yes": 76 | if self.bingApi == "": 77 | print "Please insert your API key in the discovery/bingsearch.py" 78 | sys.exit() 79 | while (self.counter < self.limit): 80 | if api == "yes": 81 | self.do_search_api() 82 | time.sleep(0.3) 83 | else: 84 | self.do_search() 85 | time.sleep(1) 86 | self.counter += 50 87 | 88 | def process_vhost(self): 89 | # Maybe it is good to use other limit for this. 90 | while (self.counter < self.limit): 91 | self.do_search_vhost() 92 | self.counter += 50 93 | -------------------------------------------------------------------------------- /modules/discovery/bingsearch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/bingsearch.pyc -------------------------------------------------------------------------------- /modules/discovery/crtsh.py: -------------------------------------------------------------------------------- 1 | import string 2 | import requests 3 | import sys 4 | import myparser 5 | import re 6 | 7 | 8 | class search_crtsh: 9 | 10 | def __init__(self, word): 11 | self.word = word.replace(' ', '%20') 12 | self.results = "" 13 | self.totalresults = "" 14 | self.server = "www.google.com" 15 | self.hostname = "www.google.com" 16 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100116 Firefox/3.7" 17 | self.quantity = "100" 18 | self.counter = 0 19 | 20 | 21 | def do_search(self): 22 | try: 23 | urly="https://crt.sh/?q=%25" + self.word 24 | except Exception, e: 25 | print e 26 | headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0'} 27 | try: 28 | r=requests.get(urly,headers=headers) 29 | except Exception,e: 30 | print e 31 | self.results = r.content 32 | self.totalresults += self.results 33 | 34 | def get_hostnames(self): 35 | rawres = myparser.parser(self.results, self.word) 36 | return rawres.hostnames() 37 | 38 | def process(self): 39 | self.do_search() 40 | print "\tSearching CRT.sh results.." -------------------------------------------------------------------------------- /modules/discovery/crtsh.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/crtsh.pyc -------------------------------------------------------------------------------- /modules/discovery/dnssearch-threads.py: -------------------------------------------------------------------------------- 1 | import IPy 2 | import DNS 3 | import string 4 | import socket 5 | import sys 6 | 7 | 8 | class dns_reverse(): 9 | 10 | def __init__(self, range, verbose=True): 11 | self.range = range 12 | self.iplist = '' 13 | self.results = [] 14 | self.verbose = verbose 15 | try: 16 | DNS.ParseResolvConf("/etc/resolv.conf") 17 | nameserver = DNS.defaults['server'][0] 18 | except: 19 | print "Error in DNS resolvers" 20 | sys.exit() 21 | 22 | def run(self, host): 23 | a = string.split(host, '.') 24 | a.reverse() 25 | b = string.join(a, '.') + '.in-addr.arpa' 26 | nameserver = DNS.defaults['server'][0] 27 | if self.verbose: 28 | ESC = chr(27) 29 | sys.stdout.write(ESC + '[2K' + ESC + '[G') 30 | sys.stdout.write("\r" + host) 31 | sys.stdout.flush() 32 | try: 33 | name = DNS.Base.DnsRequest(b, qtype='ptr').req().answers[0]['data'] 34 | return host + ":" + name 35 | except: 36 | pass 37 | 38 | def get_ip_list(self, ips): 39 | """Generates the list of ips to reverse""" 40 | try: 41 | list = IPy.IP(ips) 42 | except: 43 | print "Error in IP format, check the input and try again. (Eg. 192.168.1.0/24)" 44 | sys.exit() 45 | name = [] 46 | for x in list: 47 | name.append(str(x)) 48 | return name 49 | 50 | def list(self): 51 | self.iplist = self.get_ip_list(self.range) 52 | return self.iplist 53 | 54 | def process(self): 55 | for x in self.iplist: 56 | host = self.run(x) 57 | if host is not None: 58 | self.results.append(host) 59 | return self.results 60 | 61 | 62 | class dns_force(): 63 | 64 | def __init__(self, domain, dnsserver, verbose=False): 65 | self.domain = domain 66 | self.server = dnsserver 67 | self.file = "dns-names.txt" 68 | self.subdo = False 69 | self.verbose = verbose 70 | try: 71 | f = open(self.file, "r") 72 | except: 73 | print "Error opening dns dictionary file" 74 | sys.exit() 75 | self.list = f.readlines() 76 | 77 | def getdns(self, domain): 78 | DNS.ParseResolvConf("/etc/resolv.conf") 79 | nameserver = DNS.defaults['server'][0] 80 | dom = domain 81 | if self.subdo == True: 82 | dom = domain.split(".") 83 | dom.pop(0) 84 | rootdom = ".".join(dom) 85 | else: 86 | rootdom = dom 87 | if self.server == False: 88 | r = DNS.Request(rootdom, qtype='SOA').req() 89 | primary, email, serial, refresh, retry, expire, minimum = r.answers[ 90 | 0]['data'] 91 | test = DNS.Request(rootdom, qtype='NS', server=primary, aa=1).req() 92 | if test.header['status'] != "NOERROR": 93 | print "Error" 94 | sys.exit() 95 | self.nameserver = test.answers[0]['data'] 96 | return self.nameserver 97 | 98 | def run(self, host): 99 | self.nameserver = self.getdns(self.domain) 100 | hostname = str(host.split("\n")[0]) + "." + str(self.domain) 101 | # nameserver=DNS.defaults['server'][0] 102 | if self.verbose: 103 | ESC = chr(27) 104 | sys.stdout.write(ESC + '[2K' + ESC + '[G') 105 | sys.stdout.write("\r" + hostname) 106 | sys.stdout.flush() 107 | try: 108 | test = DNS.Request( 109 | hostname, 110 | qtype='a', 111 | server=self.nameserver).req( 112 | ) 113 | hostip = test.answers[0]['data'] 114 | return hostip + ":" + hostname 115 | except Exception as e: 116 | pass 117 | 118 | def process(self): 119 | results = [] 120 | for x in self.list: 121 | host = self.run(x) 122 | if host is not None: 123 | results.append(host) 124 | return results 125 | -------------------------------------------------------------------------------- /modules/discovery/dnssearch.py: -------------------------------------------------------------------------------- 1 | import IPy 2 | import DNS 3 | import string 4 | import socket 5 | import sys 6 | 7 | 8 | class dns_reverse(): 9 | 10 | def __init__(self, range, verbose=True): 11 | self.range = range 12 | self.iplist = '' 13 | self.results = [] 14 | self.verbose = verbose 15 | try: 16 | DNS.ParseResolvConf("/etc/resolv.conf") 17 | nameserver = DNS.defaults['server'][0] 18 | except: 19 | print "Error in DNS resolvers" 20 | sys.exit() 21 | 22 | def run(self, host): 23 | a = string.split(host, '.') 24 | a.reverse() 25 | b = string.join(a, '.') + '.in-addr.arpa' 26 | nameserver = DNS.defaults['server'][0] 27 | if self.verbose: 28 | ESC = chr(27) 29 | sys.stdout.write(ESC + '[2K' + ESC + '[G') 30 | sys.stdout.write("\r\t" + host) 31 | sys.stdout.flush() 32 | try: 33 | name = DNS.Base.DnsRequest(b, qtype='ptr').req().answers[0]['data'] 34 | return host + ":" + name 35 | except: 36 | pass 37 | 38 | def get_ip_list(self, ips): 39 | """Generates the list of ips to reverse""" 40 | try: 41 | list = IPy.IP(ips) 42 | except: 43 | print "Error in IP format, check the input and try again. (Eg. 192.168.1.0/24)" 44 | sys.exit() 45 | name = [] 46 | for x in list: 47 | name.append(str(x)) 48 | return name 49 | 50 | def list(self): 51 | self.iplist = self.get_ip_list(self.range) 52 | return self.iplist 53 | 54 | def process(self): 55 | for x in self.iplist: 56 | host = self.run(x) 57 | if host is not None: 58 | self.results.append(host) 59 | return self.results 60 | 61 | 62 | class dns_force(): 63 | 64 | def __init__(self, domain, dnsserver, verbose=False): 65 | self.domain = domain 66 | self.nameserver = dnsserver 67 | self.file = "dns-names.txt" 68 | self.subdo = False 69 | self.verbose = verbose 70 | try: 71 | f = open(self.file, "r") 72 | except: 73 | print "Error opening dns dictionary file" 74 | sys.exit() 75 | self.list = f.readlines() 76 | 77 | def getdns(self, domain): 78 | DNS.ParseResolvConf("/etc/resolv.conf") 79 | nameserver=DNS.defaults['server'][0] 80 | dom = domain 81 | if self.subdo == True: 82 | dom = domain.split(".") 83 | dom.pop(0) 84 | rootdom = ".".join(dom) 85 | else: 86 | rootdom = dom 87 | if self.nameserver == "": 88 | try: 89 | r = DNS.Request(rootdom, qtype='SOA').req() 90 | primary, email, serial, refresh, retry, expire, minimum = r.answers[ 91 | 0]['data'] 92 | test = DNS.Request( 93 | rootdom, 94 | qtype='NS', 95 | server=primary, 96 | aa=1).req() 97 | except Exception as e: 98 | print e 99 | 100 | if test.header['status'] != "NOERROR": 101 | print "Error" 102 | sys.exit() 103 | self.nameserver = test.answers[0]['data'] 104 | elif self.nameserver == "local": 105 | self.nameserver = nameserver 106 | return self.nameserver 107 | 108 | def run(self, host): 109 | if self.nameserver == "": 110 | self.nameserver = self.getdns(self.domain) 111 | print "Using DNS server: " + self.nameserver 112 | 113 | hostname = str(host.split("\n")[0]) + "." + str(self.domain) 114 | if self.verbose: 115 | ESC = chr(27) 116 | sys.stdout.write(ESC + '[2K' + ESC + '[G') 117 | sys.stdout.write("\r" + hostname) 118 | sys.stdout.flush() 119 | try: 120 | test = DNS.Request( 121 | hostname, 122 | qtype='a', 123 | server=self.nameserver).req( 124 | ) 125 | hostip = test.answers[0]['data'] 126 | return hostip + ":" + hostname 127 | except Exception as e: 128 | pass 129 | 130 | def process(self): 131 | results = [] 132 | for x in self.list: 133 | host = self.run(x) 134 | if host is not None: 135 | results.append(host) 136 | return results 137 | 138 | 139 | class dns_tld(): 140 | 141 | def __init__(self, domain, dnsserver, verbose=False): 142 | self.domain = domain 143 | self.nameserver = dnsserver 144 | self.subdo = False 145 | self.verbose = verbose 146 | # Updated from http://data.iana.org/TLD/tlds-alpha-by-domain.txt 147 | self.tlds = [ 148 | "ac", "academy", "ad", "ae", "aero", "af", "ag", "ai", "al", "am", "an", "ao", "aq", "ar", "arpa", "as", 149 | "asia", "at", "au", "aw", "ax", "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bike", "biz", "bj", 150 | "bm", "bn", "bo", "br", "bs", "bt", "builders", "buzz", "bv", "bw", "by", "bz", "ca", "cab", "camera", 151 | "camp", "careers", "cat", "cc", "cd", "center", "ceo", "cf", "cg", "ch", "ci", "ck", "cl", "clothing", 152 | "cm", "cn", "co", "codes", "coffee", "com", "company", "computer", "construction", "contractors", "coop", 153 | "cr", "cu", "cv", "cw", "cx", "cy", "cz", "de", "diamonds", "directory", "dj", "dk", "dm", "do", 154 | "domains", "dz", "ec", "edu", "education", "ee", "eg", "email", "enterprises", "equipment", "er", "es", 155 | "estate", "et", "eu", "farm", "fi", "fj", "fk", "florist", "fm", "fo", "fr", "ga", "gallery", "gb", "gd", 156 | "ge", "gf", "gg", "gh", "gi", "gl", "glass", "gm", "gn", "gov", "gp", "gq", "gr", "graphics", "gs", "gt", 157 | "gu", "guru", "gw", "gy", "hk", "hm", "hn", "holdings", "holiday", "house", "hr", "ht", "hu", "id", "ie", 158 | "il", "im", "immobilien", "in", "info", "institute", "int", "international", "io", "iq", "ir", "is", "it", 159 | "je", "jm", "jo", "jobs", "jp", "kaufen", "ke", "kg", "kh", "ki", "kitchen", "kiwi", "km", "kn", "kp", 160 | "kr", "kw", "ky", "kz", "la", "land", "lb", "lc", "li", "lighting", "limo", "lk", "lr", "ls", "lt", "lu", 161 | "lv", "ly", "ma", "management", "mc", "md", "me", "menu", "mg", "mh", "mil", "mk", "ml", "mm", "mn", "mo", 162 | "mobi", "mp", "mq", "mr", "ms", "mt", "mu", "museum", "mv", "mw", "mx", "my", "mz", "na", "name", "nc", 163 | "ne", "net", "nf", "ng", "ni", "ninja", "nl", "no", "np", "nr", "nu", "nz", "om", "onl", "org", "pa", "pe", 164 | "pf", "pg", "ph", "photography", "photos", "pk", "pl", "plumbing", "pm", "pn", "post", "pr", "pro", "ps", 165 | "pt", "pw", "py", "qa", "re", "recipes", "repair", "ro", "rs", "ru", "ruhr", "rw", "sa", "sb", "sc", "sd", 166 | "se", "sexy", "sg", "sh", "shoes", "si", "singles", "sj", "sk", "sl", "sm", "sn", "so", "solar", 167 | "solutions", "sr", "st", "su", "support", "sv", "sx", "sy", "systems", "sz", "tattoo", "tc", "td", 168 | "technology", "tel", "tf", "tg", "th", "tips", "tj", "tk", "tl", "tm", "tn", "to", "today", "tp", "tr", 169 | "training", "travel", "tt", "tv", "tw", "tz", "ua", "ug", "uk", "uno", "us", "uy", "uz", "va", "vc", 170 | "ve", "ventures", "vg", "vi", "viajes", "vn", "voyage", "vu", "wang", "wf", "wien", "ws", "xxx", "ye", 171 | "yt", "za", "zm", "zw"] 172 | 173 | def getdns(self, domain): 174 | # DNS.ParseResolvConf("/etc/resolv.conf") 175 | # nameserver=DNS.defaults['server'][0] 176 | dom = domain 177 | if self.subdo == True: 178 | dom = domain.split(".") 179 | dom.pop(0) 180 | rootdom = ".".join(dom) 181 | else: 182 | rootdom = dom 183 | if self.nameserver == False: 184 | r = DNS.Request(rootdom, qtype='SOA').req() 185 | primary, email, serial, refresh, retry, expire, minimum = r.answers[ 186 | 0]['data'] 187 | test = DNS.Request(rootdom, qtype='NS', server=primary, aa=1).req() 188 | if test.header['status'] != "NOERROR": 189 | print "Error" 190 | sys.exit() 191 | self.nameserver = test.answers[0]['data'] 192 | elif self.nameserver == "local": 193 | self.nameserver = nameserver 194 | return self.nameserver 195 | 196 | def run(self, tld): 197 | self.nameserver = self.getdns(self.domain) 198 | hostname = self.domain.split(".")[0] + "." + tld 199 | if self.verbose: 200 | ESC = chr(27) 201 | sys.stdout.write(ESC + '[2K' + ESC + '[G') 202 | sys.stdout.write("\r\tSearching for: " + hostname) 203 | sys.stdout.flush() 204 | try: 205 | test = DNS.Request( 206 | hostname, 207 | qtype='a', 208 | server=self.nameserver).req( 209 | ) 210 | hostip = test.answers[0]['data'] 211 | return hostip + ":" + hostname 212 | except Exception as e: 213 | pass 214 | 215 | def process(self): 216 | results = [] 217 | for x in self.tlds: 218 | host = self.run(x) 219 | if host is not None: 220 | results.append(host) 221 | return results 222 | -------------------------------------------------------------------------------- /modules/discovery/dnssearch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/dnssearch.pyc -------------------------------------------------------------------------------- /modules/discovery/dogpilesearch.py: -------------------------------------------------------------------------------- 1 | import httplib 2 | import myparser 3 | import time 4 | import sys 5 | 6 | 7 | class search_dogpile: 8 | 9 | def __init__(self, word, limit): 10 | self.word = word 11 | self.total_results = "" 12 | self.server = "www.dogpile.com" 13 | self.hostname = "www.dogpile.com" 14 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6" 15 | self.limit = limit 16 | self.counter = 0 17 | 18 | def do_search(self): 19 | h = httplib.HTTP(self.server) 20 | 21 | # Dogpile is hardcoded to return 10 results 22 | h.putrequest('GET', "/search/web?qsi=" + str(self.counter) 23 | + "&q=\"%40" + self.word + "\"") 24 | h.putheader('Host', self.hostname) 25 | h.putheader('User-agent', self.userAgent) 26 | h.endheaders() 27 | returncode, returnmsg, headers = h.getreply() 28 | 29 | self.total_results += h.getfile().read() 30 | 31 | def process(self): 32 | while self.counter <= self.limit and self.counter <= 1000: 33 | self.do_search() 34 | time.sleep(1) 35 | 36 | print "\tSearching " + str(self.counter) + " results..." 37 | self.counter += 10 38 | 39 | def get_emails(self): 40 | rawres = myparser.parser(self.total_results, self.word) 41 | return rawres.emails() 42 | 43 | def get_hostnames(self): 44 | rawres = myparser.parser(self.total_results, self.word) 45 | return rawres.hostnames() 46 | -------------------------------------------------------------------------------- /modules/discovery/dogpilesearch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/dogpilesearch.pyc -------------------------------------------------------------------------------- /modules/discovery/exaleadsearch.py: -------------------------------------------------------------------------------- 1 | import string 2 | import httplib 3 | import sys 4 | import myparser 5 | import re 6 | import time 7 | 8 | 9 | class search_exalead: 10 | 11 | def __init__(self, word, limit, start): 12 | self.word = word 13 | self.files = "pdf" 14 | self.results = "" 15 | self.totalresults = "" 16 | self.server = "www.exalead.com" 17 | self.hostname = "www.exalead.com" 18 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/4.0" 19 | self.limit = limit 20 | self.counter = start 21 | 22 | def do_search(self): 23 | h = httplib.HTTP(self.server) 24 | h.putrequest('GET', "/search/web/results/?q=%40" + self.word + 25 | "&elements_per_page=50&start_index=" + str(self.counter)) 26 | h.putheader('Host', self.hostname) 27 | h.putheader( 28 | 'Referer', 29 | "http://" + 30 | self.hostname + 31 | "/search/web/results/?q=%40" + 32 | self.word) 33 | h.putheader('User-agent', self.userAgent) 34 | h.endheaders() 35 | returncode, returnmsg, headers = h.getreply() 36 | self.results = h.getfile().read() 37 | self.totalresults += self.results 38 | 39 | def do_search_files(self, files): 40 | h = httplib.HTTP(self.server) 41 | h.putrequest( 42 | 'GET', 43 | "search/web/results/?q=" + 44 | self.word + 45 | "filetype:" + 46 | self.files + 47 | "&elements_per_page=50&start_index=" + 48 | self.counter) 49 | h.putheader('Host', self.hostname) 50 | h.putheader('User-agent', self.userAgent) 51 | h.endheaders() 52 | returncode, returnmsg, headers = h.getreply() 53 | self.results = h.getfile().read() 54 | self.totalresults += self.results 55 | 56 | def check_next(self): 57 | renext = re.compile('topNextUrl') 58 | nextres = renext.findall(self.results) 59 | if nextres != []: 60 | nexty = "1" 61 | print str(self.counter) 62 | else: 63 | nexty = "0" 64 | return nexty 65 | 66 | def get_emails(self): 67 | rawres = myparser.parser(self.totalresults, self.word) 68 | return rawres.emails() 69 | 70 | def get_hostnames(self): 71 | rawres = myparser.parser(self.totalresults, self.word) 72 | return rawres.hostnames() 73 | 74 | def get_files(self): 75 | rawres = myparser.parser(self.totalresults, self.word) 76 | return rawres.fileurls(self.files) 77 | 78 | def process(self): 79 | while self.counter <= self.limit: 80 | self.do_search() 81 | self.counter += 50 82 | 83 | def process_files(self, files): 84 | while self.counter < self.limit: 85 | self.do_search_files(files) 86 | time.sleep(1) 87 | more = self.check_next() 88 | if more == "1": 89 | self.counter += 50 90 | else: 91 | break -------------------------------------------------------------------------------- /modules/discovery/exaleadsearch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/exaleadsearch.pyc -------------------------------------------------------------------------------- /modules/discovery/googleCSE.py: -------------------------------------------------------------------------------- 1 | import string 2 | import httplib 3 | import sys 4 | import myparser 5 | import re 6 | import time 7 | 8 | 9 | class search_googleCSE: 10 | 11 | def __init__(self, word, limit, start): 12 | self.word = word 13 | self.files = "pdf" 14 | self.results = "" 15 | self.totalresults = "" 16 | self.server = "www.googleapis.com" 17 | self.hostname = "www.googleapis.com" 18 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6" 19 | self.quantity = "10" 20 | self.limit = limit 21 | self.counter = 1 22 | self.api_key = "" 23 | self.cse_id = "" 24 | self.lowRange = start 25 | self.highRange = start+100 26 | 27 | def do_search(self): 28 | h = httplib.HTTPS(self.server) 29 | h.putrequest('GET', "/customsearch/v1?key=" + self.api_key +"&highRange=" + str(self.highRange) + "&lowRange=" + str(self.lowRange) + "&cx=" +self.cse_id + 30 | "&start=" + str(self.counter) + "&q=%40\"" + self.word + "\"") 31 | h.putheader('Host', self.server) 32 | h.putheader('User-agent', self.userAgent) 33 | h.endheaders() 34 | returncode, returnmsg, headers = h.getreply() 35 | self.results = h.getfile().read() 36 | self.totalresults += self.results 37 | 38 | def do_search_files(self): 39 | h = httplib.HTTPS(self.server) 40 | h.putrequest('GET', "/customsearch/v1?key=" + self.api_key +"&highRange=" + str(self.highRange) + "&lowRange=" + str(self.lowRange) + "&cx=" +self.cse_id + 41 | "&start=" + str(self.counter) + "&q=filetype:" + files +"%20site:" + self.word) 42 | h.putheader('Host', self.server) 43 | h.putheader('User-agent', self.userAgent) 44 | h.endheaders() 45 | returncode, returnmsg, headers = h.getreply() 46 | self.results = h.getfile().read() 47 | self.totalresults += self.results 48 | 49 | 50 | def check_next(self): 51 | renext = re.compile('> Next <') 52 | nextres = renext.findall(self.results) 53 | if nextres != []: 54 | nexty = "1" 55 | else: 56 | nexty = "0" 57 | return nexty 58 | 59 | def get_emails(self): 60 | rawres = myparser.parser(self.totalresults, self.word) 61 | return rawres.emails() 62 | 63 | def get_hostnames(self): 64 | rawres = myparser.parser(self.totalresults, self.word) 65 | return rawres.hostnames() 66 | 67 | def get_files(self): 68 | rawres = myparser.parser(self.totalresults, self.word) 69 | return rawres.fileurls(self.files) 70 | 71 | 72 | def process(self): 73 | tracker=self.counter + self.lowRange 74 | while tracker <= self.limit: 75 | self.do_search() 76 | #time.sleep(1) 77 | ESC=chr(27) 78 | sys.stdout.write(ESC + '[2K' + ESC+'[G') 79 | sys.stdout.write("\r\t" + "Searching " + str(self.counter+self.lowRange) + " results ..." ) 80 | sys.stdout.flush() 81 | #print "\tSearching " + str(self.counter+self.lowRange) + " results...\t\t\t\t\t\r" 82 | if self.counter == 101: 83 | self.counter = 1 84 | self.lowRange +=100 85 | self.highRange +=100 86 | else: 87 | self.counter += 10 88 | tracker=self.counter + self.lowRange 89 | 90 | def store_results(self): 91 | filename = "debug_results.txt" 92 | file = open(filename, 'w') 93 | file.write(self.totalresults) 94 | 95 | 96 | def process_files(self, files): 97 | while self.counter <= self.limit: 98 | self.do_search_files(files) 99 | time.sleep(1) 100 | self.counter += 100 101 | print "\tSearching " + str(self.counter) + " results..." 102 | -------------------------------------------------------------------------------- /modules/discovery/googleCSE.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/googleCSE.pyc -------------------------------------------------------------------------------- /modules/discovery/googleplussearch.py: -------------------------------------------------------------------------------- 1 | import string 2 | import requests 3 | import sys 4 | import myparser 5 | import re 6 | 7 | 8 | class search_googleplus: 9 | 10 | def __init__(self, word, limit): 11 | self.word = word.replace(' ', '%20') 12 | self.results = "" 13 | self.totalresults = "" 14 | self.server = "www.google.com" 15 | self.hostname = "www.google.com" 16 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6" 17 | self.quantity = "100" 18 | self.limit = int(limit) 19 | self.counter = 0 20 | 21 | def do_search(self): 22 | try: 23 | urly="https://" + self.server + "/search?num=100&start=" + str(self.counter) + "&hl=en&meta=&q=site%3Aplus.google.com%20intext%3A%22Works%20at%22%20" + self.word+ "%20-inurl%3Aphotos%20-inurl%3Aabout%20-inurl%3Aposts%20-inurl%3Aplusones" 24 | except Exception, e: 25 | print e 26 | try: 27 | headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0'} 28 | r=requests.get(urly,headers=headers) 29 | except Exception,e: 30 | print e 31 | self.results = r.content 32 | self.totalresults += self.results 33 | 34 | def get_people(self): 35 | rawres = myparser.parser(self.totalresults, self.word) 36 | return rawres.people_googleplus() 37 | 38 | def process(self): 39 | while (self.counter < self.limit): 40 | self.do_search() 41 | self.counter += 100 42 | print "\tSearching " + str(self.counter) + " results.." 43 | -------------------------------------------------------------------------------- /modules/discovery/googleplussearch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/googleplussearch.pyc -------------------------------------------------------------------------------- /modules/discovery/googlesearch.py: -------------------------------------------------------------------------------- 1 | import string 2 | import sys 3 | import myparser 4 | import re 5 | import time 6 | import requests 7 | 8 | 9 | class search_google: 10 | 11 | def __init__(self, word, limit, start): 12 | self.word = word 13 | self.results = "" 14 | self.totalresults = "" 15 | self.server = "www.google.com" 16 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6" 17 | self.quantity = "100" 18 | self.limit = limit 19 | self.counter = start 20 | 21 | def do_search(self): 22 | try: 23 | urly="http://" + self.server + "/search?num=" + self.quantity + "&start=" + str(self.counter) + "&hl=en&meta=&q=%40\"" + self.word + "\"" 24 | except Exception, e: 25 | print e 26 | try: 27 | r=requests.get(urly) 28 | except Exception,e: 29 | print e 30 | self.results = r.content 31 | self.totalresults += self.results 32 | 33 | 34 | def do_search_profiles(self): 35 | try: 36 | urly="http://" + self.server + "/search?num=" + self.quantity + "&start=" + str(self.counter) + "&hl=en&meta=&q=site:www.google.com%20intitle:\"Google%20Profile\"%20\"Companies%20I%27ve%20worked%20for\"%20\"at%20" + self.word + "\"" 37 | except Exception, e: 38 | print e 39 | try: 40 | r=requests.get(urly) 41 | except Exception,e: 42 | print e 43 | self.results = r.content 44 | 45 | #'&hl=en&meta=&q=site:www.google.com%20intitle:"Google%20Profile"%20"Companies%20I%27ve%20worked%20for"%20"at%20' + self.word + '"') 46 | self.totalresults += self.results 47 | 48 | def get_emails(self): 49 | rawres = myparser.parser(self.totalresults, self.word) 50 | return rawres.emails() 51 | 52 | def get_hostnames(self): 53 | rawres = myparser.parser(self.totalresults, self.word) 54 | return rawres.hostnames() 55 | 56 | def get_files(self): 57 | rawres = myparser.parser(self.totalresults, self.word) 58 | return rawres.fileurls(self.files) 59 | 60 | def get_profiles(self): 61 | rawres = myparser.parser(self.totalresults, self.word) 62 | return rawres.profiles() 63 | 64 | def process(self): 65 | while self.counter <= self.limit and self.counter <= 1000: 66 | self.do_search() 67 | #more = self.check_next() 68 | time.sleep(1) 69 | self.counter += 100 70 | 71 | 72 | def process_profiles(self): 73 | while self.counter < self.limit: 74 | self.do_search_profiles() 75 | time.sleep(0.3) 76 | self.counter += 100 -------------------------------------------------------------------------------- /modules/discovery/googlesearch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/googlesearch.pyc -------------------------------------------------------------------------------- /modules/discovery/googlesets.py: -------------------------------------------------------------------------------- 1 | import string 2 | import httplib 3 | import sys 4 | import myparser 5 | import re 6 | import time 7 | 8 | 9 | class search_google_labs: 10 | 11 | def __init__(self, list): 12 | self.results = "" 13 | self.totalresults = "" 14 | self.server = "labs.google.com" 15 | self.hostname = "labs.google.com" 16 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6" 17 | id = 0 18 | self.set = "" 19 | for x in list: 20 | id += 1 21 | if id == 1: 22 | self.set = self.set + "q" + str(id) + "=" + str(x) 23 | else: 24 | self.set = self.set + "&q" + str(id) + "=" + str(x) 25 | 26 | def do_search(self): 27 | h = httplib.HTTP(self.server) 28 | h.putrequest('GET', "/sets?hl=en&" + self.set) 29 | h.putheader('Host', self.hostname) 30 | h.putheader('User-agent', self.userAgent) 31 | h.endheaders() 32 | returncode, returnmsg, headers = h.getreply() 33 | self.results = h.getfile().read() 34 | self.totalresults += self.results 35 | 36 | def get_set(self): 37 | rawres = myparser.parser(self.totalresults, list) 38 | return rawres.set() 39 | 40 | def process(self): 41 | self.do_search() 42 | -------------------------------------------------------------------------------- /modules/discovery/googlesets.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/googlesets.pyc -------------------------------------------------------------------------------- /modules/discovery/jigsaw.py: -------------------------------------------------------------------------------- 1 | import string 2 | import httplib 3 | import sys 4 | import myparser 5 | import re 6 | # http://www.jigsaw.com/SearchAcrossCompanies.xhtml?opCode=refresh&rpage=4&mode=0&cnCountry=&order=0&orderby=0&cmName=accuvant&cnDead=false&cnExOwned=false&count=0&screenNameType=0&screenName=&omitScreenNameType=0&omitScreenName=&companyId=0&estimatedCount=277&rowsPerPage=50 7 | 8 | 9 | class search_jigsaw: 10 | 11 | def __init__(self, word, limit): 12 | self.word = word.replace(' ', '%20') 13 | self.results = "" 14 | self.totalresults = "" 15 | self.server = "www.jigsaw.com" 16 | self.hostname = "www.jigsaw.com" 17 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6" 18 | self.quantity = "100" 19 | self.limit = int(limit) 20 | self.counter = 0 21 | 22 | def do_search(self): 23 | h = httplib.HTTP(self.server) 24 | h.putrequest( 25 | 'GET', 26 | "/FreeTextSearch.xhtml?opCode=search&autoSuggested=True&freeText=" + 27 | self.word) 28 | h.putheader('User-agent', self.userAgent) 29 | h.endheaders() 30 | returncode, returnmsg, headers = h.getreply() 31 | self.results = h.getfile().read() 32 | self.totalresults += self.results 33 | 34 | def check_next(self): 35 | renext = re.compile('> Next <') 36 | nextres = renext.findall(self.results) 37 | if nextres != []: 38 | nexty = "1" 39 | else: 40 | nexty = "0" 41 | return nexty 42 | 43 | def get_people(self): 44 | rawres = myparser.parser(self.totalresults, self.word) 45 | return rawres.people_jigsaw() 46 | 47 | def process(self): 48 | while (self.counter < self.limit): 49 | self.do_search() 50 | more = self.check_next() 51 | if more == "1": 52 | self.counter += 100 53 | else: 54 | break 55 | -------------------------------------------------------------------------------- /modules/discovery/jigsaw.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/jigsaw.pyc -------------------------------------------------------------------------------- /modules/discovery/linkedinsearch.py: -------------------------------------------------------------------------------- 1 | import string 2 | import requests 3 | import sys 4 | import myparser 5 | import re 6 | 7 | 8 | class search_linkedin: 9 | 10 | def __init__(self, word, limit): 11 | self.word = word.replace(' ', '%20') 12 | self.results = "" 13 | self.totalresults = "" 14 | self.server = "www.google.com" 15 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6" 16 | self.quantity = "100" 17 | self.limit = int(limit) 18 | self.counter = 0 19 | 20 | def do_search(self): 21 | try: 22 | urly="http://"+ self.server + "/search?num=100&start=" + str(self.counter) + "&hl=en&meta=&q=site%3Alinkedin.com/in%20" + self.word 23 | except Exception, e: 24 | print e 25 | try: 26 | r=requests.get(urly) 27 | except Exception,e: 28 | print e 29 | self.results = r.content 30 | self.totalresults += self.results 31 | 32 | def get_people(self): 33 | rawres = myparser.parser(self.totalresults, self.word) 34 | return rawres.people_linkedin() 35 | 36 | def process(self): 37 | while (self.counter < self.limit): 38 | self.do_search() 39 | self.counter += 100 40 | print "\tSearching " + str(self.counter) + " results.." 41 | -------------------------------------------------------------------------------- /modules/discovery/linkedinsearch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/linkedinsearch.pyc -------------------------------------------------------------------------------- /modules/discovery/netcraft.py: -------------------------------------------------------------------------------- 1 | import string 2 | import requests 3 | import sys 4 | import myparser 5 | import re 6 | 7 | 8 | class search_netcraft: 9 | 10 | def __init__(self, word): 11 | self.word = word.replace(' ', '%20') 12 | self.results = "" 13 | self.totalresults = "" 14 | self.server = "www.google.com" 15 | self.hostname = "www.google.com" 16 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100116 Firefox/3.7" 17 | self.quantity = "100" 18 | self.counter = 0 19 | 20 | 21 | def do_search(self): 22 | try: 23 | urly="https://searchdns.netcraft.com/?restriction=site+ends+with&host=" + self.word 24 | except Exception, e: 25 | print e 26 | headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0'} 27 | try: 28 | r=requests.get(urly,headers=headers) 29 | except Exception,e: 30 | print e 31 | self.results = r.content 32 | self.totalresults += self.results 33 | 34 | def get_hostnames(self): 35 | rawres = myparser.parser(self.results, self.word) 36 | return rawres.hostnames() 37 | 38 | def process(self): 39 | self.do_search() 40 | print "\tSearching Netcraft results.." 41 | -------------------------------------------------------------------------------- /modules/discovery/netcraft.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/netcraft.pyc -------------------------------------------------------------------------------- /modules/discovery/pgpsearch.py: -------------------------------------------------------------------------------- 1 | import string 2 | import httplib 3 | import sys 4 | import myparser 5 | 6 | 7 | class search_pgp: 8 | 9 | def __init__(self, word): 10 | self.word = word 11 | self.results = "" 12 | self.server = "pgp.mit.edu" 13 | #self.server = "pgp.rediris.es:11371" Not working at the moment 14 | self.hostname = "pgp.mit.edu" 15 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6" 16 | 17 | def process(self): 18 | h = httplib.HTTP(self.server) 19 | h.putrequest('GET', "/pks/lookup?search=" + self.word + "&op=index") 20 | h.putheader('Host', self.hostname) 21 | h.putheader('User-agent', self.userAgent) 22 | h.endheaders() 23 | returncode, returnmsg, headers = h.getreply() 24 | print returncode 25 | print returnmsg 26 | self.results = h.getfile().read() 27 | 28 | def get_emails(self): 29 | rawres = myparser.parser(self.results, self.word) 30 | return rawres.emails() 31 | 32 | def get_hostnames(self): 33 | rawres = myparser.parser(self.results, self.word) 34 | return rawres.hostnames() 35 | -------------------------------------------------------------------------------- /modules/discovery/pgpsearch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/pgpsearch.pyc -------------------------------------------------------------------------------- /modules/discovery/shodan/__init__.py: -------------------------------------------------------------------------------- 1 | from api import WebAPI 2 | 3 | __version__ = "0.5.0" 4 | 5 | __all__ = ['WebAPI'] 6 | -------------------------------------------------------------------------------- /modules/discovery/shodan/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/shodan/__init__.pyc -------------------------------------------------------------------------------- /modules/discovery/shodan/api.py: -------------------------------------------------------------------------------- 1 | try: 2 | from json import dumps, loads 3 | except: 4 | from simplejson import dumps, loads 5 | from urllib2 import urlopen 6 | from urllib import urlencode 7 | 8 | __all__ = ['WebAPI'] 9 | 10 | 11 | class WebAPIError(Exception): 12 | 13 | def __init__(self, value): 14 | self.value = value 15 | 16 | def __str__(self): 17 | return self.value 18 | 19 | 20 | class WebAPI: 21 | 22 | """Wrapper around the SHODAN webservices API""" 23 | 24 | class DatalossDb: 25 | 26 | def __init__(self, parent): 27 | self.parent = parent 28 | 29 | def search(self, **kwargs): 30 | """Search the Dataloss DB archive. 31 | 32 | Arguments: 33 | name -- Name of the affected company/ organisation 34 | 35 | arrest -- whether the incident resulted in an arrest 36 | breaches -- the type of breach that occurred (Hack, MissingLaptop etc.) 37 | country -- country where the incident took place 38 | ext -- whether an external, third party was affected 39 | ext_names -- the name of the third party company that was affected 40 | lawsuit -- whether the incident resulted in a lawsuit 41 | records -- the number of records that were lost/ stolen 42 | recovered -- whether the affected items were recovered 43 | sub_types -- the sub-categorization of the affected company/ organization 44 | source -- whether the incident occurred from inside or outside the organization 45 | stocks -- stock symbol of the affected company 46 | types -- the basic type of organization (government, business, educational) 47 | uid -- unique ID for the incident 48 | 49 | Returns: 50 | A dictionary with 2 main items: matches (list) and total (int). 51 | 52 | """ 53 | return self.parent._request('datalossdb/search', dict(**kwargs)) 54 | 55 | class Exploits: 56 | 57 | def __init__(self, parent): 58 | self.parent = parent 59 | 60 | def search(self, query, sources=[], 61 | cve=None, osvdb=None, msb=None, bid=None): 62 | """Search the entire Shodan Exploits archive using the same query syntax 63 | as the website. 64 | 65 | Arguments: 66 | query -- exploit search query; same syntax as website 67 | 68 | Optional arguments: 69 | sources -- metasploit, cve, osvdb, exploitdb, or packetstorm 70 | cve -- CVE identifier (ex. 2010-0432) 71 | osvdb -- OSVDB identifier (ex. 11666) 72 | msb -- Microsoft Security Bulletin ID (ex. MS05-030) 73 | bid -- Bugtraq identifier (ex. 13951) 74 | 75 | """ 76 | if sources: 77 | query += ' source:' + ','.join(sources) 78 | if cve: 79 | query += ' cve:%s' % (str(cve).strip()) 80 | if osvdb: 81 | query += ' osvdb:%s' % (str(osvdb).strip()) 82 | if msb: 83 | query += ' msb:%s' % (str(msb).strip()) 84 | if bid: 85 | query += ' bid:%s' % (str(bid).strip()) 86 | return self.parent._request('search_exploits', {'q': query}) 87 | 88 | class ExploitDb: 89 | 90 | def __init__(self, parent): 91 | self.parent = parent 92 | 93 | def download(self, id): 94 | """Download the exploit code from the ExploitDB archive. 95 | 96 | Arguments: 97 | id -- ID of the ExploitDB entry 98 | 99 | Returns: 100 | A dictionary with the following fields: 101 | filename -- Name of the file 102 | content-type -- Mimetype 103 | data -- Contents of the file 104 | 105 | """ 106 | return self.parent._request('exploitdb/download', {'id': id}) 107 | 108 | def search(self, query, **kwargs): 109 | """Search the ExploitDB archive. 110 | 111 | Arguments: 112 | query -- Search terms 113 | 114 | Optional arguments: 115 | author -- Name of the exploit submitter 116 | platform -- Target platform (e.g. windows, linux, hardware etc.) 117 | port -- Service port number 118 | type -- Any, dos, local, papers, remote, shellcode and webapps 119 | 120 | Returns: 121 | A dictionary with 2 main items: matches (list) and total (int). 122 | Each item in 'matches' is a dictionary with the following elements: 123 | 124 | id 125 | author 126 | date 127 | description 128 | platform 129 | port 130 | type 131 | 132 | """ 133 | return ( 134 | self.parent._request( 135 | 'exploitdb/search', dict(q=query, **kwargs)) 136 | ) 137 | 138 | class Msf: 139 | 140 | def __init__(self, parent): 141 | self.parent = parent 142 | 143 | def download(self, id): 144 | """Download a metasploit module given the fullname (id) of it. 145 | 146 | Arguments: 147 | id -- fullname of the module (ex. auxiliary/admin/backupexec/dump) 148 | 149 | Returns: 150 | A dictionary with the following fields: 151 | filename -- Name of the file 152 | content-type -- Mimetype 153 | data -- File content 154 | """ 155 | return self.parent._request('msf/download', {'id': id}) 156 | 157 | def search(self, query, **kwargs): 158 | """Search for a Metasploit module. 159 | """ 160 | return self.parent._request('msf/search', dict(q=query, **kwargs)) 161 | 162 | def __init__(self, key): 163 | """Initializes the API object. 164 | 165 | Arguments: 166 | key -- your API key 167 | 168 | """ 169 | self.api_key = key 170 | self.base_url = 'http://www.shodanhq.com/api/' 171 | self.dataloss = self.DatalossDb(self) 172 | self.exploits = self.Exploits(self) 173 | self.exploitdb = self.ExploitDb(self) 174 | self.msf = self.Msf(self) 175 | 176 | def _request(self, function, params): 177 | """General-purpose function to create web requests to SHODAN. 178 | 179 | Arguments: 180 | function -- name of the function you want to execute 181 | params -- dictionary of parameters for the function 182 | 183 | Returns 184 | A JSON string containing the function's results. 185 | 186 | """ 187 | # Add the API key parameter automatically 188 | params['key'] = self.api_key 189 | 190 | # Send the request 191 | data = urlopen( 192 | self.base_url + 193 | function + 194 | '?' + 195 | urlencode( 196 | params)).read( 197 | ) 198 | 199 | # Parse the text into JSON 200 | data = loads(data) 201 | 202 | # Raise an exception if an error occurred 203 | if data.get('error', None): 204 | raise WebAPIError(data['error']) 205 | 206 | # Return the data 207 | return data 208 | 209 | def fingerprint(self, banner): 210 | """Determine the software based on the banner. 211 | 212 | Arguments: 213 | banner - HTTP banner 214 | 215 | Returns: 216 | A list of software that matched the given banner. 217 | """ 218 | return self._request('fingerprint', {'banner': banner}) 219 | 220 | def host(self, ip): 221 | """Get all available information on an IP. 222 | 223 | Arguments: 224 | ip -- IP of the computer 225 | 226 | Returns: 227 | All available information SHODAN has on the given IP, 228 | subject to API key restrictions. 229 | 230 | """ 231 | return self._request('host', {'ip': ip}) 232 | 233 | def search(self, query): 234 | """Search the SHODAN database. 235 | 236 | Arguments: 237 | query -- search query; identical syntax to the website 238 | 239 | Returns: 240 | A dictionary with 3 main items: matches, countries and total. 241 | Visit the website for more detailed information. 242 | 243 | """ 244 | return self._request('search', {'q': query}) 245 | -------------------------------------------------------------------------------- /modules/discovery/shodan/api.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/shodan/api.pyc -------------------------------------------------------------------------------- /modules/discovery/shodan/wps.py: -------------------------------------------------------------------------------- 1 | """ 2 | WiFi Positioning System 3 | 4 | Wrappers around the SkyHook and Google Locations APIs to resolve 5 | wireless routers' MAC addresses (BSSID) to physical locations. 6 | """ 7 | try: 8 | from json import dumps, loads 9 | except: 10 | from simplejson import dumps, loads 11 | from urllib2 import Request, urlopen 12 | from urllib import urlencode 13 | 14 | 15 | class Skyhook: 16 | 17 | """Not yet ready for production, use the GoogleLocation class instead.""" 18 | 19 | def __init__(self, username='api', realm='shodan'): 20 | self.username = username 21 | self.realm = realm 22 | self.url = 'https://api.skyhookwireless.com/wps2/location' 23 | 24 | def locate(self, mac): 25 | # Remove the ':' 26 | mac = mac.replace(':', '') 27 | print mac 28 | data = """ 29 | 30 | 31 | 32 | %s 33 | %s 34 | 35 | 36 | 37 | %s 38 | -50 39 | 40 | """ % (self.username, self.realm, mac) 41 | request = Request( 42 | url=self.url, 43 | data=data, 44 | headers={'Content-type': 'text/xml'}) 45 | response = urlopen(request) 46 | result = response.read() 47 | return result 48 | 49 | 50 | class GoogleLocation: 51 | 52 | def __init__(self): 53 | self.url = 'http://www.google.com/loc/json' 54 | 55 | def locate(self, mac): 56 | data = { 57 | 'version': '1.1.0', 58 | 'request_address': True, 59 | 'wifi_towers': [{ 60 | 'mac_address': mac, 61 | 'ssid': 'g', 62 | 'signal_strength': -72 63 | }] 64 | } 65 | response = urlopen(self.url, dumps(data)) 66 | data = response.read() 67 | return loads(data) 68 | -------------------------------------------------------------------------------- /modules/discovery/shodansearch.py: -------------------------------------------------------------------------------- 1 | from shodan import WebAPI 2 | import sys 3 | 4 | 5 | class search_shodan(): 6 | 7 | def __init__(self, host): 8 | self.host = host 9 | self.key = "oCiMsgM6rQWqiTvPxFHYcExlZgg7wvTt" 10 | if self.key == "": 11 | print "You need an API key in order to use SHODAN database. You can get one here: http://www.shodanhq.com/" 12 | sys.exit() 13 | self.api = WebAPI(self.key) 14 | 15 | def run(self): 16 | try: 17 | host = self.api.host(self.host) 18 | return host['data'] 19 | except: 20 | print "SHODAN empty reply or error in the call" 21 | return "error" 22 | -------------------------------------------------------------------------------- /modules/discovery/shodansearch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/shodansearch.pyc -------------------------------------------------------------------------------- /modules/discovery/twittersearch.py: -------------------------------------------------------------------------------- 1 | import string 2 | import requests 3 | import sys 4 | import myparser 5 | import re 6 | 7 | 8 | class search_twitter: 9 | 10 | def __init__(self, word, limit): 11 | self.word = word.replace(' ', '%20') 12 | self.results = "" 13 | self.totalresults = "" 14 | self.server = "www.google.com" 15 | self.hostname = "www.google.com" 16 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100116 Firefox/3.7" 17 | self.quantity = "100" 18 | self.limit = int(limit) 19 | self.counter = 0 20 | 21 | def do_search(self): 22 | try: 23 | urly="https://"+ self.server + "/search?num=100&start=" + str(self.counter) + "&hl=en&meta=&q=site%3Atwitter.com%20intitle%3A%22on+Twitter%22%20" + self.word 24 | except Exception, e: 25 | print e 26 | headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0'} 27 | try: 28 | r=requests.get(urly,headers=headers) 29 | except Exception,e: 30 | print e 31 | self.results = r.content 32 | self.totalresults += self.results 33 | 34 | def get_people(self): 35 | rawres = myparser.parser(self.totalresults, self.word) 36 | return rawres.people_twitter() 37 | 38 | def process(self): 39 | while (self.counter < self.limit): 40 | self.do_search() 41 | self.counter += 100 42 | print "\tSearching " + str(self.counter) + " results.." 43 | -------------------------------------------------------------------------------- /modules/discovery/twittersearch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/twittersearch.pyc -------------------------------------------------------------------------------- /modules/discovery/virustotal.py: -------------------------------------------------------------------------------- 1 | import string 2 | import requests 3 | import sys 4 | import myparser 5 | import re 6 | 7 | 8 | class search_virustotal: 9 | 10 | def __init__(self, word): 11 | self.word = word.replace(' ', '%20') 12 | self.results = "" 13 | self.totalresults = "" 14 | self.server = "www.google.com" 15 | self.hostname = "www.google.com" 16 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100116 Firefox/3.7" 17 | self.quantity = "100" 18 | self.counter = 0 19 | 20 | 21 | def do_search(self): 22 | try: 23 | urly="https://www.virustotal.com/en/domain/" + self.word + "/information/" 24 | except Exception, e: 25 | print e 26 | headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0'} 27 | try: 28 | r=requests.get(urly,headers=headers) 29 | except Exception,e: 30 | print e 31 | self.results = r.content 32 | self.totalresults += self.results 33 | 34 | def get_hostnames(self): 35 | rawres = myparser.parser(self.results, self.word) 36 | return rawres.hostnames() 37 | 38 | def process(self): 39 | self.do_search() 40 | print "\tSearching CRT.sh results.." -------------------------------------------------------------------------------- /modules/discovery/virustotal.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/virustotal.pyc -------------------------------------------------------------------------------- /modules/discovery/yahoosearch.py: -------------------------------------------------------------------------------- 1 | import httplib 2 | import myparser 3 | import time 4 | import sys 5 | 6 | 7 | class search_yahoo: 8 | 9 | def __init__(self, word, limit): 10 | self.word = word 11 | self.total_results = "" 12 | self.server = "search.yahoo.com" 13 | self.hostname = "search.yahoo.com" 14 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6" 15 | self.limit = limit 16 | self.counter = 0 17 | 18 | def do_search(self): 19 | h = httplib.HTTP(self.server) 20 | 21 | h.putrequest('GET', "/search?p=\"%40" + self.word 22 | + "\"&b=" + str(self.counter) + "&pz=10") 23 | h.putheader('Host', self.hostname) 24 | h.putheader('User-agent', self.userAgent) 25 | h.endheaders() 26 | returncode, returnmsg, headers = h.getreply() 27 | 28 | self.total_results += h.getfile().read() 29 | 30 | def process(self): 31 | while self.counter <= self.limit and self.counter <= 1000: 32 | self.do_search() 33 | time.sleep(1) 34 | 35 | print "\tSearching " + str(self.counter) + " results..." 36 | self.counter += 10 37 | 38 | def get_emails(self): 39 | rawres = myparser.parser(self.total_results, self.word) 40 | return rawres.emails() 41 | 42 | def get_hostnames(self): 43 | rawres = myparser.parser(self.total_results, self.word) 44 | return rawres.hostnames() 45 | -------------------------------------------------------------------------------- /modules/discovery/yahoosearch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/yahoosearch.pyc -------------------------------------------------------------------------------- /modules/discovery/yandexsearch.py: -------------------------------------------------------------------------------- 1 | import string 2 | import httplib 3 | import sys 4 | import myparser 5 | import re 6 | import time 7 | 8 | 9 | class search_yandex: 10 | 11 | def __init__(self, word, limit, start): 12 | self.word = word 13 | self.results = "" 14 | self.totalresults = "" 15 | self.server = "yandex.com" 16 | self.hostname = "yandex.com" 17 | self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6" 18 | self.limit = limit 19 | self.counter = start 20 | 21 | def do_search(self): 22 | h = httplib.HTTP(self.server) 23 | h.putrequest('GET', "/search?text=%40" + self.word + 24 | "&numdoc=50&lr=" + str(self.counter)) 25 | h.putheader('Host', self.hostname) 26 | h.putheader('User-agent', self.userAgent) 27 | h.endheaders() 28 | returncode, returnmsg, headers = h.getreply() 29 | self.results = h.getfile().read() 30 | self.totalresults += self.results 31 | print self.results 32 | 33 | def do_search_files(self, files): # TODO 34 | h = httplib.HTTP(self.server) 35 | h.putrequest('GET', "/search?text=%40" + self.word + 36 | "&numdoc=50&lr=" + str(self.counter)) 37 | h.putheader('Host', self.hostname) 38 | h.putheader('User-agent', self.userAgent) 39 | h.endheaders() 40 | returncode, returnmsg, headers = h.getreply() 41 | self.results = h.getfile().read() 42 | self.totalresults += self.results 43 | 44 | def check_next(self): 45 | renext = re.compile('topNextUrl') 46 | nextres = renext.findall(self.results) 47 | if nextres != []: 48 | nexty = "1" 49 | print str(self.counter) 50 | else: 51 | nexty = "0" 52 | return nexty 53 | 54 | def get_emails(self): 55 | rawres = myparser.parser(self.totalresults, self.word) 56 | return rawres.emails() 57 | 58 | def get_hostnames(self): 59 | rawres = myparser.parser(self.totalresults, self.word) 60 | return rawres.hostnames() 61 | 62 | def get_files(self): 63 | rawres = myparser.parser(self.totalresults, self.word) 64 | return rawres.fileurls(self.files) 65 | 66 | def process(self): 67 | while self.counter <= self.limit: 68 | self.do_search() 69 | self.counter += 50 70 | print "Searching " + str(self.counter) + " results..." 71 | 72 | def process_files(self, files): 73 | while self.counter < self.limit: 74 | self.do_search_files(files) 75 | time.sleep(0.3) 76 | self.counter += 50 77 | -------------------------------------------------------------------------------- /modules/discovery/yandexsearch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/discovery/yandexsearch.pyc -------------------------------------------------------------------------------- /modules/lib/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = ["markup", "graphs", "hostchecker"] 2 | -------------------------------------------------------------------------------- /modules/lib/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/lib/__init__.pyc -------------------------------------------------------------------------------- /modules/lib/graphs.py: -------------------------------------------------------------------------------- 1 | """ 2 | +-------------------------------------------------------------------+ 3 | | H T M L - G R A P H S (v4.8) | 4 | | | 5 | | Copyright Gerd Tentler www.gerd-tentler.de/tools | 6 | | Created: Sep. 17, 2002 Last modified: Feb. 13, 2010 | 7 | +-------------------------------------------------------------------+ 8 | | This program may be used and hosted free of charge by anyone for | 9 | | personal purpose as long as this copyright notice remains intact. | 10 | | | 11 | | Obtain permission before selling the code for this program or | 12 | | hosting this software on a commercial website or redistributing | 13 | | this software over the Internet or in any other medium. In all | 14 | | cases copyright must remain intact. | 15 | +-------------------------------------------------------------------+ 16 | 17 | ===================================================================================================== 18 | Example: 19 | 20 | import graphs 21 | graph = graphs.BarGraph('hBar') 22 | graph.values = [234, 125, 289, 147, 190] 23 | print graph.create() 24 | 25 | Returns HTML code 26 | ===================================================================================================== 27 | """ 28 | 29 | import re 30 | import math 31 | 32 | 33 | class BarGraph: 34 | 35 | """creates horizontal and vertical bar graphs, progress bars and faders""" 36 | 37 | def __init__(self, type=''): 38 | #------------------------------------------------------------------------- 39 | # Configuration 40 | #------------------------------------------------------------------------- 41 | # graph type: "hBar", "vBar", "pBar", or "fader" 42 | self.type = type and type or 'hBar' 43 | self.values = [] # graph data: list 44 | 45 | # graph background color: string 46 | self.graphBGColor = '' 47 | # graph border: string (CSS-spec: "size style color"; doesn't work with 48 | # NN4) 49 | self.graphBorder = '' 50 | # graph padding: integer (pixels) 51 | self.graphPadding = 0 52 | 53 | # titles: array or string with comma-separated values 54 | self.titles = [] 55 | self.titleColor = 'black' # title font color: string 56 | # title background color: string 57 | self.titleBGColor = '#C0E0FF' 58 | # title border: string (CSS specification) 59 | self.titleBorder = '2px groove white' 60 | # title font family: string (CSS specification) 61 | self.titleFont = 'Arial, Helvetica' 62 | # title font size: integer (pixels) 63 | self.titleSize = 12 64 | # title text align: "left", "center", or "right" 65 | self.titleAlign = 'center' 66 | # title padding: integer (pixels) 67 | self.titlePadding = 2 68 | 69 | # label names: list or string with comma-separated values 70 | self.labels = [] 71 | self.labelColor = 'black' # label font color: string 72 | # label background color: string 73 | self.labelBGColor = '#C0E0FF' 74 | # label border: string (CSS-spec: "size style color"; doesn't work with 75 | # NN4) 76 | self.labelBorder = '2px groove white' 77 | # label font family: string (CSS-spec) 78 | self.labelFont = 'Arial, Helvetica' 79 | # label font size: integer (pixels) 80 | self.labelSize = 12 81 | # label text align: "left", "center", or "right" 82 | self.labelAlign = 'center' 83 | # additional space between labels: integer (pixels) 84 | self.labelSpace = 0 85 | 86 | self.barWidth = 20 # bar width: integer (pixels) 87 | # bar length ratio: float (from 0.1 to 2.9) 88 | self.barLength = 1.0 89 | # bar colors OR bar images: list or string with comma-separated values 90 | self.barColors = [] 91 | # bar background color: string 92 | self.barBGColor = '' 93 | # bar border: string (CSS-spec: "size style color"; doesn't work with 94 | # NN4) 95 | self.barBorder = '2px outset white' 96 | # bar level colors: ascending list (bLevel, bColor[,...]); draw bars >= 97 | # bLevel with bColor 98 | self.barLevelColors = [] 99 | 100 | # show values: 0 = % only, 1 = abs. and %, 2 = abs. only, 3 = none 101 | self.showValues = 0 102 | # base value: integer or float (only hBar and vBar) 103 | self.baseValue = 0 104 | 105 | # abs. values font color: string 106 | self.absValuesColor = 'black' 107 | # abs. values background color: string 108 | self.absValuesBGColor = '#C0E0FF' 109 | # abs. values border: string (CSS-spec: "size style color"; doesn't 110 | # work with NN4) 111 | self.absValuesBorder = '2px groove white' 112 | # abs. values font family: string (CSS-spec) 113 | self.absValuesFont = 'Arial, Helvetica' 114 | # abs. values font size: integer (pixels) 115 | self.absValuesSize = 12 116 | # abs. values prefix: string (e.g. "$") 117 | self.absValuesPrefix = '' 118 | # abs. values suffix: string (e.g. " kg") 119 | self.absValuesSuffix = '' 120 | 121 | # perc. values font color: string 122 | self.percValuesColor = 'black' 123 | # perc. values font family: string (CSS-spec) 124 | self.percValuesFont = 'Arial, Helvetica' 125 | # perc. values font size: integer (pixels) 126 | self.percValuesSize = 12 127 | # perc. values number of decimals: integer 128 | self.percValuesDecimals = 0 129 | 130 | self.charts = 1 # number of charts: integer 131 | 132 | # hBar/vBar only: 133 | # legend items: list or string with comma-separated values 134 | self.legend = [] 135 | self.legendColor = 'black' # legend font color: string 136 | # legend background color: string 137 | self.legendBGColor = '#F0F0F0' 138 | # legend border: string (CSS-spec: "size style color"; doesn't work 139 | # with NN4) 140 | self.legendBorder = '2px groove white' 141 | # legend font family: string (CSS-spec) 142 | self.legendFont = 'Arial, Helvetica' 143 | # legend font size: integer (pixels) 144 | self.legendSize = 12 145 | # legend vertical align: "top", "center", "bottom" 146 | self.legendAlign = 'top' 147 | 148 | # debug mode: 0 = off, 1 = on; just views some extra information 149 | self.debug = 0 150 | #------------------------------------------------------------------------- 151 | 152 | # default bar colors; only used if barColors isn't set 153 | __colors = ( 154 | '#0000FF', 155 | '#FF0000', 156 | '#00E000', 157 | '#A0A0FF', 158 | '#FFA0A0', 159 | '#00A000') 160 | 161 | # error messages 162 | __err_type = 'ERROR: Type must be "hBar", "vBar", "pBar", or "fader"' 163 | 164 | # CSS names (don't change) 165 | __cssGRAPH = '' 166 | __cssBAR = '' 167 | __cssBARBG = '' 168 | __cssTITLE = '' 169 | __cssLABEL = '' 170 | __cssLABELBG = '' 171 | __cssLEGEND = '' 172 | __cssLEGENDBG = '' 173 | __cssABSVALUES = '' 174 | __cssPERCVALUES = '' 175 | 176 | # search pattern for images 177 | __img_pattern = re.compile(r'\.(jpg|jpeg|jpe|gif|png)') 178 | 179 | def set_styles(self): 180 | """set graph styles""" 181 | if self.graphBGColor: 182 | self.__cssGRAPH += 'background-color:' + self.graphBGColor + ';' 183 | if self.graphBorder: 184 | self.__cssGRAPH += 'border:' + self.graphBorder + ';' 185 | if self.barBorder: 186 | self.__cssBAR += 'border:' + self.barBorder + ';' 187 | if self.barBGColor: 188 | self.__cssBARBG += 'background-color:' + self.barBGColor + ';' 189 | if self.titleColor: 190 | self.__cssTITLE += 'color:' + self.titleColor + ';' 191 | if self.titleBGColor: 192 | self.__cssTITLE += 'background-color:' + self.titleBGColor + ';' 193 | if self.titleBorder: 194 | self.__cssTITLE += 'border:' + self.titleBorder + ';' 195 | if self.titleFont: 196 | self.__cssTITLE += 'font-family:' + self.titleFont + ';' 197 | if self.titleAlign: 198 | self.__cssTITLE += 'text-align:' + self.titleAlign + ';' 199 | if self.titleSize: 200 | self.__cssTITLE += 'font-size:' + str(self.titleSize) + 'px;' 201 | if self.titleBGColor: 202 | self.__cssTITLE += 'background-color:' + self.titleBGColor + ';' 203 | if self.titlePadding: 204 | self.__cssTITLE += 'padding:' + str(self.titlePadding) + 'px;' 205 | if self.labelColor: 206 | self.__cssLABEL += 'color:' + self.labelColor + ';' 207 | if self.labelBGColor: 208 | self.__cssLABEL += 'background-color:' + self.labelBGColor + ';' 209 | if self.labelBorder: 210 | self.__cssLABEL += 'border:' + self.labelBorder + ';' 211 | if self.labelFont: 212 | self.__cssLABEL += 'font-family:' + self.labelFont + ';' 213 | if self.labelSize: 214 | self.__cssLABEL += 'font-size:' + str(self.labelSize) + 'px;' 215 | if self.labelAlign: 216 | self.__cssLABEL += 'text-align:' + self.labelAlign + ';' 217 | if self.labelBGColor: 218 | self.__cssLABELBG += 'background-color:' + self.labelBGColor + ';' 219 | if self.legendColor: 220 | self.__cssLEGEND += 'color:' + self.legendColor + ';' 221 | if self.legendFont: 222 | self.__cssLEGEND += 'font-family:' + self.legendFont + ';' 223 | if self.legendSize: 224 | self.__cssLEGEND += 'font-size:' + str(self.legendSize) + 'px;' 225 | if self.legendBGColor: 226 | self.__cssLEGENDBG += 'background-color:' + \ 227 | self.legendBGColor + ';' 228 | if self.legendBorder: 229 | self.__cssLEGENDBG += 'border:' + self.legendBorder + ';' 230 | if self.absValuesColor: 231 | self.__cssABSVALUES += 'color:' + self.absValuesColor + ';' 232 | if self.absValuesBGColor: 233 | self.__cssABSVALUES += 'background-color:' + \ 234 | self.absValuesBGColor + ';' 235 | if self.absValuesBorder: 236 | self.__cssABSVALUES += 'border:' + self.absValuesBorder + ';' 237 | if self.absValuesFont: 238 | self.__cssABSVALUES += 'font-family:' + self.absValuesFont + ';' 239 | if self.absValuesSize: 240 | self.__cssABSVALUES += 'font-size:' + \ 241 | str(self.absValuesSize) + 'px;' 242 | if self.percValuesColor: 243 | self.__cssPERCVALUES += 'color:' + self.percValuesColor + ';' 244 | if self.percValuesFont: 245 | self.__cssPERCVALUES += 'font-family:' + self.percValuesFont + ';' 246 | if self.percValuesSize: 247 | self.__cssPERCVALUES += 'font-size:' + \ 248 | str(self.percValuesSize) + 'px;' 249 | 250 | def level_color(self, value, color): 251 | """return bar color for each level""" 252 | if self.barLevelColors: 253 | for i in range(0, len(self.barLevelColors), 2): 254 | try: 255 | if (self.barLevelColors[i] > 0 and value >= self.barLevelColors[i]) or \ 256 | (self.barLevelColors[i] < 0 and value <= self.barLevelColors[i]): 257 | color = self.barLevelColors[i + 1] 258 | except IndexError: 259 | pass 260 | return color 261 | 262 | def build_bar(self, value, width, height, color): 263 | """return a single bar""" 264 | title = self.absValuesPrefix + str(value) + self.absValuesSuffix 265 | bg = self.__img_pattern.search(color) and 'background' or 'bgcolor' 266 | bar = '' 267 | bar += '
' or '>' 269 | bar += '
' 272 | bar += '
' 273 | return bar 274 | 275 | def build_fader(self, value, width, height, x, color): 276 | """return a single fader""" 277 | fader = '' 278 | x -= int(round(width / 2)) 279 | if x > 0: 280 | fader += '' 281 | fader += '' 282 | fader += '
' + self.build_bar(value, width, height, color) + '
' 283 | return fader 284 | 285 | def build_value(self, val, max_dec, sum=0, align=''): 286 | """return a single bar/fader value""" 287 | val = _number_format(val, max_dec) 288 | if sum: 289 | sum = _number_format(sum, max_dec) 290 | value = '' 308 | legend += '' 309 | i = 0 310 | 311 | for color in barColors: 312 | if len(self.legend) >= i + 1: 313 | text = hasattr( 314 | self.legend[i], 315 | 'strip') and self.legend[i].strip() or str(self.legend[i]) 316 | else: 317 | text = '' 318 | legend += '' 319 | legend += '' 325 | legend += '' 327 | legend += '' 328 | i += 1 329 | 330 | legend += '
' + \ 320 | self.build_bar( 321 | '', 322 | self.barWidth, 323 | self.barWidth, 324 | color) + '' + text + '
' 331 | return legend 332 | 333 | def build_hTitle(self, titleLabel, titleValue, titleBar): 334 | """return horizontal titles""" 335 | title = '' 336 | title += '' + titleLabel + '' 337 | if titleValue != '': 338 | title += '' + titleValue + '' 340 | title += '' + titleBar + '' 341 | title += '' 342 | return title 343 | 344 | def create_hBar(self, value, percent, mPerc, mPerc_neg, 345 | max_neg, mul, valSpace, bColor, border, spacer, spacer_neg): 346 | """return a single horizontal bar with label and values (abs./perc.)""" 347 | bar = '' 348 | 349 | if percent < 0: 350 | percent *= -1 351 | bar += '' 363 | else: 364 | if max_neg: 365 | bar += '' 368 | if percent: 369 | bar += '' 373 | else: 374 | bar += '' 376 | bar += '' 383 | 384 | bar += '
' 355 | if self.showValues < 2: 356 | bar += '' + \ 357 | str(_number_format(percent, self.percValuesDecimals)) + \ 358 | '%' 359 | bar += ' ' 360 | bar += self.build_bar(value, int(round(percent * mul)), 361 | self.barWidth, bColor) 362 | bar += '' 367 | bar += '
' 370 | bar += self.build_bar(value, int(round(percent * mul)), 371 | self.barWidth, bColor) 372 | bar += '' 379 | if self.showValues < 2: 380 | bar += ' ' + \ 381 | str(_number_format(percent, self.percValuesDecimals)) + '%' 382 | bar += ' 
' 385 | return bar 386 | 387 | def create_vBar(self, value, percent, mPerc, mPerc_neg, 388 | max_neg, mul, valSpace, bColor, border, spacer, spacer_neg): 389 | """return a single vertical bar with label and values (abs./perc.)""" 390 | bar = '' 391 | 392 | if percent < 0: 393 | percent *= -1 394 | bar += '' 400 | bar += '' 407 | else: 408 | bar += '' 415 | if percent: 416 | bar += '' 420 | else: 421 | bar += '' 423 | if max_neg: 424 | bar += '' 427 | 428 | bar += '
' 397 | bar += self.build_bar(value, self.barWidth, 398 | int(round(percent * mul)), bColor) 399 | bar += '
' 403 | bar += (self.showValues < 2) and '' + \ 404 | str(_number_format(percent, self.percValuesDecimals)) + \ 405 | '%' or ' ' 406 | bar += '' 411 | if self.showValues < 2: 412 | bar += str(_number_format(percent, self.percValuesDecimals)) + \ 413 | '%' 414 | bar += '
' 417 | bar += self.build_bar(value, self.barWidth, 418 | int(round(percent * mul)), bColor) 419 | bar += '
' 426 | bar += '
' 429 | return bar 430 | 431 | def create(self): 432 | """create a complete bar graph (horizontal, vertical, progress, or fader)""" 433 | self.type = self.type.lower() 434 | d = self.values 435 | t = hasattr( 436 | self.titles, 437 | 'split') and self.titles.split( 438 | ',') or self.titles 439 | r = hasattr( 440 | self.labels, 441 | 'split') and self.labels.split( 442 | ',') or self.labels 443 | drc = hasattr( 444 | self.barColors, 445 | 'split') and self.barColors.split( 446 | ',') or self.barColors 447 | val = [] 448 | bc = [] 449 | if self.barLength < 0.1: 450 | self.barLength = 0.1 451 | elif self.barLength > 2.9: 452 | self.barLength = 2.9 453 | labels = (len(d) > len(r)) and len(d) or len(r) 454 | 455 | if self.type == 'pbar' or self.type == 'fader': 456 | if not self.barBGColor: 457 | self.barBGColor = self.labelBGColor 458 | if self.labelBGColor == self.barBGColor and len(t) == 0: 459 | self.labelBGColor = '' 460 | self.labelBorder = '' 461 | 462 | self.set_styles() 463 | 464 | graph = '' 466 | graph += '' 469 | 470 | if self.legend and self.type != 'pbar' and self.type != 'fader': 471 | graph += '
' 748 | if self.type == 'vbar': 749 | graph += '' 750 | graph += '
' 472 | 473 | if self.charts > 1: 474 | divide = math.ceil(labels / self.charts) 475 | graph += '' 731 | if self.showValues < 2: 732 | graph += '' 735 | graph += '' 736 | if self.labelSpace and i < len(v) - 1: 737 | graph += '' 739 | lcnt += 1 740 | 741 | else: 742 | graph += '' 743 | 744 | graph += '
' 476 | else: 477 | divide = 0 478 | 479 | sum = 0 480 | max = 0 481 | max_neg = 0 482 | max_dec = 0 483 | ccnt = 0 484 | lcnt = 0 485 | chart = 0 486 | 487 | for i in range(labels): 488 | if divide and i and not i % divide: 489 | lcnt = 0 490 | chart += 1 491 | 492 | try: 493 | drv = len(d[i]) and [e for e in d[i]] or [d[i]] 494 | except: 495 | drv = [d[i]] 496 | 497 | j = 0 498 | dec = 0 499 | if len(val) <= chart: 500 | val.append([]) 501 | 502 | for v in drv: 503 | s = str(v) 504 | if s.find('.') != -1: 505 | dec = len(s[s.find('.') + 1:]) 506 | if dec > max_dec: 507 | max_dec = dec 508 | 509 | if len(val[chart]) <= lcnt: 510 | val[chart].append([]) 511 | val[chart][lcnt].append(v) 512 | 513 | if v != 0: 514 | v -= self.baseValue 515 | 516 | if v > max: 517 | max = v 518 | elif v < max_neg: 519 | max_neg = v 520 | 521 | if v < 0: 522 | v *= -1 523 | sum += v 524 | 525 | if len(bc) <= j: 526 | if ccnt >= len(self.__colors): 527 | ccnt = 0 528 | if len(drc) <= j or len(drc[j]) < 3: 529 | bc.append(self.__colors[ccnt]) 530 | ccnt += 1 531 | else: 532 | bc.append(drc[j].strip()) 533 | 534 | j += 1 535 | 536 | lcnt += 1 537 | 538 | border = int(self.barBorder[0]) 539 | mPerc = sum and int(round(max * 100.0 / sum)) or 0 540 | if self.type == 'pbar' or self.type == 'fader': 541 | mul = 2 542 | else: 543 | mul = mPerc and 100.0 / mPerc or 1 544 | mul *= self.barLength 545 | 546 | if self.showValues < 2: 547 | if self.type == 'hbar': 548 | valSpace = (self.percValuesDecimals * (self.percValuesSize / 1.6)) + \ 549 | (self.percValuesSize * 3.2) 550 | else: 551 | valSpace = self.percValuesSize * 1.2 552 | else: 553 | valSpace = self.percValuesSize 554 | spacer = maxSize = int(round(mPerc * mul + valSpace + border * 2)) 555 | 556 | if max_neg: 557 | mPerc_neg = sum and int(round(-max_neg * 100.0 / sum)) or 0 558 | if mPerc_neg > mPerc and self.type != 'pbar' and self.type != 'fader': 559 | mul = 100.0 / mPerc_neg * self.barLength 560 | spacer_neg = int(round(mPerc_neg * mul + valSpace + border * 2)) 561 | maxSize += spacer_neg 562 | else: 563 | mPerc_neg = spacer_neg = 0 564 | 565 | titleLabel = '' 566 | titleValue = '' 567 | titleBar = '' 568 | 569 | if len(t) > 0: 570 | titleLabel = (t[0] == '') and ' ' or t[0] 571 | 572 | if self.showValues == 1 or self.showValues == 2: 573 | titleValue = (t[1] == '') and ' ' or t[1] 574 | titleBar = (t[2] == '') and ' ' or t[2] 575 | else: 576 | titleBar = (t[1] == '') and ' ' or t[1] 577 | 578 | chart = 0 579 | lcnt = 0 580 | 581 | for v in val: 582 | graph += '' 583 | 584 | if self.type == 'hbar': 585 | if len(t) > 0: 586 | graph += self.build_hTitle(titleLabel, 587 | titleValue, titleBar) 588 | 589 | for i in range(len(v)): 590 | label = ( 591 | lcnt < len(r)) and r[lcnt].strip() or str(lcnt + 1) 592 | rowspan = len(v[i]) 593 | graph += '' 597 | 598 | for j in range(len(v[i])): 599 | value = v[i][j] and v[i][j] - self.baseValue or 0 600 | percent = sum and value * 100.0 / sum or 0 601 | value = _number_format(v[i][j], max_dec) 602 | bColor = self.level_color(v[i][j], bc[j]) 603 | 604 | if self.showValues == 1 or self.showValues == 2: 605 | graph += self.build_value(v[i] 606 | [j], max_dec, 0, 'right') 607 | 608 | graph += '' 611 | graph += self.create_hBar( 612 | value, percent, mPerc, mPerc_neg, 613 | max_neg, mul, valSpace, bColor, border, spacer, spacer_neg) 614 | graph += '' 615 | if j < len(v[i]) - 1: 616 | graph += '' 617 | 618 | if self.labelSpace and i < len(v) - 1: 619 | graph += '' 621 | lcnt += 1 622 | 623 | elif self.type == 'vbar': 624 | graph += '' 625 | 626 | if titleBar != '': 627 | titleBar = titleBar.replace('-', '-
') 628 | graph += '' 630 | 631 | for i in range(len(v)): 632 | for j in range(len(v[i])): 633 | value = v[i][j] and v[i][j] - self.baseValue or 0 634 | percent = sum and value * 100.0 / sum or 0 635 | value = _number_format(v[i][j], max_dec) 636 | bColor = self.level_color(v[i][j], bc[j]) 637 | 638 | graph += '' 641 | graph += self.create_vBar( 642 | value, percent, mPerc, mPerc_neg, 643 | max_neg, mul, valSpace, bColor, border, spacer, spacer_neg) 644 | graph += '' 645 | 646 | if self.labelSpace: 647 | graph += '' 648 | 649 | if self.showValues == 1 or self.showValues == 2: 650 | graph += '' 651 | if titleValue != '': 652 | graph += '' 654 | 655 | for i in range(len(v)): 656 | for j in range(len(v[i])): 657 | graph += self.build_value(v[i][j], max_dec) 658 | if self.labelSpace: 659 | graph += '' 661 | 662 | graph += '' 663 | if titleLabel != '': 664 | graph += '' 666 | 667 | for i in range(len(v)): 668 | label = ( 669 | lcnt < len(r)) and r[lcnt].strip() or str(lcnt + 1) 670 | colspan = len(v[i]) 671 | graph += '' 675 | if self.labelSpace: 676 | graph += '' 677 | lcnt += 1 678 | 679 | graph += '' 680 | 681 | elif self.type == 'pbar' or self.type == 'fader': 682 | if len(t) > 0: 683 | graph += self.build_hTitle(titleLabel, 684 | titleValue, titleBar) 685 | 686 | for i in range(len(v)): 687 | try: 688 | m = (len(v[i]) > 1) and True or False 689 | except: 690 | m = False 691 | 692 | if m or not i: 693 | label = ( 694 | lcnt < len(r)) and r[lcnt].strip() or str(i + 1) 695 | graph += '' 696 | 697 | if len(r): 698 | graph += '' 700 | 701 | try: 702 | sum = v[i][1] and v[i][1] or v[-1][0] 703 | except: 704 | sum = v[-1][0] 705 | 706 | percent = sum and v[i][0] * 100.0 / sum or 0 707 | value = _number_format(v[i][0], max_dec) 708 | 709 | if self.showValues == 1 or self.showValues == 2: 710 | graph += self.build_value(v[i] 711 | [0], max_dec, sum, 'right') 712 | 713 | graph += '' 716 | 717 | self.barColors = ( 718 | len(drc) >= i + 1) and drc[i].strip() or self.__colors[0] 719 | bColor = self.level_color(v[i][0], self.barColors) 720 | graph += '
1) and ' rowspan=' + str(rowspan) or '') + \ 595 | '>' 596 | graph += ' ' + label + ' 
' + titleBar + '
' + titleValue + '
' + titleLabel + ' 1) and ' colspan=' + str(colspan) or '') + \ 673 | '>' 674 | graph += ' ' + label + ' 
' 699 | graph += ' ' + label + ' 
' 730 | graph += '
' 721 | if self.type == 'fader': 722 | graph += self.build_fader( 723 | value, int(round(self.barWidth / 2)), 724 | self.barWidth, int(round(percent * mul)), bColor) 725 | else: 726 | graph += self.build_bar(value, 727 | int(round(percent * mul)), self.barWidth, bColor) 728 | graph += '
 ' + \ 733 | str(_number_format(percent, self.percValuesDecimals)) + \ 734 | '%
' + self.__err_type + '
' 745 | 746 | if chart < self.charts - 1 and len(val[chart + 1]): 747 | graph += '
' 751 | 752 | chart += 1 753 | 754 | if self.charts > 1: 755 | graph += '
' 756 | 757 | if self.legend and self.type != 'pbar' and self.type != 'fader': 758 | graph += ' ' 761 | graph += self.build_legend(bc) 762 | graph += '' 763 | 764 | if self.debug: 765 | graph += "
sum=%s max=%s max_neg=%s max_dec=%s " % (sum, 766 | max, max_neg, max_dec) 767 | graph += "mPerc=%s mPerc_neg=%s mul=%s valSpace=%s" % (mPerc, 768 | mPerc_neg, mul, valSpace) 769 | 770 | graph += '' 771 | return graph 772 | 773 | 774 | def _number_format(val, dec): 775 | """return float with dec decimals; if dec is 0, return integer""" 776 | return dec and ('%.' + str(dec) + 'f') % val or int(round(val)) 777 | 778 | if __name__ == '__main__': 779 | print __doc__ 780 | -------------------------------------------------------------------------------- /modules/lib/graphs.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/lib/graphs.pyc -------------------------------------------------------------------------------- /modules/lib/hostchecker.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | """ 4 | Created by laramies on 2008-08-21. 5 | """ 6 | 7 | import sys 8 | import socket 9 | 10 | 11 | class Checker(): 12 | 13 | def __init__(self, hosts): 14 | self.hosts = hosts 15 | self.realhosts = [] 16 | 17 | def check(self): 18 | for x in self.hosts: 19 | try: 20 | res = socket.gethostbyname(x) 21 | self.realhosts.append(res + ":" + x) 22 | except Exception as e: 23 | pass 24 | return self.realhosts 25 | -------------------------------------------------------------------------------- /modules/lib/hostchecker.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/lib/hostchecker.pyc -------------------------------------------------------------------------------- /modules/lib/htmlExport.py: -------------------------------------------------------------------------------- 1 | from lib import markup 2 | from lib import graphs 3 | import re 4 | 5 | 6 | class htmlExport(): 7 | 8 | def __init__(self, users, hosts, vhosts, dnsres, 9 | dnsrev, file, domain, shodan, tldres): 10 | self.users = users 11 | self.hosts = hosts 12 | self.vhost = vhosts 13 | self.fname = file 14 | self.dnsres = dnsres 15 | self.dnsrev = dnsrev 16 | self.domain = domain 17 | self.shodan = shodan 18 | self.tldres = tldres 19 | self.style = "" 20 | 21 | def styler(self): 22 | a = """ 82 | """ 83 | self.style = a 84 | 85 | def writehtml(self): 86 | page = markup.page() 87 | # page.init (title="theHarvester 88 | # Results",css=('edge.css'),footer="Edge-security 2011")A 89 | page.html() 90 | self.styler() 91 | page.head(self.style) 92 | page.body() 93 | page.h1("theHarvester results") 94 | page.h2("for :" + self.domain) 95 | page.h3("Dashboard:") 96 | graph = graphs.BarGraph('vBar') 97 | graph.values = [len( 98 | self.users), 99 | len(self.hosts), 100 | len(self.vhost), 101 | len(self.tldres), 102 | len(self.shodan)] 103 | graph.labels = ['Emails', 'hosts', 'Vhost', 'TLD', 'Shodan'] 104 | graph.showValues = 1 105 | page.body(graph.create()) 106 | page.h3("E-mails names found:") 107 | if self.users != []: 108 | page.ul(class_="userslist") 109 | page.li(self.users, class_="useritem") 110 | page.ul.close() 111 | else: 112 | page.h2("No emails found") 113 | page.h3("Hosts found:") 114 | if self.hosts != []: 115 | page.ul(class_="softlist") 116 | page.li(self.hosts, class_="softitem") 117 | page.ul.close() 118 | else: 119 | page.h2("No hosts found") 120 | if self.tldres != []: 121 | page.h3("TLD domains found in TLD expansion:") 122 | page.ul(class_="tldlist") 123 | page.li(self.tldres, class_="tlditem") 124 | page.ul.close() 125 | if self.dnsres != []: 126 | page.h3("Hosts found in DNS brute force:") 127 | page.ul(class_="dnslist") 128 | page.li(self.dnsres, class_="dnsitem") 129 | page.ul.close() 130 | if self.dnsrev != []: 131 | page.h3("Hosts found with reverse lookup :") 132 | page.ul(class_="dnsrevlist") 133 | page.li(self.dnsrev, class_="dnsrevitem") 134 | page.ul.close() 135 | if self.vhost != []: 136 | page.h3("Virtual hosts found:") 137 | page.ul(class_="pathslist") 138 | page.li(self.vhost, class_="pathitem") 139 | page.ul.close() 140 | if self.shodan != []: 141 | shodanalysis = [] 142 | page.h3("Shodan results:") 143 | for x in self.shodan: 144 | res = x.split("SAPO") 145 | page.h3(res[0]) 146 | page.a("Port :" + res[2]) 147 | page.pre(res[1]) 148 | page.pre.close() 149 | ban = res[1] 150 | reg_server = re.compile('Server:.*') 151 | temp = reg_server.findall(res[1]) 152 | if temp != []: 153 | shodanalysis.append(res[0] + ":" + temp[0]) 154 | if shodanalysis != []: 155 | page.h3("Server technologies:") 156 | repeated = [] 157 | for x in shodanalysis: 158 | if x not in repeated: 159 | page.pre(x) 160 | page.pre.close() 161 | repeated.append(x) 162 | page.body.close() 163 | page.html.close() 164 | file = open(self.fname, 'w') 165 | for x in page.content: 166 | try: 167 | file.write(x) 168 | except: 169 | print "Exception" + x # send to logs 170 | pass 171 | file.close 172 | return "ok" 173 | -------------------------------------------------------------------------------- /modules/lib/htmlExport.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/lib/htmlExport.pyc -------------------------------------------------------------------------------- /modules/lib/markup.py: -------------------------------------------------------------------------------- 1 | # This code is in the public domain, it comes 2 | # with absolutely no warranty and you can do 3 | # absolutely whatever you want with it. 4 | 5 | __date__ = '17 May 2007' 6 | __version__ = '1.7' 7 | __doc__ = """ 8 | This is markup.py - a Python module that attempts to 9 | make it easier to generate HTML/XML from a Python program 10 | in an intuitive, lightweight, customizable and pythonic way. 11 | 12 | The code is in the public domain. 13 | 14 | Version: %s as of %s. 15 | 16 | Documentation and further info is at http://markup.sourceforge.net/ 17 | 18 | Please send bug reports, feature requests, enhancement 19 | ideas or questions to nogradi at gmail dot com. 20 | 21 | Installation: drop markup.py somewhere into your Python path. 22 | """ % ( __version__, __date__ ) 23 | 24 | import string 25 | 26 | 27 | class element: 28 | 29 | """This class handles the addition of a new element.""" 30 | 31 | def __init__(self, tag, case='lower', parent=None): 32 | self.parent = parent 33 | 34 | if case == 'lower': 35 | self.tag = tag.lower() 36 | else: 37 | self.tag = tag.upper() 38 | 39 | def __call__(self, *args, **kwargs): 40 | if len(args) > 1: 41 | raise ArgumentError(self.tag) 42 | 43 | # if class_ was defined in parent it should be added to every element 44 | if self.parent is not None and self.parent.class_ is not None: 45 | if 'class_' not in kwargs: 46 | kwargs['class_'] = self.parent.class_ 47 | 48 | if self.parent is None and len(args) == 1: 49 | x = [self.render(self.tag, False, myarg, mydict) 50 | for myarg, mydict in _argsdicts(args, kwargs)] 51 | return '\n'.join(x) 52 | elif self.parent is None and len(args) == 0: 53 | x = [self.render(self.tag, True, myarg, mydict) 54 | for myarg, mydict in _argsdicts(args, kwargs)] 55 | return '\n'.join(x) 56 | 57 | if self.tag in self.parent.twotags: 58 | for myarg, mydict in _argsdicts(args, kwargs): 59 | self.render(self.tag, False, myarg, mydict) 60 | elif self.tag in self.parent.onetags: 61 | if len(args) == 0: 62 | for myarg, mydict in _argsdicts(args, kwargs): 63 | # here myarg is always None, because len( args ) = 0 64 | self.render(self.tag, True, myarg, mydict) 65 | else: 66 | raise ClosingError(self.tag) 67 | elif self.parent.mode == 'strict_html' and self.tag in self.parent.deptags: 68 | raise DeprecationError(self.tag) 69 | else: 70 | raise InvalidElementError(self.tag, self.parent.mode) 71 | 72 | def render(self, tag, single, between, kwargs): 73 | """Append the actual tags to content.""" 74 | 75 | out = "<%s" % tag 76 | for key, value in kwargs.iteritems(): 77 | # when value is None that means stuff like <... checked> 78 | if value is not None: 79 | # strip this so class_ will mean class, etc. 80 | key = key.strip('_') 81 | # special cases, maybe change _ to - overall? 82 | if key == 'http_equiv': 83 | key = 'http-equiv' 84 | elif key == 'accept_charset': 85 | key = 'accept-charset' 86 | out = "%s %s=\"%s\"" % (out, key, escape(value)) 87 | else: 88 | out = "%s %s" % (out, key) 89 | if between is not None: 90 | out = "%s>%s" % (out, between, tag) 91 | else: 92 | if single: 93 | out = "%s />" % out 94 | else: 95 | out = "%s>" % out 96 | if self.parent is not None: 97 | self.parent.content.append(out) 98 | else: 99 | return out 100 | 101 | def close(self): 102 | """Append a closing tag unless element has only opening tag.""" 103 | 104 | if self.tag in self.parent.twotags: 105 | self.parent.content.append("" % self.tag) 106 | elif self.tag in self.parent.onetags: 107 | raise ClosingError(self.tag) 108 | elif self.parent.mode == 'strict_html' and self.tag in self.parent.deptags: 109 | raise DeprecationError(self.tag) 110 | 111 | def open(self, **kwargs): 112 | """Append an opening tag.""" 113 | 114 | if self.tag in self.parent.twotags or self.tag in self.parent.onetags: 115 | self.render(self.tag, False, None, kwargs) 116 | elif self.mode == 'strict_html' and self.tag in self.parent.deptags: 117 | raise DeprecationError(self.tag) 118 | 119 | 120 | class page: 121 | 122 | """This is our main class representing a document. Elements are added 123 | as attributes of an instance of this class.""" 124 | 125 | def __init__(self, mode='strict_html', case='lower', 126 | onetags=None, twotags=None, separator='\n', class_=None): 127 | """Stuff that effects the whole document. 128 | 129 | mode -- 'strict_html' for HTML 4.01 (default) 130 | 'html' alias for 'strict_html' 131 | 'loose_html' to allow some deprecated elements 132 | 'xml' to allow arbitrary elements 133 | 134 | case -- 'lower' element names will be printed in lower case (default) 135 | 'upper' they will be printed in upper case 136 | 137 | onetags -- list or tuple of valid elements with opening tags only 138 | twotags -- list or tuple of valid elements with both opening and closing tags 139 | these two keyword arguments may be used to select 140 | the set of valid elements in 'xml' mode 141 | invalid elements will raise appropriate exceptions 142 | 143 | separator -- string to place between added elements, defaults to newline 144 | 145 | class_ -- a class that will be added to every element if defined""" 146 | 147 | valid_onetags = [ 148 | "AREA", 149 | "BASE", 150 | "BR", 151 | "COL", 152 | "FRAME", 153 | "HR", 154 | "IMG", 155 | "INPUT", 156 | "LINK", 157 | "META", 158 | "PARAM"] 159 | valid_twotags = [ 160 | "A", "ABBR", "ACRONYM", "ADDRESS", "B", "BDO", "BIG", "BLOCKQUOTE", "BODY", "BUTTON", 161 | "CAPTION", "CITE", "CODE", "COLGROUP", "DD", "DEL", "DFN", "DIV", "DL", "DT", "EM", "FIELDSET", 162 | "FORM", "FRAMESET", "H1", "H2", "H3", "H4", "H5", "H6", "HEAD", "HTML", "I", "IFRAME", "INS", 163 | "KBD", "LABEL", "LEGEND", "LI", "MAP", "NOFRAMES", "NOSCRIPT", "OBJECT", "OL", "OPTGROUP", 164 | "OPTION", "P", "PRE", "Q", "SAMP", "SCRIPT", "SELECT", "SMALL", "SPAN", "STRONG", "STYLE", 165 | "SUB", "SUP", "TABLE", "TBODY", "TD", "TEXTAREA", "TFOOT", "TH", "THEAD", "TITLE", "TR", 166 | "TT", "UL", "VAR"] 167 | deprecated_onetags = ["BASEFONT", "ISINDEX"] 168 | deprecated_twotags = [ 169 | "APPLET", 170 | "CENTER", 171 | "DIR", 172 | "FONT", 173 | "MENU", 174 | "S", 175 | "STRIKE", 176 | "U"] 177 | 178 | self.header = [] 179 | self.content = [] 180 | self.footer = [] 181 | self.case = case 182 | self.separator = separator 183 | 184 | # init( ) sets it to True so we know that has to be 185 | # printed at the end 186 | self._full = False 187 | self.class_ = class_ 188 | 189 | if mode == 'strict_html' or mode == 'html': 190 | self.onetags = valid_onetags 191 | self.onetags += map(string.lower, self.onetags) 192 | self.twotags = valid_twotags 193 | self.twotags += map(string.lower, self.twotags) 194 | self.deptags = deprecated_onetags + deprecated_twotags 195 | self.deptags += map(string.lower, self.deptags) 196 | self.mode = 'strict_html' 197 | elif mode == 'loose_html': 198 | self.onetags = valid_onetags + deprecated_onetags 199 | self.onetags += map(string.lower, self.onetags) 200 | self.twotags = valid_twotags + deprecated_twotags 201 | self.twotags += map(string.lower, self.twotags) 202 | self.mode = mode 203 | elif mode == 'xml': 204 | if onetags and twotags: 205 | self.onetags = onetags 206 | self.twotags = twotags 207 | elif (onetags and not twotags) or (twotags and not onetags): 208 | raise CustomizationError() 209 | else: 210 | self.onetags = russell() 211 | self.twotags = russell() 212 | self.mode = mode 213 | else: 214 | raise ModeError(mode) 215 | 216 | def __getattr__(self, attr): 217 | if attr.startswith("__") and attr.endswith("__"): 218 | raise AttributeError(attr) 219 | return element(attr, case=self.case, parent=self) 220 | 221 | def __str__(self): 222 | 223 | if self._full and (self.mode == 'strict_html' or self.mode == 'loose_html'): 224 | end = ['', ''] 225 | else: 226 | end = [] 227 | 228 | return ( 229 | self.separator.join( 230 | self.header + 231 | self.content + 232 | self.footer + 233 | end) 234 | ) 235 | 236 | def __call__(self, escape=False): 237 | """Return the document as a string. 238 | 239 | escape -- False print normally 240 | True replace < and > by < and > 241 | the default escape sequences in most browsers""" 242 | 243 | if escape: 244 | return _escape(self.__str__()) 245 | else: 246 | return self.__str__() 247 | 248 | def add(self, text): 249 | """This is an alias to addcontent.""" 250 | self.addcontent(text) 251 | 252 | def addfooter(self, text): 253 | """Add some text to the bottom of the document""" 254 | self.footer.append(text) 255 | 256 | def addheader(self, text): 257 | """Add some text to the top of the document""" 258 | self.header.append(text) 259 | 260 | def addcontent(self, text): 261 | """Add some text to the main part of the document""" 262 | self.content.append(text) 263 | 264 | def init(self, lang='en', css=None, metainfo=None, title=None, header=None, 265 | footer=None, charset=None, encoding=None, doctype=None, bodyattrs=None, script=None): 266 | """This method is used for complete documents with appropriate 267 | doctype, encoding, title, etc information. For an HTML/XML snippet 268 | omit this method. 269 | 270 | lang -- language, usually a two character string, will appear 271 | as in html mode (ignored in xml mode) 272 | 273 | css -- Cascading Style Sheet filename as a string or a list of 274 | strings for multiple css files (ignored in xml mode) 275 | 276 | metainfo -- a dictionary in the form { 'name':'content' } to be inserted 277 | into meta element(s) as 278 | (ignored in xml mode) 279 | 280 | bodyattrs --a dictionary in the form { 'key':'value', ... } which will be added 281 | as attributes of the element as 282 | (ignored in xml mode) 283 | 284 | script -- dictionary containing src:type pairs, 285 | 286 | title -- the title of the document as a string to be inserted into 287 | a title element as my title (ignored in xml mode) 288 | 289 | header -- some text to be inserted right after the element 290 | (ignored in xml mode) 291 | 292 | footer -- some text to be inserted right before the element 293 | (ignored in xml mode) 294 | 295 | charset -- a string defining the character set, will be inserted into a 296 | 297 | element (ignored in xml mode) 298 | 299 | encoding -- a string defining the encoding, will be put into to first line of 300 | the document as in 301 | xml mode (ignored in html mode) 302 | 303 | doctype -- the document type string, defaults to 304 | 305 | in html mode (ignored in xml mode)""" 306 | 307 | self._full = True 308 | 309 | if self.mode == 'strict_html' or self.mode == 'loose_html': 310 | if doctype is None: 311 | doctype = "" 312 | self.header.append(doctype) 313 | self.html(lang=lang) 314 | self.head() 315 | if charset is not None: 316 | self.meta( 317 | http_equiv='Content-Type', 318 | content="text/html; charset=%s" % 319 | charset) 320 | if metainfo is not None: 321 | self.metainfo(metainfo) 322 | if css is not None: 323 | self.css(css) 324 | if title is not None: 325 | self.title(title) 326 | if script is not None: 327 | self.scripts(script) 328 | self.head.close() 329 | if bodyattrs is not None: 330 | self.body(**bodyattrs) 331 | else: 332 | self.body() 333 | if header is not None: 334 | self.content.append(header) 335 | if footer is not None: 336 | self.footer.append(footer) 337 | 338 | elif self.mode == 'xml': 339 | if doctype is None: 340 | if encoding is not None: 341 | doctype = "" % encoding 342 | else: 343 | doctype = "" 344 | self.header.append(doctype) 345 | 346 | def css(self, filelist): 347 | """This convenience function is only useful for html. 348 | It adds css stylesheet(s) to the document via the element.""" 349 | 350 | if isinstance(filelist, basestring): 351 | self.link( 352 | href=filelist, 353 | rel='stylesheet', 354 | type='text/css', 355 | media='all') 356 | else: 357 | for file in filelist: 358 | self.link( 359 | href=file, 360 | rel='stylesheet', 361 | type='text/css', 362 | media='all') 363 | 364 | def metainfo(self, mydict): 365 | """This convenience function is only useful for html. 366 | It adds meta information via the element, the argument is 367 | a dictionary of the form { 'name':'content' }.""" 368 | 369 | if isinstance(mydict, dict): 370 | for name, content in mydict.iteritems(): 371 | self.meta(name=name, content=content) 372 | else: 373 | raise TypeError( 374 | "Metainfo should be called with a dictionary argument of name:content pairs.") 375 | 376 | def scripts(self, mydict): 377 | """Only useful in html, mydict is dictionary of src:type pairs will 378 | be rendered as """ 379 | 380 | if isinstance(mydict, dict): 381 | for src, type in mydict.iteritems(): 382 | self.script('', src=src, type='text/%s' % type) 383 | else: 384 | raise TypeError( 385 | "Script should be given a dictionary of src:type pairs.") 386 | 387 | 388 | class _oneliner: 389 | 390 | """An instance of oneliner returns a string corresponding to one element. 391 | This class can be used to write 'oneliners' that return a string 392 | immediately so there is no need to instantiate the page class.""" 393 | 394 | def __init__(self, case='lower'): 395 | self.case = case 396 | 397 | def __getattr__(self, attr): 398 | if attr.startswith("__") and attr.endswith("__"): 399 | raise AttributeError(attr) 400 | return element(attr, case=self.case, parent=None) 401 | 402 | oneliner = _oneliner(case='lower') 403 | upper_oneliner = _oneliner(case='upper') 404 | 405 | 406 | def _argsdicts(args, mydict): 407 | """A utility generator that pads argument list and dictionary values, will only be called with len( args ) = 0, 1.""" 408 | 409 | if len(args) == 0: 410 | args = None, 411 | elif len(args) == 1: 412 | args = _totuple(args[0]) 413 | else: 414 | raise Exception("We should have never gotten here.") 415 | 416 | mykeys = mydict.keys() 417 | myvalues = map(_totuple, mydict.values()) 418 | 419 | maxlength = max(map(len, [args] + myvalues)) 420 | 421 | for i in xrange(maxlength): 422 | thisdict = {} 423 | for key, value in zip(mykeys, myvalues): 424 | try: 425 | thisdict[key] = value[i] 426 | except IndexError: 427 | thisdict[key] = value[-1] 428 | try: 429 | thisarg = args[i] 430 | except IndexError: 431 | thisarg = args[-1] 432 | 433 | yield thisarg, thisdict 434 | 435 | 436 | def _totuple(x): 437 | """Utility stuff to convert string, int, float, None or anything to a usable tuple.""" 438 | 439 | if isinstance(x, basestring): 440 | out = x, 441 | elif isinstance(x, (int, float)): 442 | out = str(x), 443 | elif x is None: 444 | out = None, 445 | else: 446 | out = tuple(x) 447 | 448 | return out 449 | 450 | 451 | def escape(text, newline=False): 452 | """Escape special html characters.""" 453 | 454 | if isinstance(text, basestring): 455 | if '&' in text: 456 | text = text.replace('&', '&') 457 | if '>' in text: 458 | text = text.replace('>', '>') 459 | if '<' in text: 460 | text = text.replace('<', '<') 461 | if '\"' in text: 462 | text = text.replace('\"', '"') 463 | if '\'' in text: 464 | text = text.replace('\'', '"') 465 | if newline: 466 | if '\n' in text: 467 | text = text.replace('\n', '
') 468 | 469 | return text 470 | 471 | _escape = escape 472 | 473 | 474 | def unescape(text): 475 | """Inverse of escape.""" 476 | 477 | if isinstance(text, basestring): 478 | if '&' in text: 479 | text = text.replace('&', '&') 480 | if '>' in text: 481 | text = text.replace('>', '>') 482 | if '<' in text: 483 | text = text.replace('<', '<') 484 | if '"' in text: 485 | text = text.replace('"', '\"') 486 | 487 | return text 488 | 489 | 490 | class dummy: 491 | 492 | """A dummy class for attaching attributes.""" 493 | pass 494 | 495 | doctype = dummy() 496 | doctype.frameset = "" 497 | doctype.strict = "" 498 | doctype.loose = "" 499 | 500 | 501 | class russell: 502 | 503 | """A dummy class that contains anything.""" 504 | 505 | def __contains__(self, item): 506 | return True 507 | 508 | 509 | class MarkupError(Exception): 510 | 511 | """All our exceptions subclass this.""" 512 | 513 | def __str__(self): 514 | return self.message 515 | 516 | 517 | class ClosingError(MarkupError): 518 | 519 | def __init__(self, tag): 520 | self.message = "The element '%s' does not accept non-keyword arguments (has no closing tag)." % tag 521 | 522 | 523 | class OpeningError(MarkupError): 524 | 525 | def __init__(self, tag): 526 | self.message = "The element '%s' can not be opened." % tag 527 | 528 | 529 | class ArgumentError(MarkupError): 530 | 531 | def __init__(self, tag): 532 | self.message = "The element '%s' was called with more than one non-keyword argument." % tag 533 | 534 | 535 | class InvalidElementError(MarkupError): 536 | 537 | def __init__(self, tag, mode): 538 | self.message = "The element '%s' is not valid for your mode '%s'." % ( 539 | tag, 540 | mode) 541 | 542 | 543 | class DeprecationError(MarkupError): 544 | 545 | def __init__(self, tag): 546 | self.message = "The element '%s' is deprecated, instantiate markup.page with mode='loose_html' to allow it." % tag 547 | 548 | 549 | class ModeError(MarkupError): 550 | 551 | def __init__(self, mode): 552 | self.message = "Mode '%s' is invalid, possible values: strict_html, loose_html, xml." % mode 553 | 554 | 555 | class CustomizationError(MarkupError): 556 | 557 | def __init__(self): 558 | self.message = "If you customize the allowed elements, you must define both types 'onetags' and 'twotags'." 559 | 560 | if __name__ == '__main__': 561 | print __doc__ 562 | -------------------------------------------------------------------------------- /modules/lib/markup.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joker25000/Devploit-/3dc532e297cc89db7b10749c688237d4cce78bbd/modules/lib/markup.pyc -------------------------------------------------------------------------------- /modules/myparser.py: -------------------------------------------------------------------------------- 1 | import string 2 | import re 3 | 4 | 5 | class parser: 6 | 7 | def __init__(self, results, word): 8 | self.results = results 9 | self.word = word 10 | self.temp = [] 11 | 12 | def genericClean(self): 13 | self.results = re.sub('', '', self.results) 14 | self.results = re.sub('', '', self.results) 15 | self.results = re.sub('', '', self.results) 16 | self.results = re.sub('', '', self.results) 17 | self.results = re.sub('%2f', ' ', self.results) 18 | self.results = re.sub('%3a', ' ', self.results) 19 | self.results = re.sub('', '', self.results) 20 | self.results = re.sub('', '', self.results) 21 | self.results = re.sub('','',self.results) 22 | self.results = re.sub('','',self.results) 23 | 24 | 25 | for e in ('>', ':', '=', '<', '/', '\\', ';', '&', '%3A', '%3D', '%3C'): 26 | self.results = string.replace(self.results, e, ' ') 27 | 28 | def urlClean(self): 29 | self.results = re.sub('', '', self.results) 30 | self.results = re.sub('', '', self.results) 31 | self.results = re.sub('%2f', ' ', self.results) 32 | self.results = re.sub('%3a', ' ', self.results) 33 | 34 | for e in ('<', '>', ':', '=', ';', '&', '%3A', '%3D', '%3C'): 35 | self.results = string.replace(self.results, e, ' ') 36 | 37 | def emails(self): 38 | self.genericClean() 39 | reg_emails = re.compile( 40 | # Local part is required, charset is flexible 41 | # https://tools.ietf.org/html/rfc6531 (removed * and () as they provide FP mostly ) 42 | '[a-zA-Z0-9.\-_+#~!$&\',;=:]+' + 43 | '@' + 44 | '[a-zA-Z0-9.-]*' + 45 | self.word) 46 | self.temp = reg_emails.findall(self.results) 47 | emails = self.unique() 48 | return emails 49 | 50 | def fileurls(self, file): 51 | urls = [] 52 | reg_urls = re.compile('', '', self.results) 64 | self.results = re.sub('', '', self.results) 65 | reg_people = re.compile('>[a-zA-Z0-9._ ]* - Google\+') 66 | #reg_people = re.compile('">[a-zA-Z0-9._ -]* profiles | LinkedIn') 67 | self.temp = reg_people.findall(self.results) 68 | resul = [] 69 | for x in self.temp: 70 | y = string.replace(x, ' | LinkedIn', '') 71 | y = string.replace(y, ' profiles ', '') 72 | y = string.replace(y, 'LinkedIn', '') 73 | y = string.replace(y, '"', '') 74 | y = string.replace(y, '>', '') 75 | if y != " ": 76 | resul.append(y) 77 | return resul 78 | 79 | 80 | 81 | def people_twitter(self): 82 | reg_people = re.compile('(@[a-zA-Z0-9._ -]*)') 83 | #reg_people = re.compile('">[a-zA-Z0-9._ -]* profiles | LinkedIn') 84 | self.temp = reg_people.findall(self.results) 85 | users = self.unique() 86 | resul = [] 87 | for x in users: 88 | y = string.replace(x, ' | LinkedIn', '') 89 | y = string.replace(y, ' profiles ', '') 90 | y = string.replace(y, 'LinkedIn', '') 91 | y = string.replace(y, '"', '') 92 | y = string.replace(y, '>', '') 93 | if y != " ": 94 | resul.append(y) 95 | return resul 96 | 97 | def people_linkedin(self): 98 | reg_people = re.compile('">[a-zA-Z0-9._ -]* \| LinkedIn') 99 | #reg_people = re.compile('">[a-zA-Z0-9._ -]* profiles | LinkedIn') 100 | self.temp = reg_people.findall(self.results) 101 | resul = [] 102 | for x in self.temp: 103 | y = string.replace(x, ' | LinkedIn', '') 104 | y = string.replace(y, ' profiles ', '') 105 | y = string.replace(y, 'LinkedIn', '') 106 | y = string.replace(y, '"', '') 107 | y = string.replace(y, '>', '') 108 | if y != " ": 109 | resul.append(y) 110 | return resul 111 | 112 | def profiles(self): 113 | reg_people = re.compile('">[a-zA-Z0-9._ -]* - Google Profile') 114 | self.temp = reg_people.findall(self.results) 115 | resul = [] 116 | for x in self.temp: 117 | y = string.replace(x, ' Google Profile', '') 118 | y = string.replace(y, '-', '') 119 | y = string.replace(y, '">', '') 120 | if y != " ": 121 | resul.append(y) 122 | return resul 123 | 124 | def people_jigsaw(self): 125 | res = [] 126 | #reg_people = re.compile("'tblrow' title='[a-zA-Z0-9.-]*'>") 127 | reg_people = re.compile( 128 | "href=javascript:showContact\('[0-9]*'\)>[a-zA-Z0-9., ]*") 129 | self.temp = reg_people.findall(self.results) 130 | for x in self.temp: 131 | a = x.split('>')[1].replace("[a-zA-Z0-9]*') 144 | self.temp = reg_sets.findall(self.results) 145 | sets = [] 146 | for x in self.temp: 147 | y = string.replace(x, '>', '') 148 | y = string.replace(y, '(.*?)') 154 | temp = reg_hosts.findall(self.results) 155 | for x in temp: 156 | if x.count(':'): 157 | res = x.split(':')[1].split('/')[2] 158 | else: 159 | res = x.split("/")[0] 160 | self.temp.append(res) 161 | hostnames = self.unique() 162 | return hostnames 163 | 164 | def unique(self): 165 | self.new = [] 166 | for x in self.temp: 167 | if x not in self.new: 168 | self.new.append(x) 169 | return self.new 170 | -------------------------------------------------------------------------------- /modules/tests/myparser_test.py: -------------------------------------------------------------------------------- 1 | # 2 | # Unit tests for myparser.py 3 | # 4 | import myparser 5 | 6 | import unittest 7 | 8 | class TestMyParser(unittest.TestCase): 9 | 10 | def test_emails(self): 11 | word = 'domain.com' 12 | results = '@domain.com***a@domain***banotherdomain.com***c@domain.com***d@sub.domain.com***' 13 | p = myparser.parser(results, word) 14 | emails = sorted(p.emails()) 15 | self.assertEquals(emails, [ 'c@domain.com', 'd@sub.domain.com' ]) 16 | 17 | if __name__ == '__main__': 18 | unittest.main() 19 | -------------------------------------------------------------------------------- /modules/theHarvester.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import string 4 | import httplib 5 | import sys 6 | import os 7 | from socket import * 8 | import re 9 | import getopt 10 | import requests 11 | 12 | from discovery import * 13 | from lib import htmlExport 14 | from lib import hostchecker 15 | 16 | def usage(): 17 | 18 | comm = os.path.basename(sys.argv[0]) 19 | 20 | if os.path.dirname(sys.argv[0]) == os.getcwd(): 21 | comm = "./" + comm 22 | 23 | 24 | def start(argv): 25 | if len(sys.argv) < 4: 26 | sys.exit() 27 | try: 28 | opts, args = getopt.getopt(argv, "l:d:b:s:vf:nhcte:") 29 | except getopt.GetoptError: 30 | sys.exit() 31 | start = 0 32 | host_ip = [] 33 | filename = "" 34 | bingapi = "yes" 35 | dnslookup = False 36 | dnsbrute = False 37 | dnstld = False 38 | shodan = False 39 | vhost = [] 40 | virtual = False 41 | limit = 100 42 | dnsserver = "" 43 | for opt, arg in opts: 44 | if opt == '-l': 45 | limit = int(arg) 46 | elif opt == '-d': 47 | word = arg 48 | elif opt == '-s': 49 | start = int(arg) 50 | elif opt == '-v': 51 | virtual = "basic" 52 | elif opt == '-b': 53 | engine = arg 54 | if engine not in ("baidu", "bing", "crtsh","bingapi","dogpile", "google", "googleCSE","virustotal", "googleplus", "google-profiles","linkedin", "pgp", "twitter", "vhost", "yahoo","netcraft","all"): 55 | usage() 56 | sys.exit() 57 | else: 58 | pass 59 | if engine == "all": 60 | all_emails = [] 61 | all_hosts = [] 62 | virtual = "basic" 63 | print '\033[1;97m[>]\033[1;m Initiating 3 intel modules' 64 | 65 | print "\033[1;97m[>]\033[1;m Loading Alpha module (1/3)" 66 | search = googlesearch.search_google(word, limit, start) 67 | search.process() 68 | emails = search.get_emails() 69 | hosts = search.get_hostnames() 70 | all_emails.extend(emails) 71 | all_hosts.extend(hosts) 72 | 73 | print "\033[1;97m[>]\033[1;m Beta module deployed (2/3)" 74 | bingapi = "no" 75 | search = bingsearch.search_bing(word, limit, start) 76 | search.process(bingapi) 77 | emails = search.get_emails() 78 | hosts = search.get_hostnames() 79 | all_hosts.extend(hosts) 80 | all_emails.extend(emails) 81 | 82 | print "\033[1;97m[>]\033[1;m Gamma module initiated (3/3)" 83 | search = exaleadsearch.search_exalead(word, limit, start) 84 | search.process() 85 | emails = search.get_emails() 86 | hosts = search.get_hostnames() 87 | all_hosts.extend(hosts) 88 | all_emails.extend(emails) 89 | 90 | #Clean up email list, sort and uniq 91 | all_emails=sorted(set(all_emails)) 92 | #Results############################################################ 93 | if all_emails == []: 94 | print "No emails found" 95 | else: 96 | print "\n\n[+] Emails found:" 97 | print "------------------" 98 | print "\n".join(all_emails) 99 | 100 | if all_hosts == []: 101 | print "No hosts found" 102 | else: 103 | print "\n[+] Hosts found in search engines:" 104 | print "------------------------------------" 105 | all_hosts=sorted(set(all_hosts)) 106 | print "[-] Resolving hostnames IPs... " 107 | full_host = hostchecker.Checker(all_hosts) 108 | full = full_host.check() 109 | for host in full: 110 | ip = host.split(':')[0] 111 | print host 112 | if host_ip.count(ip.lower()): 113 | pass 114 | else: 115 | host_ip.append(ip.lower()) 116 | 117 | #Virtual hosts search############################################### 118 | if virtual == "basic": 119 | print "[+] Virtual hosts:" 120 | print "-----------------" 121 | for l in host_ip: 122 | search = bingsearch.search_bing(l, limit, start) 123 | search.process_vhost() 124 | res = search.get_allhostnames() 125 | for x in res: 126 | x = re.sub(r'[[\<\/?]*[\w]*>]*','',x) 127 | x = re.sub('<','',x) 128 | x = re.sub('>','',x) 129 | print l + "\t" + x 130 | vhost.append(l + ":" + x) 131 | full.append(l + ":" + x) 132 | vhost=sorted(set(vhost)) 133 | else: 134 | pass 135 | if __name__ == "__main__": 136 | try: 137 | start(sys.argv[1:]) 138 | except KeyboardInterrupt: 139 | print "Search interrupted by user.." 140 | except: 141 | sys.exit() 142 | -------------------------------------------------------------------------------- /update.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | #-*- coding: utf-8 -*- 3 | # 4 | # author : Joker-Security 5 | # Tested on Kali Linux / lxle-linux 6 | # Simple script for install Devploit 7 | 8 | __author__ = "Joker-Security" 9 | 10 | import os 11 | import pip 12 | 13 | banner = ''' 14 | 15 | \033[92m 16 | 17 | ██████╗ ███████╗██╗ ██╗██████╗ ██╗ ██████╗ ██╗████████╗ 18 | ██╔══██╗██╔════╝██║ ██║██╔══██╗██║ ██╔═══██╗██║╚══██╔══╝ 19 | ██║ ██║█████╗ ██║ ██║██████╔╝██║ ██║ ██║██║ ██║ 20 | ██║ ██║██╔══╝ ╚██╗ ██╔╝██╔═══╝ ██║ ██║ ██║██║ ██║ 21 | ██████╔╝███████╗ ╚████╔╝ ██║ ███████╗╚██████╔╝██║ ██║ 22 | ╚═════╝ ╚══════╝ ╚═══╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝v2.3 23 | Update Script for Devploit 24 | Created by Joker-Security [dev-labs] 25 | 26 | ''' 27 | print banner 28 | 29 | content = """ 30 | #!/bin/bash 31 | 32 | cd /usr/share/Devploit 33 | python Devploit "$@" 34 | """ 35 | 36 | def main(): 37 | if os.name != "nt": 38 | if os.getuid() == 0: 39 | os.system("git clone http://github.com/joker25000/Devploit /usr/share/Devploit") 40 | for i in ["requests", "bs4"]: 41 | pip.main(["install", i]) 42 | 43 | file = open("/usr/bin/Devploit", "w") 44 | file.write(content) 45 | file.close() 46 | 47 | os.system("chmod +x /usr/bin/Devploit") 48 | 49 | print "\n\n[+] Update finished, Run \033[91m'Devploit'\033[92m In Terminal!" 50 | else: 51 | print "Run as root!" 52 | else: 53 | print "This script doesn't work on Windows!" 54 | 55 | if __name__ == "__main__": 56 | main() 57 | --------------------------------------------------------------------------------