mirror of
https://github.com/lgandx/Responder.git
synced 2025-07-07 05:21:22 -07:00
Config dumped independently. Responder-Session.log is now a clean file.
This commit is contained in:
parent
35d933d596
commit
92c9191bda
2 changed files with 7 additions and 8 deletions
11
settings.py
11
settings.py
|
@ -20,7 +20,7 @@ import subprocess
|
||||||
|
|
||||||
from utils import *
|
from utils import *
|
||||||
|
|
||||||
__version__ = 'Responder 2.3.2'
|
__version__ = 'Responder 2.3.2.3'
|
||||||
|
|
||||||
class Settings:
|
class Settings:
|
||||||
|
|
||||||
|
@ -195,18 +195,13 @@ class Settings:
|
||||||
logging.warning('Responder Started: %s' % self.CommandLine)
|
logging.warning('Responder Started: %s' % self.CommandLine)
|
||||||
|
|
||||||
Formatter = logging.Formatter('%(asctime)s - %(message)s')
|
Formatter = logging.Formatter('%(asctime)s - %(message)s')
|
||||||
CLog_Handler = logging.FileHandler(self.ResponderConfigDump, 'a')
|
|
||||||
PLog_Handler = logging.FileHandler(self.PoisonersLogFile, 'w')
|
PLog_Handler = logging.FileHandler(self.PoisonersLogFile, 'w')
|
||||||
ALog_Handler = logging.FileHandler(self.AnalyzeLogFile, 'a')
|
ALog_Handler = logging.FileHandler(self.AnalyzeLogFile, 'a')
|
||||||
CLog_Handler.setLevel(logging.INFO)
|
|
||||||
PLog_Handler.setLevel(logging.INFO)
|
PLog_Handler.setLevel(logging.INFO)
|
||||||
ALog_Handler.setLevel(logging.INFO)
|
ALog_Handler.setLevel(logging.INFO)
|
||||||
PLog_Handler.setFormatter(Formatter)
|
PLog_Handler.setFormatter(Formatter)
|
||||||
ALog_Handler.setFormatter(Formatter)
|
ALog_Handler.setFormatter(Formatter)
|
||||||
|
|
||||||
self.ResponderConfigLogger = logging.getLogger('Config Dump Log')
|
|
||||||
self.ResponderConfigLogger.addHandler(CLog_Handler)
|
|
||||||
|
|
||||||
self.PoisonersLogger = logging.getLogger('Poisoners Log')
|
self.PoisonersLogger = logging.getLogger('Poisoners Log')
|
||||||
self.PoisonersLogger.addHandler(PLog_Handler)
|
self.PoisonersLogger.addHandler(PLog_Handler)
|
||||||
|
|
||||||
|
@ -217,8 +212,8 @@ class Settings:
|
||||||
DNS = subprocess.check_output(["cat", "/etc/resolv.conf"])
|
DNS = subprocess.check_output(["cat", "/etc/resolv.conf"])
|
||||||
RoutingInfo = subprocess.check_output(["netstat", "-rn"])
|
RoutingInfo = subprocess.check_output(["netstat", "-rn"])
|
||||||
Message = "Current environment is:\nNetwork Config:\n%s\nDNS Settings:\n%s\nRouting info:\n%s\n\n"%(NetworkCard,DNS,RoutingInfo)
|
Message = "Current environment is:\nNetwork Config:\n%s\nDNS Settings:\n%s\nRouting info:\n%s\n\n"%(NetworkCard,DNS,RoutingInfo)
|
||||||
self.ResponderConfigLogger.warning(Message)
|
utils.DumpConfig(self.ResponderConfigDump, Message)
|
||||||
self.ResponderConfigLogger.warning(str(self))
|
utils.DumpConfig(self.ResponderConfigDump,str(self))
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
global Config
|
global Config
|
||||||
|
|
4
utils.py
4
utils.py
|
@ -130,6 +130,10 @@ def WriteData(outfile, data, user):
|
||||||
with open(outfile,"a") as outf2:
|
with open(outfile,"a") as outf2:
|
||||||
outf2.write(data + '\n')
|
outf2.write(data + '\n')
|
||||||
|
|
||||||
|
# Function used to write debug config and network info.
|
||||||
|
def DumpConfig(outfile, data):
|
||||||
|
with open(outfile,"a") as dump:
|
||||||
|
dump.write(data + '\n')
|
||||||
|
|
||||||
def SaveToDb(result):
|
def SaveToDb(result):
|
||||||
# Creating the DB if it doesn't exist
|
# Creating the DB if it doesn't exist
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue