Added error handling to DNS and SMB servers when port is in use

Added check to see if a plugins options were called without loading the actual plugin
This commit is contained in:
byt3bl33d3r 2015-05-06 23:07:59 +02:00
commit d3e509d4cd
10 changed files with 45 additions and 23 deletions

View file

@ -474,10 +474,14 @@ class DNSChef(ConfigWatcher):
self.onConfigChange()
self.startConfigWatch()
if self.config['MITMf']['DNS']['tcp'].lower() == 'on':
self.startTCP()
else:
self.startUDP()
try:
if self.config['MITMf']['DNS']['tcp'].lower() == 'on':
self.startTCP()
else:
self.startUDP()
except socket.error as e:
if "Address already in use" in e:
sys.exit("\n[-] Unable to start DNS server on port {}: port already in use".format(self.config['MITMf']['DNS']['port']))
# Initialize and start the DNS Server
def startUDP(self):