Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization(s) Request #1

Open
BitTheByte opened this issue Aug 7, 2020 · 1 comment
Open

Optimization(s) Request #1

BitTheByte opened this issue Aug 7, 2020 · 1 comment

Comments

@BitTheByte
Copy link

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
Copy link
Owner

jmdx commented Aug 9, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants