Skip to content

Commit af33087

Browse files
committed
Prefix time module with namespace resolution operator
1 parent 5576a2c commit af33087

File tree

26 files changed

+55
-55
lines changed

26 files changed

+55
-55
lines changed

lib/rex/job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def initialize(container, jid, name, ctx, run_proc, clean_proc)
2727
# Otherwise, the job is run inline.
2828
#
2929
def start(async = false)
30-
self.start_time = Time.now
30+
self.start_time = ::Time.now
3131
if (async)
3232
self.job_thread = Rex::ThreadFactory.spawn("JobID(#{jid})-#{name}", false) {
3333
# Deschedule our thread momentarily

lib/rex/logging/log_sink.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def log(sev, src, level, msg)
3030
# This method returns the current timestamp in MM/DD/YYYY HH:Mi:SS format.
3131
#
3232
def get_current_timestamp
33-
return Time.now.strftime("%m/%d/%Y %H:%M:%S")
33+
return ::Time.now.strftime("%m/%d/%Y %H:%M:%S")
3434
end
3535

3636
end

lib/rex/parser/apple_backup_manifestdb.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ def parse_mbdb
5050
info[:unknown3] = mbdb_read_int(4)
5151
info[:uid] = mbdb_read_int(4)
5252
info[:gid] = mbdb_read_int(4)
53-
info[:mtime] = Time.at(mbdb_read_int(4))
54-
info[:atime] = Time.at(mbdb_read_int(4))
55-
info[:ctime] = Time.at(mbdb_read_int(4))
53+
info[:mtime] = ::Time.at(mbdb_read_int(4))
54+
info[:atime] = ::Time.at(mbdb_read_int(4))
55+
info[:ctime] = ::Time.at(mbdb_read_int(4))
5656
info[:length] = mbdb_read_int(8)
5757
info[:flag] = mbdb_read_int(1)
5858
property_count = mbdb_read_int(1)

lib/rex/post/file_stat.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ def blocks
6363
self.stathash['st_blocks']
6464
end
6565
def atime
66-
Time.at(self.stathash['st_atime'])
66+
::Time.at(self.stathash['st_atime'])
6767
end
6868
def mtime
69-
Time.at(self.stathash['st_mtime'])
69+
::Time.at(self.stathash['st_mtime'])
7070
end
7171
def ctime
72-
Time.at(self.stathash['st_ctime'])
72+
::Time.at(self.stathash['st_ctime'])
7373
end
7474

7575
def update(buf)

lib/rex/post/hwbridge/ui/console/command_dispatcher/core.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def cmd_status(*args)
220220
print_status("HW Version: #{status['hw_version']}") if status.key? 'hw_version'
221221
print_status("Uptime: #{stats['uptime']} seconds") if stats.key? 'uptime'
222222
print_status("Packets Sent: #{stats['packet_stats']}") if stats.key? 'packet_stats'
223-
print_status("Last packet Sent: #{Time.at(stats['last_request'])}") if stats.key? 'last_request'
223+
print_status("Last packet Sent: #{::Time.at(stats['last_request'])}") if stats.key? 'last_request'
224224
print_status("Voltage: #{stats['voltage']}") if stats.key? 'voltage' and not stats['voltage'] == 'not supported'
225225
end
226226

lib/rex/post/meterpreter/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def init_meterpreter(sock,opts={})
125125
self.target_id = opts[:target_id]
126126
self.capabilities = opts[:capabilities] || {}
127127
self.commands = []
128-
self.last_checkin = Time.now
128+
self.last_checkin = ::Time.now
129129

130130
self.conn_id = opts[:conn_id]
131131
self.url = opts[:url]

lib/rex/post/meterpreter/extensions/android/android.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def interval_collect(opts)
102102

103103
response.each(TLV_TYPE_COLLECT_RESULT_GROUP) do |g|
104104
timestamp = g.get_tlv_value(TLV_TYPE_COLLECT_RESULT_TIMESTAMP)
105-
timestamp = Time.at(timestamp).to_datetime.strftime('%Y-%m-%d %H:%M:%S')
105+
timestamp = ::Time.at(timestamp).to_datetime.strftime('%Y-%m-%d %H:%M:%S')
106106

107107
g.each(TLV_TYPE_COLLECT_RESULT_WIFI) do |w|
108108
bssid = w.get_tlv_value(TLV_TYPE_COLLECT_RESULT_WIFI_BSSID)
@@ -129,7 +129,7 @@ def interval_collect(opts)
129129

130130
response.each(TLV_TYPE_COLLECT_RESULT_GROUP) do |g|
131131
timestamp = g.get_tlv_value(TLV_TYPE_COLLECT_RESULT_TIMESTAMP)
132-
timestamp = Time.at(timestamp).to_datetime.strftime('%Y-%m-%d %H:%M:%S')
132+
timestamp = ::Time.at(timestamp).to_datetime.strftime('%Y-%m-%d %H:%M:%S')
133133

134134
g.each(TLV_TYPE_COLLECT_RESULT_GEO) do |w|
135135
lat = w.get_tlv_value(TLV_TYPE_GEO_LAT)
@@ -145,7 +145,7 @@ def interval_collect(opts)
145145

146146
response.each(TLV_TYPE_COLLECT_RESULT_GROUP) do |g|
147147
timestamp = g.get_tlv_value(TLV_TYPE_COLLECT_RESULT_TIMESTAMP)
148-
timestamp = Time.at(timestamp).to_datetime.strftime('%Y-%m-%d %H:%M:%S')
148+
timestamp = ::Time.at(timestamp).to_datetime.strftime('%Y-%m-%d %H:%M:%S')
149149

150150
g.each(TLV_TYPE_COLLECT_RESULT_CELL) do |cell|
151151

lib/rex/post/meterpreter/extensions/priv/fs.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ def get_file_mace(file_path)
3636
# Return the hash of times associated with the MACE values
3737
begin
3838
return {
39-
'Modified' => Time.at(response.get_tlv_value(TLV_TYPE_FS_FILE_MODIFIED)),
40-
'Accessed' => Time.at(response.get_tlv_value(TLV_TYPE_FS_FILE_ACCESSED)),
41-
'Created' => Time.at(response.get_tlv_value(TLV_TYPE_FS_FILE_CREATED)),
42-
'Entry Modified' => Time.at(response.get_tlv_value(TLV_TYPE_FS_FILE_EMODIFIED))
39+
'Modified' => ::Time.at(response.get_tlv_value(TLV_TYPE_FS_FILE_MODIFIED)),
40+
'Accessed' => ::Time.at(response.get_tlv_value(TLV_TYPE_FS_FILE_ACCESSED)),
41+
'Created' => ::Time.at(response.get_tlv_value(TLV_TYPE_FS_FILE_CREATED)),
42+
'Entry Modified' => ::Time.at(response.get_tlv_value(TLV_TYPE_FS_FILE_EMODIFIED))
4343
}
4444
rescue RangeError
4545
raise RangeError, 'Invalid MACE values'

lib/rex/post/meterpreter/extensions/stdapi/sys/event_log_subsystem/event_record.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class EventRecord
2727

2828
def initialize(recnum, timegen, timewri, id, type, cat, strs, data)
2929
self.num = recnum
30-
self.generated = Time.at(timegen)
31-
self.written = Time.at(timewri)
30+
self.generated = ::Time.at(timegen)
31+
self.written = ::Time.at(timewri)
3232
self.eventid = id
3333
self.type = type
3434
self.category = cat

lib/rex/post/meterpreter/packet.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ def self.generate_command_id_map_c
481481
/*!
482482
* @file common_command_ids.h
483483
* @brief Declarations of command ID values
484-
* @description This file was generated #{Time.now.utc}. Do not modify directly.
484+
* @description This file was generated #{::Time.now.utc}. Do not modify directly.
485485
*/
486486
#ifndef _METERPRETER_SOURCE_COMMON_COMMAND_IDS_H
487487
#define _METERPRETER_SOURCE_COMMON_COMMAND_IDS_H
@@ -504,7 +504,7 @@ def self.generate_command_id_map_java
504504
/**
505505
* All supported Command Identifiers
506506
*
507-
* @author Genereated by a tool @ #{Time.now.utc}
507+
* @author Genereated by a tool @ #{::Time.now.utc}
508508
*/
509509
public interface CommandId {
510510
#{command_ids.join("\n")}
@@ -516,7 +516,7 @@ def self.generate_command_id_map_php_lib(lib, id_map)
516516
command_ids = id_map.map {|k, v| "define('COMMAND_ID_#{k.upcase}', #{v});"}
517517
%Q^
518518
# ---------------------------------------------------------------
519-
# --- THIS CONTENT WAS GENERATED BY A TOOL @ #{Time.now.utc}
519+
# --- THIS CONTENT WAS GENERATED BY A TOOL @ #{::Time.now.utc}
520520
# IDs for #{lib}
521521
#{command_ids.join("\n")}
522522
# ---------------------------------------------------------------
@@ -539,7 +539,7 @@ def self.generate_command_id_map_python
539539
command_ids = id_map.map {|k, v| " (#{v}, '#{k.downcase}'),"}
540540
%Q^
541541
# ---------------------------------------------------------------
542-
# --- THIS CONTENT WAS GENERATED BY A TOOL @ #{Time.now.utc}
542+
# --- THIS CONTENT WAS GENERATED BY A TOOL @ #{::Time.now.utc}
543543
COMMAND_IDS = (
544544
#{command_ids.join("\n")}
545545
)
@@ -568,7 +568,7 @@ def self.generate_command_id_map_python_extension
568568
command_ids = id_map.map {|k, v| "COMMAND_ID_#{k.upcase} = #{v}"}
569569
%Q^
570570
# ---------------------------------------------------------------
571-
# --- THIS CONTENT WAS GENERATED BY A TOOL @ #{Time.now.utc}
571+
# --- THIS CONTENT WAS GENERATED BY A TOOL @ #{::Time.now.utc}
572572
573573
#{command_ids.join("\n")}
574574
@@ -597,7 +597,7 @@ def self.generate_command_id_map_csharp
597597
command_ids = id_map.map {|k, v| "#{k.split('_').map(&:capitalize).join} = #{v},"}
598598
%Q^
599599
/// <summary>
600-
// This content was generated by a tool @ #{Time.now.utc}
600+
// This content was generated by a tool @ #{::Time.now.utc}
601601
/// </summary>
602602
namespace MSF.Powershell.Meterpreter
603603
{

0 commit comments

Comments
 (0)