jmdx / TLS-poison

MIT License
684 stars 75 forks source link

Optimization(s) Request #1

Open BitTheByte opened 4 years ago

BitTheByte commented 4 years ago

Kudos for this research it's very awesome :) Is there any reason for using RedisDB as a config? it's actually easier to store the config as a file I understand you don't want to supply them as command-line arguments in case you wanted to change them without restarting the whole server however this could be done using a file also

payload  = \r\nthis_is_payload\r\n
redirect = a/a
sleep    = 2000

Also alternate-dns.py could be replaced by


from dnslib import RR
from dnslib.server import DNSServer,DNSHandler,BaseResolver,DNSLogger
import sys
counter = 0
def get_ip():
    global counter
    if counter == 0:
        counter = 1
        return sys.argv[1]
    elif counter == 1:
        counter = 0
        return sys.argv[2]

class Resolver(BaseResolver):
    def resolve(self,request,handler):
        asked_name = str( request.q.qname )
        reply = request.reply()
        reply.add_answer(*RR.fromZone(asked_name + " 0 A " + get_ip()))
        return reply

resolver   = Resolver()
logger     = DNSLogger()
server     = DNSServer(resolver,port=53,address='0.0.0.0',tcp=0,logger=logger)
server.start()
// target_ip = server hosting the custom-tls binary
// destination_ip = 127.0.0.1
$ sudo python3 dns.py target_ip destination_ip

I'm open to make a PR if you agreed on the changes

jmdx commented 4 years ago

I definitely like both ideas, that's pretty elegant. If you have time to put together a PR I'd really appreciate it!