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

Session logging bugfix and small improvement #8601

Merged
merged 2 commits into from Jun 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/msf/core/session.rb
Expand Up @@ -214,8 +214,9 @@ def log_file_name

dstr = sprintf("%.4d%.2d%.2d", dt.year, dt.mon, dt.mday)
rhost = session_host.gsub(':', '_')
sname = name.to_s.gsub(/\W+/,'_')

"#{dstr}_#{rhost}_#{type}"
"#{dstr}_#{sname}_#{rhost}_#{type}"
end

#
Expand Down
2 changes: 1 addition & 1 deletion lib/rex/logging/sinks/timestamp_flatfile.rb
Expand Up @@ -13,7 +13,7 @@ class TimestampFlatfile < Flatfile

def log(sev, src, level, msg, from) # :nodoc:
return unless msg.present?
msg = msg.chop.gsub(/\x1b\[[0-9;]*[mG]/,'').gsub(/[\x01-\x02]/, " ")
msg = msg.gsub(/\x1b\[[0-9;]*[mG]/,'').gsub(/[\x01-\x02]/, ' ').gsub(/\s+$/,'')
fd.write("[#{get_current_timestamp}] #{msg}\n")
fd.flush
end
Expand Down