improved session logging
git-svn-id: file:///home/svn/incoming/trunk@2939 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
db40a55547
commit
1a8bb86843
|
@ -73,12 +73,16 @@ class Logging
|
|||
Msf::Config.session_log_directory + File::SEPARATOR + "#{session.log_file_name}.log")
|
||||
|
||||
register_log_source(session.log_source, f)
|
||||
|
||||
rlog("\n[*] Logging started: #{Time.now}\n\n", session.log_source)
|
||||
end
|
||||
|
||||
#
|
||||
# Stops logging for a given session.
|
||||
#
|
||||
def self.stop_session_log(session)
|
||||
rlog("\n[*] Logging stopped: #{Time.now}\n\n", session.log_source)
|
||||
|
||||
deregister_log_source(session.log_source)
|
||||
end
|
||||
|
||||
|
|
|
@ -116,9 +116,10 @@ module Session
|
|||
def log_file_name
|
||||
dt = Time.now
|
||||
|
||||
dstr = sprintf("%.4d%.2d%.2d", dt.year, dt.mon, dt.mday)
|
||||
dstr = sprintf("%.4d%.2d%.2d", dt.year, dt.mon, dt.mday)
|
||||
rhost = (tunnel_peer || 'unknown').split(':')[0]
|
||||
|
||||
("#{dstr}_" + tunnel_to_s + "_#{name.to_s}_#{(type || 'unknown').downcase}").gsub(/\s/, '_').gsub(/->/, 'to')
|
||||
("#{dstr}_#{rhost}_#{type}.log")
|
||||
end
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue