Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acbcaa337e | ||
|
|
f4dbe57244 | ||
|
|
b494c64a2f | ||
|
|
321e086b95 | ||
|
|
fb60d6b867 | ||
|
|
8ff2e2074a | ||
|
|
1151a1c43f | ||
|
|
13bc6cecc4 | ||
|
|
a4ea572458 | ||
|
|
880df4dee9 | ||
|
|
b75e86dd11 | ||
|
|
75c84092ae | ||
|
|
c69db97da8 | ||
|
|
9c2a8892ae | ||
|
|
f92111563c | ||
|
|
0abb3e78cb | ||
|
|
fb83071419 | ||
|
|
f593c6df8b | ||
|
|
9b452b25c2 | ||
|
|
c835fcf99a | ||
|
|
e4373edc54 | ||
|
|
686c05785f | ||
|
|
994358a793 | ||
|
|
b02ca3757c | ||
|
|
164ec25415 | ||
|
|
8ee85cd9ca | ||
|
|
c07bf05754 | ||
|
|
2e2a08a765 | ||
|
|
10be5f442f | ||
|
|
0fcd8565d8 | ||
|
|
e07eee86dd | ||
|
|
f25d5d73c6 | ||
|
|
28b4d00d3c | ||
|
|
c75cf8a539 | ||
|
|
ff7199b857 | ||
|
|
5613fd81b7 | ||
|
|
c1458502f7 | ||
|
|
b2f620bd3d | ||
|
|
0e1030f186 | ||
|
|
ff4ffb8ec5 | ||
|
|
941458a381 | ||
|
|
560eb924b8 | ||
|
|
c3fab9e48b | ||
|
|
fc4dc74f9e | ||
|
|
35f0362910 | ||
|
|
27dfaa5f06 | ||
|
|
cf1866710a | ||
|
|
b3a5d06c4a | ||
|
|
7c904ff331 | ||
|
|
c7855a9dd1 |
No files matched your search
@@ -3,7 +3,6 @@ import hashlib, pefile, socket, msvcrt
|
||||
import requests, pyperclip, win32file
|
||||
import win32gui, win32api, win32con
|
||||
import xml.etree.ElementTree as xmlet
|
||||
from PYAS_Rules import pyasrule_dict
|
||||
from PYAS_Function import function_list
|
||||
from PYAS_Extension import slist, alist
|
||||
from PYAS_Language import translate_dict
|
||||
@@ -19,7 +18,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.setAttribute(Qt.WA_TranslucentBackground)
|
||||
self.setWindowFlags(Qt.FramelessWindowHint)
|
||||
self.pyas = str(sys.argv[0]).replace("\\", "/")
|
||||
self.pyas_version = "2.9.2"
|
||||
self.pyas_version = "2.9.4"
|
||||
self.ui = Ui_MainWindow()
|
||||
self.ui.setupUi(self)
|
||||
self.init_tray_icon()
|
||||
@@ -532,8 +531,9 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.timer.start(2)
|
||||
|
||||
def showMinimized(self):
|
||||
self.hide_pyas_ui()
|
||||
self.send_notify(self.trans("PYAS 已最小化到系統托盤圖標"))
|
||||
if self.block_window:
|
||||
self.hide_pyas_ui()
|
||||
self.send_notify(self.trans("PYAS 已最小化到系統托盤圖標"))
|
||||
|
||||
def closeEvent(self, event):
|
||||
if QMessageBox.warning(self,self.trans("警告"),self.trans("您確定要退出 PYAS 和所有防護嗎?"),QMessageBox.Yes|QMessageBox.No) == 16384:
|
||||
@@ -835,14 +835,13 @@ class MainWindow_Controller(QMainWindow):
|
||||
fn.append(str(func.name, "utf-8"))
|
||||
except:
|
||||
pass
|
||||
max_vfl = []
|
||||
for vfl in function_list:
|
||||
QApplication.processEvents()
|
||||
max_vfl.append(len(set(fn)&set(vfl))/len(set(fn)|set(vfl)))
|
||||
if self.high_sensitivity and max(max_vfl) == 1.0:
|
||||
return True
|
||||
elif "_CorExeMain" not in fn and max(max_vfl) == 1.0:
|
||||
return True
|
||||
similarity = len(set(fn)&set(vfl))/len(set(fn)|set(vfl))
|
||||
if self.high_sensitivity and similarity >= 0.9:
|
||||
return True
|
||||
elif "_CorExeMain" not in fn and similarity == 1.0:
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
return False
|
||||
@@ -948,6 +947,8 @@ class MainWindow_Controller(QMainWindow):
|
||||
for i in Permission:
|
||||
try:
|
||||
win32api.RegDeleteValue(key,i)
|
||||
self.proc.kill()
|
||||
self.send_notify(self.trans("惡意行為攔截: ")+self.proc.name().replace("\\", "/"))
|
||||
except:
|
||||
pass
|
||||
win32api.RegCloseKey(key)
|
||||
@@ -1175,47 +1176,47 @@ class MainWindow_Controller(QMainWindow):
|
||||
time.sleep(0.05)
|
||||
for p in psutil.process_iter():
|
||||
try:
|
||||
if p.pid not in existing_processes:
|
||||
name, file, cmd = p.name(), p.exe().replace("\\", "/"), p.cmdline()
|
||||
if p.pid not in existing_processes and file not in self.whitelist:
|
||||
existing_processes.add(p.pid)
|
||||
psutil.Process(p.pid).suspend()
|
||||
name, file, cmd = p.name(), p.exe().replace("\\", "/"), p.cmdline()
|
||||
if self.protect_proc_scan(name, file, cmd):
|
||||
if ":/Windows" in file and "powershell" in name:
|
||||
file = str(cmd[-1].split("'")[-2]).replace("\\", "/")
|
||||
elif ":/Windows" in file and "cmd.exe" in name:
|
||||
file = str(" ".join(cmd[2:])).replace("\\", "/")
|
||||
elif ":/Windows" in file and "msiexec.exe" in name:
|
||||
file = str(cmd[-1]).replace("\\", "/")
|
||||
elif ":/Windows" in file and "cscript.exe" in name:
|
||||
file = str(cmd[-1]).replace("\\", "/")
|
||||
elif ":/Windows" in file and "wscript.exe" in name:
|
||||
file = str(cmd[-1]).replace("\\", "/")
|
||||
if ":/Windows" in file or ":/Program" in file:
|
||||
if self.sign_scan(file) and self.api_scan(file):
|
||||
p.kill()
|
||||
self.send_notify(self.trans("惡意軟體攔截: ")+file)
|
||||
elif self.api_scan(file) or self.pe_scan(file):
|
||||
p.kill()
|
||||
self.send_notify(self.trans("惡意軟體攔截: ")+file)
|
||||
elif ":/Windows" not in file and self.sign_scan(file):
|
||||
elif file != self.pyas and self.sign_scan(file):
|
||||
self.proc = p
|
||||
psutil.Process(p.pid).resume()
|
||||
gc.collect()
|
||||
except:
|
||||
pass
|
||||
|
||||
def protect_proc_scan(self, name, file, cmd):
|
||||
try:
|
||||
if file != self.pyas and file not in self.whitelist:
|
||||
if "powershell" in name:
|
||||
file = str(cmd[-1].split("'")[-2])
|
||||
elif "cmd.exe" in name:
|
||||
file = str(" ".join(cmd[2:]))
|
||||
elif ":/Windows" in file:
|
||||
file = str(cmd[-1])
|
||||
elif ":/Program" in file:
|
||||
file = str(cmd[-1])
|
||||
return self.api_scan(file) or self.pe_scan(file)
|
||||
return False
|
||||
except:
|
||||
pass
|
||||
|
||||
def protect_file_thread(self):
|
||||
hDir = win32file.CreateFile("C:/Users/",win32con.GENERIC_READ,win32con.FILE_SHARE_READ|win32con.FILE_SHARE_WRITE|win32con.FILE_SHARE_DELETE,None,win32con.OPEN_EXISTING,win32con.FILE_FLAG_BACKUP_SEMANTICS,None)
|
||||
self.ransom_block = False
|
||||
while self.file_protect:
|
||||
for action, file in win32file.ReadDirectoryChangesW(hDir,1024,True,win32con.FILE_NOTIFY_CHANGE_FILE_NAME|win32con.FILE_NOTIFY_CHANGE_DIR_NAME|win32con.FILE_NOTIFY_CHANGE_ATTRIBUTES|win32con.FILE_NOTIFY_CHANGE_SIZE|win32con.FILE_NOTIFY_CHANGE_LAST_WRITE|win32con.FILE_NOTIFY_CHANGE_SECURITY,None,None):
|
||||
for action, file in win32file.ReadDirectoryChangesW(hDir,1048576,True,win32con.FILE_NOTIFY_CHANGE_FILE_NAME|win32con.FILE_NOTIFY_CHANGE_DIR_NAME|win32con.FILE_NOTIFY_CHANGE_ATTRIBUTES|win32con.FILE_NOTIFY_CHANGE_SIZE|win32con.FILE_NOTIFY_CHANGE_LAST_WRITE|win32con.FILE_NOTIFY_CHANGE_SECURITY,None,None):
|
||||
try:
|
||||
if action == 2 and str(f".{file.split('.')[-1]}").lower() in alist:
|
||||
if self.ransom_block and "AppData" not in file:
|
||||
full_path = str(f"C:/Users/{file}").replace("\\", "/")
|
||||
file_type = str(f".{full_path.split('.')[-1]}").lower()
|
||||
if action == 2 and "/AppData/" not in full_path and file_type in alist:
|
||||
if self.ransom_block:
|
||||
self.proc.kill()
|
||||
self.ransom_block = False
|
||||
self.send_notify(self.trans("勒索軟體攔截: ")+self.proc.name())
|
||||
self.send_notify(self.trans("勒索軟體攔截: ")+self.proc.exe().replace("\\", "/"))
|
||||
self.ransom_block = True
|
||||
except:
|
||||
pass
|
||||
@@ -1227,12 +1228,12 @@ class MainWindow_Controller(QMainWindow):
|
||||
with open(r"\\.\PhysicalDrive0", "r+b") as f:
|
||||
if self.mbr_value[510:512] != b'\x55\xAA':
|
||||
self.proc.kill()
|
||||
self.send_notify(self.trans("惡意行為攔截: ")+self.proc.name())
|
||||
self.send_notify(self.trans("惡意行為攔截: ")+self.proc.exe().replace("\\", "/"))
|
||||
elif f.read(512) != self.mbr_value:
|
||||
f.seek(0)
|
||||
f.write(self.mbr_value)
|
||||
self.proc.kill()
|
||||
self.send_notify(self.trans("惡意行為攔截: ")+self.proc.name())
|
||||
self.send_notify(self.trans("惡意行為攔截: ")+self.proc.exe().replace("\\", "/"))
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -1254,7 +1255,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
for conn in self.proc.connections():
|
||||
if socket.gethostbyname(socket.gethostname()) == conn.laddr.ip:
|
||||
self.proc.kill()
|
||||
self.send_notify(self.trans("網路通訊攔截: ")+self.proc.name())
|
||||
self.send_notify(self.trans("網路通訊攔截: ")+self.proc.exe().replace("\\", "/"))
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+1
-1
@@ -1,7 +1,7 @@
|
||||
import pyinstaller_versionfile
|
||||
pyinstaller_versionfile.create_versionfile(
|
||||
output_file="versionfile.txt",
|
||||
version='2.9.2',
|
||||
version='2.9.4',
|
||||
company_name="PYAS Security",
|
||||
file_description="Python Antivirus Software",
|
||||
internal_name="PYAS",
|
||||
|
||||
@@ -14,9 +14,9 @@ Windows 8.1, 10, 11 (64-bit), Ram 1GB, Rom 1GB or higher
|
||||
psutil==5.9.5, pefile==2023.2.7, requests==2.31.0, pyperclip==1.8.2, pywin32==306, PyQt5==5.15.9
|
||||
|
||||
## Import Module
|
||||
os, gc, sys, time, json, psutil, hashlib, pefile, socket, msvcrt, requests, pyperclip, win32file, win32gui, win32api, win32con, xml, PYAS_Scripts, PYAS_Function, PYAS_Extension, PYAS_Language, PYAS_Interface, threading, PyQt5
|
||||
os, gc, sys, time, json, psutil, hashlib, pefile, socket, msvcrt, requests, pyperclip, win32file, win32gui, win32api, win32con, xml, PYAS_Function, PYAS_Function_Safe, PYAS_Extension, PYAS_Language, PYAS_Interface, threading, PyQt5
|
||||
|
||||
## Special Thanks
|
||||
360, Wix, VirusShare, mtkiao129, LenStevens
|
||||
360, Wix, VirusShare, mtkiao129, LenStevens, AV-T Team of LisectGroup
|
||||
|
||||
Copyright© 2020~2023 PYAS Security By 87owo
|
||||
Reference in new issue
Block a user