BAT=r’’’
C:\SmartNetworks\Tools\myfile.bat
‘’’
import os
import sys
import platform
import subprocess
import ctypes
class disable_file_system_redirection:
_disable = ctypes.windll.kernel32.Wow64DisableWow64FsRedirect ion
_revert = ctypes.windll.kernel32.Wow64RevertWow64FsRedirecti on
def enter(self):
self.old_value = ctypes.c_long()
self.success = self._disable(ctypes.byref(self.old_value))
def exit(self, type, value, traceback):
if self.success:
self._revert(self.old_value)
path=“C:\SmartNetworks\Tools\myfiletemp.bat”
with open(path,“w”) as f:
f.write(BAT)
try:
with disable_file_system_redirection():
print “Excuting Bat File”
process = subprocess.Popen([path],stdout=subprocess.PIPE)
stdout = process.communicate()[0]
print “---------------------------”
print stdout
except:
print “Excuting Bat File”
process = subprocess.Popen([path],stdout=subprocess.PIPE)
stdout = process.communicate()[0]
print “---------------------------”
print stdout
if os.path.exists(path):
try:
os.remove(path)
except:
pass
That script creates the following output in the log
Executing Bat File
C:\SmartNetworks\Tools\CheckIn Spectre.bat WARNING:
The system is VULNERABLE to Meltdown and/or Spectre. WARNING:
This system does NOT have the firmware/microcode patch installed to be able to address Spectre.
"Spectre Checker Result: " 56
can you append this script so that it sends this info in an email