Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9552742a39 | ||
|
|
8e9bdf6c0c | ||
|
|
818cc48502 | ||
|
|
adc4e28eb8 | ||
|
|
2e3a4d3bf1 | ||
|
|
d9bcac78e7 | ||
|
|
2342947849 | ||
|
|
19204dee8d | ||
|
|
863fa90b80 | ||
|
|
6fdef4a8f1 | ||
|
|
9469ceaa02 | ||
|
|
857f184409 | ||
|
|
a2f4a725f5 | ||
|
|
d12449bbb9 | ||
|
|
a41f4711dd | ||
|
|
3c2b018d49 | ||
|
|
e221a09709 | ||
|
|
26ff4bd843 | ||
|
|
d8e28f384a | ||
|
|
65e68c3cc4 | ||
|
|
7b76ab2a59 | ||
|
|
ae2a01b463 | ||
|
|
cda022a9f4 | ||
|
|
672e48c5f8 | ||
|
|
6fbdb1354f | ||
|
|
79bc7fd443 | ||
|
|
5578dd3339 | ||
|
|
0232dbd196 | ||
|
|
d44e192eaa | ||
|
|
4f12b19cf8 | ||
|
|
392ac1b1c7 | ||
|
|
8ad175aca3 | ||
|
|
6afa58c42b | ||
|
|
8be03cf232 | ||
|
|
23ea53d3ff | ||
|
|
294f40e7ac | ||
|
|
4f5f706ee5 | ||
|
|
27c1a7b4e4 | ||
|
|
cfaa5be6d7 | ||
|
|
a6942280a0 | ||
|
|
159124e6a3 | ||
|
|
6e63293a3c | ||
|
|
9a9dc0d788 | ||
|
|
e201cd074c | ||
|
|
0fd49a6e1c | ||
|
|
6169a85464 | ||
|
|
e583344fee | ||
|
|
dcee00394c | ||
|
|
e48dc99dc0 | ||
|
|
3ba3dda384 | ||
|
|
bbf1ce993c | ||
|
|
56245a8c9b | ||
|
|
4f2e65094c | ||
|
|
0bf456cbc8 | ||
|
|
9213d0da16 | ||
|
|
13f2ece0ff | ||
|
|
45c2a74c94 | ||
|
|
b1b3e90e9b | ||
|
|
90ef841dae | ||
|
|
b46000e8eb | ||
|
|
b24891355d | ||
|
|
14bde5a790 | ||
|
|
d6445f17e3 | ||
|
|
6124c3fe40 | ||
|
|
5531a4b194 | ||
|
|
839a0bbd42 | ||
|
|
1ba6272e4e | ||
|
|
fdd86815ef | ||
|
|
c8091fdc84 | ||
|
|
9d569bd9e3 | ||
|
|
1991664cd1 | ||
|
|
ee7064fafc | ||
|
|
cdaf861485 | ||
|
|
3e962b1da9 | ||
|
|
8398f1706c | ||
|
|
24d2d441b4 | ||
|
|
5700039d42 | ||
|
|
22445c79d4 | ||
|
|
2be05ac76c | ||
|
|
84e397aeed | ||
|
|
bb513b9115 | ||
|
|
01b680e278 | ||
|
|
ef7c1cba2e | ||
|
|
40bbc57c82 | ||
|
|
457e5bebbb | ||
|
|
99abc56177 | ||
|
|
9eeb0b6376 | ||
|
|
0b2da187ee | ||
|
|
06f5410a4d | ||
|
|
2551ada3b7 | ||
|
|
56df08879e | ||
|
|
d41685c86e | ||
|
|
14b942970e | ||
|
|
b6103c845d | ||
|
|
7927f12e84 | ||
|
|
7774ff77b2 | ||
|
|
aaa2ed7eef | ||
|
|
b83674e9b7 | ||
|
|
017356780c | ||
|
|
45916004d2 | ||
|
|
388c8b615e | ||
|
|
4219473632 | ||
|
|
f2283cdb7f | ||
|
|
72ce9cfd6b | ||
|
|
b26375d25a | ||
|
|
a2a823f358 | ||
|
|
62164cf628 | ||
|
|
0b5fc22181 | ||
|
|
0df905f777 | ||
|
|
a539a948f6 | ||
|
|
6bd8364b5f | ||
|
|
70b70bc3e7 | ||
|
|
ac50f8917e | ||
|
|
f935b2c0b6 | ||
|
|
245c9d1119 | ||
|
|
9476313725 | ||
|
|
2d27a74278 | ||
|
|
823a5115eb | ||
|
|
33ab1e1f5e | ||
|
|
8db984d1fd | ||
|
|
a00415657a | ||
|
|
527837cc56 | ||
|
|
ac9ddff8b1 | ||
|
|
4ebae2a167 | ||
|
|
11f1685f42 | ||
|
|
8199101891 | ||
|
|
4f3ce323ae | ||
|
|
76befc7c70 | ||
|
|
8b0ad06676 | ||
|
|
d7f091a3a9 | ||
|
|
679b00229c | ||
|
|
0cfc636fb6 | ||
|
|
bd3c31e150 | ||
|
|
8e9547b75a | ||
|
|
d38ecc0f96 | ||
|
|
85834497e0 | ||
|
|
0d8997db02 | ||
|
|
cb53450ca5 | ||
|
|
f38ae36eb6 | ||
|
|
8218b0c8a6 | ||
|
|
ea036d2d53 | ||
|
|
b163eb2cdb | ||
|
|
ba3568f312 | ||
|
|
80c9976832 | ||
|
|
b6326c25b9 | ||
|
|
35f591cf49 | ||
|
|
67e437bbd7 | ||
|
|
194dae8ce1 | ||
|
|
a89442ceb0 | ||
|
|
24debf6062 | ||
|
|
ff98846c99 | ||
|
|
e3f5a0bca1 | ||
|
|
7278e4f051 | ||
|
|
709a511c1d | ||
|
|
452027f085 | ||
|
|
8574802428 | ||
|
|
79fb044921 | ||
|
|
13ac634fea | ||
|
|
04a68bc262 | ||
|
|
47de15ab68 | ||
|
|
512af24a05 | ||
|
|
e5ff46d3bb | ||
|
|
c7a0979140 | ||
|
|
7fd7245df2 | ||
|
|
026301b011 | ||
|
|
5cc77f90ae | ||
|
|
0d4568ac8a | ||
|
|
a6ed491a39 | ||
|
|
90dfc3f1ae | ||
|
|
36388fb0d7 | ||
|
|
043166d0c8 | ||
|
|
b92d488851 | ||
|
|
d841a04a89 | ||
|
|
d8553baa78 | ||
|
|
8521d5aee3 | ||
|
|
ebe21d9c7f | ||
|
|
3b83abdbd3 | ||
|
|
aead2463c9 | ||
|
|
5cc5676672 | ||
|
|
ecc32ca18d | ||
|
|
661640de79 | ||
|
|
96dfdab7ed | ||
|
|
56bed5fd3b | ||
|
|
3fd3b18406 | ||
|
|
45bac97a16 | ||
|
|
2c6eca4a92 | ||
|
|
8109d59655 | ||
|
|
8a15571cd2 | ||
|
|
a15c8f2e60 | ||
|
|
cec3d6c04d |
No files matched your search
@@ -0,0 +1,34 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
:: Check for permissions
|
||||
>nul 2>&1 "%SYSTEMROOT%\system32\icacls.exe" "%SYSTEMROOT%\system32\config\system"
|
||||
|
||||
if %errorlevel% NEQ 0 goto NoAdmin
|
||||
goto gotAdmin
|
||||
|
||||
:NoAdmin
|
||||
echo You do not have administrator rights, please run this script as administrator.
|
||||
pause
|
||||
exit /B
|
||||
|
||||
:gotAdmin
|
||||
if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs"
|
||||
|
||||
set "script_dir=%~dp0"
|
||||
set "script_dir=%script_dir:~0,-1%"
|
||||
|
||||
bcdedit -debug on
|
||||
bcdedit /set testsigning on
|
||||
bcdedit /deletevalue {current} safeboot
|
||||
|
||||
powershell.exe -ExecutionPolicy Bypass -Command ^
|
||||
"$endDate = (Get-Date).AddYears(100); ^
|
||||
$cert = New-SelfSignedCertificate -DnsName PYAS -CertStoreLocation cert:\LocalMachine\My -Type CodeSigning -NotAfter $endDate; ^
|
||||
$pwd = ConvertTo-SecureString -String 'PYAS' -Force -AsPlainText; ^
|
||||
Export-PfxCertificate -Cert $cert -FilePath '%script_dir%\PYAS.pfx' -Password $pwd;"
|
||||
"%script_dir%\signtool.exe" sign /f "%script_dir%\PYAS.pfx" /p PYAS "%script_dir%\PYAS_Driver.sys"
|
||||
sc create PYAS_Driver type= kernel start= demand binPath= "%script_dir%\PYAS_Driver.sys"
|
||||
|
||||
shutdown -r -t 0
|
||||
endlocal
|
||||
Whitespace-only changes.
Binary file not shown.
@@ -0,0 +1,25 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
:: Check for permissions
|
||||
>nul 2>&1 "%SYSTEMROOT%\system32\icacls.exe" "%SYSTEMROOT%\system32\config\system"
|
||||
|
||||
if %errorlevel% NEQ 0 goto NoAdmin
|
||||
goto gotAdmin
|
||||
|
||||
:NoAdmin
|
||||
echo You do not have administrator rights, please run this script as administrator.
|
||||
pause
|
||||
exit /B
|
||||
|
||||
:gotAdmin
|
||||
if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs"
|
||||
|
||||
sc stop PYAS_Driver
|
||||
sc delete PYAS_Driver
|
||||
|
||||
bcdedit /set testsigning off
|
||||
bcdedit -debug off
|
||||
|
||||
shutdown -r -t 0
|
||||
endlocal
|
||||
Binary file not shown.
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"Labels": ["White/Pefile", "White/Script", "Virus/Pefile", "Virus/Script"],
|
||||
|
||||
"Detect": ["Virus/Pefile", "Virus/Script"],
|
||||
|
||||
"Pixels": [224, 224],
|
||||
|
||||
"Values": 95
|
||||
}
|
||||
Binary file not shown.
+105
-75
@@ -1,84 +1,114 @@
|
||||
import time, json, hashlib, numpy
|
||||
from collections import Counter
|
||||
import os, io, sys, time, json, yara
|
||||
import numpy, pefile, onnxruntime
|
||||
from PIL import Image, ImageShow
|
||||
|
||||
class ListSimHash:
|
||||
class YRScan:
|
||||
def __init__(self):
|
||||
self.model = {}
|
||||
self.rules = {}
|
||||
self.network = []
|
||||
|
||||
def save_model(self, file_name):
|
||||
with open(file_name, 'w') as f:
|
||||
json.dump(self.model, f)
|
||||
print(f"\nModel Is Saved In {file_name}")
|
||||
def load_rules(self, file_path):
|
||||
try:
|
||||
ftype = str(f".{file_path.split('.')[-1]}").lower()
|
||||
if ftype in [".yara", ".yar"]:
|
||||
self.rules[file_path] = yara.compile(file_path)
|
||||
elif ftype in [".yc", ".yrc"]:
|
||||
self.rules[file_path] = yara.load(file_path)
|
||||
elif ftype in [".ip", ".ips"]:
|
||||
with open(file_path, "r") as f:
|
||||
self.network += [l.strip() for l in f.readlines()]
|
||||
except:
|
||||
pass
|
||||
|
||||
def load_model(self, model_data):
|
||||
if isinstance(model_data, str):
|
||||
with open(model_data, 'r') as f:
|
||||
model_data = json.load(f)
|
||||
self.model = model_data
|
||||
def yr_scan(self, file_path):
|
||||
try:
|
||||
if isinstance(file_path, str):
|
||||
with open(file_path, "rb") as f:
|
||||
file_path = f.read()
|
||||
for name, rules in self.rules.items():
|
||||
matchs_rules = rules.match(data=file_path)
|
||||
if matchs_rules:
|
||||
return "Virus/Rules", matchs_rules
|
||||
return False, False
|
||||
except:
|
||||
return False, False
|
||||
|
||||
def get_model(self, label):
|
||||
return self.model[label]
|
||||
class DLScan:
|
||||
def __init__(self):
|
||||
self.models = {}
|
||||
self.detect = []
|
||||
self.values = 100
|
||||
self.shells = ['!o', '/4', '0a@', '?g_encry', '_test', 'ace', 'yg', 'obr', 'b1_',
|
||||
'base', 'bss', 'clr_uef', 'cursors', 'trs_age', 'engine', 'enigma', 'extjmp',
|
||||
'fio', 'fothk', 'hexpthk', 'h~;', 'icapsec', 'il2cpp', 'imageres', 'lzmadec',
|
||||
'malloc_h', 'miniex', 'mpress', 'mssmixer', 'ndr64', 'nep', 'no_bbt', 'wpp_sf',
|
||||
'nsys_wr', 'orpc', 'packer', 'pad', 'tvm', 'pgae', 'poolmi', 'proxy', 'segm',
|
||||
'retpol', 'rt', 'rwexec', 'u7m', 'rygs', 's:@', 'sanontcp', 'secur', 'asmstub',
|
||||
'tracesup', 'transit', 'upx', 'uedbg', 'viahw', 'vmp', 'wow64svc', 'be', 'zk']
|
||||
|
||||
def train_model(self, label, data):
|
||||
start = time.time()
|
||||
print(f"Convert {label}")
|
||||
if label not in self.model:
|
||||
self.model[label] = []
|
||||
for i, x in enumerate(data, 1):
|
||||
self.model[label].append(self.build_text(x))
|
||||
used = "{0:.2f}".format(time.time()-start)
|
||||
prefix, suffix = f'{i}/{len(data)}:', f'{used}s'
|
||||
self.progress_bar(i, len(data), prefix, suffix)
|
||||
def load_model(self, file_path):
|
||||
try:
|
||||
ftype = str(f".{file_path.split('.')[-1]}").lower()
|
||||
if ftype in [".json", ".txt"]:
|
||||
with open(file_path, 'r') as f:
|
||||
self.class_names = json.load(f)
|
||||
elif ftype in [".onnx"]:
|
||||
self.models[file_path] = onnxruntime.InferenceSession(file_path)
|
||||
self.values = self.class_names['Values']
|
||||
self.detect = self.class_names['Detect']
|
||||
except:
|
||||
pass
|
||||
|
||||
def build_text(self, content):
|
||||
sums, batch, count = [], [], 0
|
||||
features = dict(Counter(sorted(content)))
|
||||
for f, w in features.items():
|
||||
count += w
|
||||
batch.append(hashlib.md5(json.dumps(f).encode('utf-8')).digest() * w)
|
||||
if len(batch) >= 10000:
|
||||
sums.append(self.sum_hashes(batch))
|
||||
batch = []
|
||||
if batch:
|
||||
sums.append(self.sum_hashes(batch))
|
||||
combined_sums = numpy.sum(sums, 0)
|
||||
v = numpy.packbits(combined_sums > count / 2).tobytes()
|
||||
return int.from_bytes(v, 'big')
|
||||
def predict(self, file_data):
|
||||
try:
|
||||
target_size, sim = tuple(self.class_names['Pixels']), {}
|
||||
image = self.preprocess_image(file_data, target_size)
|
||||
image_array = numpy.array(image).astype('float32') / 255.0
|
||||
image_expand = numpy.expand_dims(image_array, axis=0)
|
||||
for model_name, model in self.models.items():
|
||||
input_name = model.get_inputs()[0].name
|
||||
pre_answer = model.run(None, {input_name: image_expand})[0][0]
|
||||
number = numpy.argmax(pre_answer)
|
||||
label = self.class_names['Labels'][number].replace("\n", "")
|
||||
sim[label] = sim.setdefault(label, 0) + pre_answer[number]
|
||||
for local_label, sim_sum in sim.items():
|
||||
if sim_sum > len(self.models) / 2:
|
||||
local_level = sim_sum / len(self.models)
|
||||
return local_label, local_level * 100
|
||||
return False, False
|
||||
except:
|
||||
return False, False
|
||||
|
||||
def sum_hashes(self, digests):
|
||||
bitarray = numpy.unpackbits(numpy.frombuffer(b''.join(digests), dtype='>B'))
|
||||
return numpy.sum(numpy.reshape(bitarray, (-1, 128)), 0)
|
||||
def dl_scan(self, file_path):
|
||||
try:
|
||||
if isinstance(file_path, bytes):
|
||||
label, level = self.predict(file_path)
|
||||
if label and label in self.detect:
|
||||
return label, level
|
||||
ftype = str(f".{file_path.split('.')[-1]}").lower()
|
||||
if ftype in [".exe", ".dll", ".sys", ".scr", ".com"]:
|
||||
with pefile.PE(file_path, fast_load=True) as pe:
|
||||
match_data = [section.get_data() for section in pe.sections
|
||||
if section.Characteristics & 0x20000000 and not
|
||||
any(shell in section.Name.decode().strip('\x00').lower()
|
||||
for shell in self.shells)]
|
||||
elif ftype in [".bat", ".vbs", ".ps1", ".cmd", ".js"]:
|
||||
with open(file_path, 'rb') as file:
|
||||
match_data = [file.read()]
|
||||
for file_data in match_data:
|
||||
label, level = self.predict(file_data)
|
||||
if label and label in self.detect:
|
||||
return label, level
|
||||
return False, False
|
||||
except:
|
||||
return False, False
|
||||
|
||||
def progress_bar(self, iteration, total, prefix='', suffix='', length=50, fill='█'):
|
||||
percent = min(100.0, max(0.0, 100 * (iteration / float(total))))
|
||||
end_char = '\n' if percent >= 100 else '\r'
|
||||
percent_string = "{0:.2f}".format(percent)
|
||||
filled_length = int(length * iteration // total)
|
||||
bar = fill * filled_length + ' ' * (length - filled_length)
|
||||
print(f'\r {prefix: <10} |{bar}| {percent_string}% {suffix}', end=end_char)
|
||||
|
||||
def predict_all(self, query):
|
||||
label_similarities = {}
|
||||
query_hash = self.build_text(query)
|
||||
for label in self.model:
|
||||
max_similarity = 0
|
||||
for data_point in self.model[label]:
|
||||
similarity = self.similar(data_point, query_hash)
|
||||
if similarity > max_similarity:
|
||||
max_similarity = similarity
|
||||
label_similarities[label] = max_similarity
|
||||
return label_similarities
|
||||
|
||||
def predict(self, query):
|
||||
max_similarity, max_label = 0, None
|
||||
query_hash = self.build_text(query)
|
||||
for label in self.model:
|
||||
for data_point in self.model[label]:
|
||||
similarity = self.similar(data_point, query_hash)
|
||||
if similarity > max_similarity:
|
||||
max_similarity, max_label = similarity, label
|
||||
return max_label, max_similarity
|
||||
|
||||
def similar(self, x, y):
|
||||
hamming_distance = bin(x ^ y).count('1')
|
||||
return 1 - hamming_distance / 128
|
||||
def preprocess_image(self, file_data, target_size):
|
||||
file_data = numpy.frombuffer(file_data, dtype=numpy.uint8)
|
||||
data_count = len(file_data)
|
||||
wah = int(numpy.ceil(numpy.sqrt((data_count + 2) // 3)))
|
||||
image_array = numpy.zeros((wah * wah * 3,), dtype=numpy.uint8)
|
||||
image_array[:data_count] = file_data
|
||||
image_array = image_array.reshape((wah, wah, 3))
|
||||
image = Image.fromarray(image_array)
|
||||
return image.resize(target_size, Image.Resampling.LANCZOS)
|
||||
@@ -1,8 +0,0 @@
|
||||
slist = [".exe",".dll",".com",".msi",".scr",
|
||||
".js",".bat",".cmd",".ps1",".vbs"]
|
||||
|
||||
alist = [".ppt",".pptx",".wps",".txt",".rtf",
|
||||
".pdf",".xls",".xlsx",".doc",".docx",
|
||||
".jpg",".jpeg",".png",".webp",".gif",
|
||||
".mp3",".wav",".aac",".ogg",".flac",
|
||||
".mp4",".avi",".mov",".wmv",".mkv"]
|
||||
+35
-35
@@ -1569,49 +1569,49 @@ class Ui_MainWindow(object):
|
||||
self.Language_illustrate.raise_()
|
||||
self.Language_Choose_widget.raise_()
|
||||
self.Language_title.raise_()
|
||||
self.Show_cloud_services = QtWidgets.QWidget(self.Setting_widget)
|
||||
self.Show_cloud_services.setGeometry(QtCore.QRect(30, 130, 781, 81))
|
||||
self.Show_cloud_services.setAcceptDrops(False)
|
||||
self.Show_cloud_services.setAutoFillBackground(False)
|
||||
self.Show_cloud_services.setObjectName("Show_cloud_services")
|
||||
self.cloud_services_title = QtWidgets.QLabel(self.Show_cloud_services)
|
||||
self.cloud_services_title.setGeometry(QtCore.QRect(20, 10, 451, 31))
|
||||
self.Show_extension_kit = QtWidgets.QWidget(self.Setting_widget)
|
||||
self.Show_extension_kit.setGeometry(QtCore.QRect(30, 130, 781, 81))
|
||||
self.Show_extension_kit.setAcceptDrops(False)
|
||||
self.Show_extension_kit.setAutoFillBackground(False)
|
||||
self.Show_extension_kit.setObjectName("Show_extension_kit")
|
||||
self.extension_kit_title = QtWidgets.QLabel(self.Show_extension_kit)
|
||||
self.extension_kit_title.setGeometry(QtCore.QRect(20, 10, 451, 31))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
font.setPointSize(17)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.cloud_services_title.setFont(font)
|
||||
self.cloud_services_title.setStyleSheet("color: rgb(70,70,70);")
|
||||
self.cloud_services_title.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
||||
self.cloud_services_title.setObjectName("cloud_services_title")
|
||||
self.cloud_services_illustrate = QtWidgets.QLabel(self.Show_cloud_services)
|
||||
self.cloud_services_illustrate.setGeometry(QtCore.QRect(20, 40, 451, 31))
|
||||
self.extension_kit_title.setFont(font)
|
||||
self.extension_kit_title.setStyleSheet("color: rgb(70,70,70);")
|
||||
self.extension_kit_title.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
||||
self.extension_kit_title.setObjectName("extension_kit_title")
|
||||
self.extension_kit_illustrate = QtWidgets.QLabel(self.Show_extension_kit)
|
||||
self.extension_kit_illustrate.setGeometry(QtCore.QRect(20, 40, 451, 31))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.cloud_services_illustrate.setFont(font)
|
||||
self.cloud_services_illustrate.setStyleSheet("color: rgb(70,70,70);")
|
||||
self.cloud_services_illustrate.setScaledContents(False)
|
||||
self.cloud_services_illustrate.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
||||
self.cloud_services_illustrate.setWordWrap(True)
|
||||
self.cloud_services_illustrate.setObjectName("cloud_services_illustrate")
|
||||
self.cloud_services_switch_Button = QtWidgets.QPushButton(self.Show_cloud_services)
|
||||
self.cloud_services_switch_Button.setGeometry(QtCore.QRect(660, 20, 91, 31))
|
||||
self.extension_kit_illustrate.setFont(font)
|
||||
self.extension_kit_illustrate.setStyleSheet("color: rgb(70,70,70);")
|
||||
self.extension_kit_illustrate.setScaledContents(False)
|
||||
self.extension_kit_illustrate.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
||||
self.extension_kit_illustrate.setWordWrap(True)
|
||||
self.extension_kit_illustrate.setObjectName("extension_kit_illustrate")
|
||||
self.extension_kit_switch_Button = QtWidgets.QPushButton(self.Show_extension_kit)
|
||||
self.extension_kit_switch_Button.setGeometry(QtCore.QRect(660, 20, 91, 31))
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.cloud_services_switch_Button.sizePolicy().hasHeightForWidth())
|
||||
self.cloud_services_switch_Button.setSizePolicy(sizePolicy)
|
||||
sizePolicy.setHeightForWidth(self.extension_kit_switch_Button.sizePolicy().hasHeightForWidth())
|
||||
self.extension_kit_switch_Button.setSizePolicy(sizePolicy)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.cloud_services_switch_Button.setFont(font)
|
||||
self.cloud_services_switch_Button.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||
self.cloud_services_switch_Button.setStyleSheet("QPushButton\n"
|
||||
self.extension_kit_switch_Button.setFont(font)
|
||||
self.extension_kit_switch_Button.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||
self.extension_kit_switch_Button.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
@@ -1622,12 +1622,12 @@ class Ui_MainWindow(object):
|
||||
" background-color:rgb(220,220,220);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.cloud_services_switch_Button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.cloud_services_switch_Button.setCheckable(False)
|
||||
self.cloud_services_switch_Button.setObjectName("cloud_services_switch_Button")
|
||||
self.cloud_services_illustrate.raise_()
|
||||
self.cloud_services_switch_Button.raise_()
|
||||
self.cloud_services_title.raise_()
|
||||
self.extension_kit_switch_Button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.extension_kit_switch_Button.setCheckable(False)
|
||||
self.extension_kit_switch_Button.setObjectName("extension_kit_switch_Button")
|
||||
self.extension_kit_illustrate.raise_()
|
||||
self.extension_kit_switch_Button.raise_()
|
||||
self.extension_kit_title.raise_()
|
||||
self.Setting_Back = QtWidgets.QPushButton(self.Setting_widget)
|
||||
self.Setting_Back.setGeometry(QtCore.QRect(25, 10, 101, 41))
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
|
||||
@@ -1885,9 +1885,9 @@ class Ui_MainWindow(object):
|
||||
self.Language_English.setText(_translate("MainWindow", "English"))
|
||||
self.Language_Traditional_Chinese.setText(_translate("MainWindow", "繁體中文"))
|
||||
self.Language_Simplified_Chinese.setText(_translate("MainWindow", "简体中文"))
|
||||
self.cloud_services_title.setText(_translate("MainWindow", "雲端掃描服務"))
|
||||
self.cloud_services_illustrate.setText(_translate("MainWindow", "啟用此選項可以連接雲端掃描服務"))
|
||||
self.cloud_services_switch_Button.setText(_translate("MainWindow", "已關閉"))
|
||||
self.extension_kit_title.setText(_translate("MainWindow", "雲端掃描服務"))
|
||||
self.extension_kit_illustrate.setText(_translate("MainWindow", "啟用此選項可以連接雲端掃描服務"))
|
||||
self.extension_kit_switch_Button.setText(_translate("MainWindow", "已關閉"))
|
||||
self.Setting_Back.setText(_translate("MainWindow", "返回"))
|
||||
self.Add_White_list_title.setText(_translate("MainWindow", "增加到白名單"))
|
||||
self.Add_White_list_illustrate.setText(_translate("MainWindow", "此選項可以選擇檔案並增加到白名單"))
|
||||
|
||||
+22
-16
@@ -4,7 +4,7 @@ translate_dict = {
|
||||
"軟體":"软件","檔案":"文件","確定":"确认","設定":"设置","關於":"关于",
|
||||
"錯誤":"错误","實時":"实时","發現":"发现","關閉":"关闭","裝置":"设备",
|
||||
"總數":"总数","註冊":"注册","圖標":"图标","路徑":"路径","網路":"网络",
|
||||
"位元":"字节","彈窗":"弹窗","靈敏":"敏感","誤報":"误报","複製":"复制",
|
||||
"位元":"字节","彈窗":"弹窗","靈敏":"敏感","複製":"复制","開啟":"开启",
|
||||
"訊":"讯","項":"项","掃":"扫","試":"试","黃":"黄","嗎":"吗","防":"保",
|
||||
"鑰":"钥","當":"当","後":"后","護":"护","導":"导","區":"区","復":"复",
|
||||
"攔":"拦","請":"请","統":"统","刪":"删","進":"进","個":"个","選":"选",
|
||||
@@ -14,25 +14,27 @@ translate_dict = {
|
||||
"稱":"称","類":"类","輸":"输","執":"执","數":"数","尋":"寻","網":"网",
|
||||
"詢":"询","製":"制","員":"员","許":"许","條":"条","藍":"蓝","紅":"红",
|
||||
"綠":"绿","態":"态","務":"务","連":"连","檢":"检","測":"测","關":"关",
|
||||
"強":"强","驅":"驱","為":"为","腳":"脚","增":"增","單":"单","開":"开",
|
||||
"惡":"恶","據":"据","庫":"库","經":"经","敗":"败"},
|
||||
"強":"强","驅":"驱","為":"为","腳":"脚","單":"单","開":"开","擴":"扩",
|
||||
"惡":"恶","據":"据","庫":"库","經":"经","敗":"败","謝":"谢","別":"别",
|
||||
"載":"载","誤":"误","報":"报","鏈":"链","竄":"窜","蹤":"踪","記憶體":"内存",},
|
||||
"en_US": {"已開啟":"On","已關閉":"Off","已开启":"On","已关闭":"Off",",":", ",
|
||||
"立即刪除":"Delete Now","安全模式":"Safe Mode","官方網站":"Website",
|
||||
"惡意檔案":"Virus ","惡意軟體":"Malware ","勒索行為":"Ransom ",
|
||||
"惡意腳本":"Script ","惡意行為":"Behavior ","可疑軟體":"Suspicious ",
|
||||
"許可條款":"License Terms","惡意":"Malicious","可疑":"Suspicious",
|
||||
"立即刪除":"Delete Now","安全模式":"Safe Mode","官方網站":"Website ",
|
||||
"腳本":"Script ","鏈式":"Chain ","記憶體":"Memory ","加載":"Load ",
|
||||
"行為":"Behavior ","可疑":"Suspicious ","勒索":"Ransom ",
|
||||
"許可條款":"License Terms ","惡意":"Malicious","可疑":"Suspicious",
|
||||
"啟用":"Enable ","禁用":"Disable ","正在初始化中":"Initializing ",
|
||||
"正在掃描":"Scanning ","正在刪除":"Deleting ","最小化到":"Minimize To ",
|
||||
"確定要":"Sure Want To ","靈敏度":"Sensitivity ","更新":"Update ",
|
||||
"正在掃描":"Scanning ","正在刪除":"Deleting ","正在追蹤":"Tracking ",
|
||||
"最小化到":"Minimize To ","靈敏度":"Sensitivity ","正在檢查":"Checking ",
|
||||
"確定要":"Sure Want To ","引擎靈敏度":"Sensitivity ","更新":"Update ",
|
||||
"白色主題":"White","黃色主題":"Yellow","紅色主題":"Red","語言":"Language ",
|
||||
"藍色主題":"Blue","綠色主題":"Green","自定主題":"Custom","最新":"Latest ",
|
||||
"測試人員":"Testers","版本資訊":"Information","通訊":"Communication ",
|
||||
"特別感謝":"Contributors ","版本資訊":"Information","通訊":"Connect ",
|
||||
"註冊表":"Registry ","退出":"Quit ","檔案":"File ","當前":"Currently ",
|
||||
"狀態":"State ","掃描":"Scan ","工具":"Tools ","防護":"Protect ",
|
||||
"失敗":"Failed ","請":"Please ","路徑":"Path ","方式":"Method ",
|
||||
"需要":"Need ","病毒":"Virus ","選擇":"Select ","返回":"Back",
|
||||
"受到":"Been ","錯誤":"Error","完成":"Complete ","引擎":"Engine ",
|
||||
"托盤":"Tray ","圖標":"Icon ","不安全":"Unsafe","增強":"Enhanced ",
|
||||
"托盤":"Tray ","圖標":"Icon ","不安全":"Unsafe","增強":"Enhance ",
|
||||
"系統":"System ","雲端":"Cloud ","重啟":"Reboot ","修復":"Repair ",
|
||||
"裝置":"Device ","發現":"Found ","成功":"Success ","清理":"Cleanup ",
|
||||
"確定":"OK","執行":"Execute ","警告":"Warning ","使用":"Use ",
|
||||
@@ -44,11 +46,15 @@ translate_dict = {
|
||||
"風險":"Risk ","介面":"GUI ","核心":"Core ","服務":"Services ",
|
||||
"管理":"Manage","所有":"All ","您":"You ","取消":"Cancel ","未":"Not ",
|
||||
"垃圾":"Junk ","位元":"byte ","本機":"Computer ","停止":"Stop ",
|
||||
"增加到":"Add File To ","白名單":"White List ","軟體":"Software ",
|
||||
"增加":"Add","移除":"Delete","項目":"Items ","生成":"Create ","稱":"",
|
||||
"增加到":"Add To ","白名單":"White List ","軟體":"Software ","正在":"",
|
||||
"增加":"Add ","移除":"Delete","項目":"Items ","生成":"Create ","稱":"",
|
||||
"複製":"Copy ","開啟":"Open ","此":"This ","並":"And ","全盤":"Full ",
|
||||
"已經是":"Already ","數據庫":"Database ","誤報":"False Positive ",
|
||||
"已經在":"Already ","數據庫":"Database ","誤報":"False Positive ",
|
||||
"高":"High ","新":"New ","和":"And ","可能會":"Possible ","會":"Can ",
|
||||
"日誌":"Log","已":"Has ","彈窗":"Window ","要":"To ","驅動":"Drive ",
|
||||
"日誌":"Log","已":"Has ","彈窗":"Window ","要":"To ","驅動":"Driver ",
|
||||
"的":"","顯示":"","個":"","嗎":"","中":"","了":"","行":"","立即":"",
|
||||
"密鑰":"Key ","檢測":"Detect ","製作":"Make"," ":" "}}
|
||||
"密鑰":"Key ","檢測":"Detect ","製作":"Maker ","運行":"Running",
|
||||
"擴展":"Extension ","套件":"Kit ","自動":"Auto ","上報":"Report ",
|
||||
"分析":"Analysis ","自身":"Self ","其他":"Other ","配置":"Config ",
|
||||
"丟失":"Lost ","網站":"Website ","不兼容":"Not Compatible ",
|
||||
"竄改":"Tamper ","第三方":"Other ","與":"With "," ":" "}}
|
||||
@@ -1 +0,0 @@
|
||||
{"Unknown": [10199010580531108378153827424457992432, 20965212707052912989658218281213053170, 20963924773736013955013492889397430514, 20965222847950647661922877313293420786, 20963924773736089512877253988092938483, 10533913729454048551192748670221101302, 10497567570978277785165438149536581872, 230418814927598623996991522865620895293], "White": [126672244860282820431531292152154892541, 126555244512863767515621062938772454385, 78206639303253050193082960917406129821, 180439547362931620767428561827016696106, 96103515196312870469979178835907426963, 106202738889863580199047548478556282224, 260681472954591486442301293972682570259, 334352372173892944739362819086050576826, 270698534086324527574602815275595168743, 52278935817957542072232518657580445973, 99964490807793194121661552779445205157, 114471449979609419026325537602253303510, 170288120086869810213050150585452458992, 20129952829430162432875533418501193427, 266141180604311766657329911262256522695, 194231769680954789184967343915738715269, 137555894938392968938334822886799145665, 32033385634193095265531812355001705364, 110412723075988544148987035520371252041, 95564371670156926573557604030875376880, 95235309747885939408380636606625811569, 272762168699147334321583996672002378255, 95234011064914281942190040816173653105, 94471327154819245031506476509638106704, 95313696146069105288568328992515893493, 93984468150284189415663958982282127605, 191147052097100843670989027331488156725, 103210672664238242772979731817227685237, 56724333007221946388761990730009660128, 101562244577076015330628724737265682909, 97287175069805646577858533189449166301, 137063300177336245346774014048969161649, 316391968656924997605188916362257077459, 264287352948858755174876745019957203391, 127136776672701393662717729226704358773, 9912885994425979960261799249926495473, 214498205255495472884061693173662060219, 105039659248652423950583866198328679776, 106486519388821918892958052791862913681, 81533898116464931264738244322343722087, 127128973031678141900306064284785253496, 257976287344519798598519417614968543943, 95234579695571071996043856278635879538, 307531936139217865648235621101964847809, 205524205305644077365818951604097443015, 10082933643349790779259596715866791152, 105863211359421133420308580490619723120, 105536091507504387016141979202387910000, 115256152418524974755063297364983094641, 258226055192645594643924661804242821079, 184879672381654838626194080314169453584, 105909917863928976433791749005432917096, 34668429459089199253155684394504639701, 9333342038490638804353570140444499409, 49992947087053905927423189110869930637, 114390951894751980367497997972138956045, 40525380716593540848111929430426386129, 92531564279929657078344831661770634033, 137845158706024438551516917025209916775, 82711778578996712205456007623860083392, 142895363148849470268902285117702200512, 176210598858636561054489191954962668740, 133988075388031745460051108783604183680, 127463789261350104996635356465169505635, 98401956749501984262112138828559240544, 105619903475864025251671385889627380849, 194216192765620392180514937530431948487, 178730848644410936934440792379530771324, 258767967557372966404648755263173813716, 95568909833307793735851930883495894385, 105203216600314032187918420804040465776, 10160172324731669179270431009861737585, 95562338257159239457022778648277753201, 125705675445940363792857463789011840389, 105782103246308081595321955114562886777, 34490061240648476397849656073168201108, 337793686977585440073129666111702532467, 278253338747731733314329375842609871921, 204788843742030229839080201679229506773, 106117654063199359331238217293466812006, 123266687541636144245366511635599982231, 113845713591553304589832425329269218672, 102400300404095555238772811174816483363, 115752031916027952368786798048662461543, 205193551069866139019248248605938239445, 101437234347196055762008445071888009636, 148030553843923537774182040572301348817, 95562399131158503793285318098946563443, 144743835053038288880188325484490464627, 329456512868359962875761871381429648792, 214132526311861388081693372283346711315, 212807863125887894065170197859985748755, 90639505994802779364701320439314232445, 109312881611100283088661575235655027037, 268695571549372555579983860480753996530, 276556254823007156956265006607247855228, 158532724662396204460585683955318721251, 190236918274156159301867868769173894064, 115505281197039501762156314342977388146, 181151739907962908273686170106830254275, 103040304820632656358846714092274654455, 283839353929015376840553872262568182165, 126305356110326106528653817459839286387, 232772214119775911616044955505922667440, 267224571901232164108563912343781345315, 248870611769713486967773923305072182805, 94401261442397178213607895041941511616, 126697942675733486251713755064939650169, 52680527483000227468312744969526057584, 100468409853345213529992161170862574067, 195546595259106600444307572967932415185, 121396668310321681197001161772784753777, 102772203717048361679815565428970429489, 118636962645139146202043096156604144755, 130735009156835Line truncated
|
||||
@@ -0,0 +1,12 @@
|
||||
slist = [".exe",".dll",".sys",".com",".scr",
|
||||
".bat",".ps1",".vbs",".cmd",".js"]
|
||||
|
||||
alist = [".exe",".dll",".sys",".com",".scr",
|
||||
".zip",".7z",".rar",".tar",".gz",
|
||||
".js",".bat",".cmd",".ps1",".vbs",
|
||||
".ppt",".pptx",".wps",".txt",".rtf",
|
||||
".pdf",".xls",".xlsx",".doc",".docx",
|
||||
".jpg",".jpeg",".png",".webp",".gif",
|
||||
".mp3",".wav",".aac",".ogg",".flac",
|
||||
".mp4",".avi",".mov",".wmv",".mkv",
|
||||
".aux",".cur",".mui",".ttf",".efi"]
|
||||
+1
-1
@@ -2,7 +2,7 @@ import pyinstaller_versionfile
|
||||
|
||||
pyinstaller_versionfile.create_versionfile(
|
||||
output_file="versionfile.txt",
|
||||
version='3.0.8',
|
||||
version='3.2.0',
|
||||
company_name="PYAS Security",
|
||||
file_description="Python Antivirus Software",
|
||||
internal_name="PYAS",
|
||||
|
||||
@@ -1,33 +1,15 @@
|
||||
# PYAS (Python Antivirus Software)
|
||||
|
||||

|
||||

|
||||
|
||||
## Readme Language
|
||||
|
||||
[繁體中文](https://github.com/zackzheng1121/PYAS/blob/main/README_zh.md)
|
||||
繁體中文 : https://github.com/87owo/PYAS/blob/main/README_zh_TW.md
|
||||
|
||||
## File Information
|
||||
|
||||
PYAS.py -> Main PYAS Program (including animation, scanning, protection functions, etc.)
|
||||
|
||||
PYAS_Engine.py -> Conversion Database (used to convert database dict and list to and from each other)
|
||||
|
||||
PYAS_Extension.py -> File Extension (including scanned file extensions and common file extensions)
|
||||
|
||||
PYAS_Model.* -> Virus Database (the virus database must be placed in the same directory)
|
||||
|
||||
PYAS_Interface.py -> PyQt5 Interface (designed by QT designer, must be matched with the main program)
|
||||
|
||||
PYAS_Resource.py -> PyQt5 Resource (status pictures, icon packages, button icons, etc.)
|
||||
|
||||
PYAS_Language.py -> Translate Dict (Traditional Chinese, Simplified Chinese, English)
|
||||
|
||||
PYAS_Version.py -> Pyinstaller Info (file information, version information, original name, etc.)
|
||||
简体中文 : https://github.com/87owo/PYAS/blob/main/README_zh_CN.md
|
||||
|
||||
## Requirements
|
||||
|
||||
Use pip install requirements to install import module
|
||||
|
||||
```
|
||||
psutil==5.9.5
|
||||
pefile==2023.2.7
|
||||
@@ -37,121 +19,31 @@ pywin32==306
|
||||
PyQt5==5.15.9
|
||||
```
|
||||
|
||||
## Hash Scanning
|
||||
|
||||
Use Qihoo 360 cloud service to scan known malicious files
|
||||
## File Information
|
||||
|
||||
```
|
||||
import hashlib, requests
|
||||
import xml.etree.ElementTree as xmlet
|
||||
|
||||
def hash_scan(file):
|
||||
try:
|
||||
with open(file, "rb") as f:
|
||||
text = str(hashlib.md5(f.read()).hexdigest())
|
||||
strBody = f'-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="md5s"\r\n\r\n{text}\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="format"\r\n\r\nXML\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="product"\r\n\r\n360zip\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="combo"\r\n\r\n360zip_main\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="v"\r\n\r\n2\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="osver"\r\n\r\n5.1\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="vk"\r\n\r\na03bc211\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="mid"\r\n\r\n8a40d9eff408a78fe9ec10a0e7e60f62\r\n-------------------------------7d83e2d7a141e--'
|
||||
response = requests.post('http://qup.f.360.cn/file_health_info.php', data=strBody, timeout=3)
|
||||
if response.status_code == 200:
|
||||
level = float(xmlet.fromstring(response.text).find('.//e_level').text)
|
||||
if level > 50:
|
||||
return "Virus"
|
||||
elif level <= 10:
|
||||
return "Safe"
|
||||
return "Unknown"
|
||||
return f"Error: {response.status_code}"
|
||||
except Exception as e:
|
||||
return f"Error: {e}"
|
||||
|
||||
info = hash_scan("path to file")
|
||||
print(info)
|
||||
```
|
||||
|
||||
## Pefile Scanning
|
||||
|
||||
Get the pefile file function import table for scanning
|
||||
|
||||
```
|
||||
import pefile
|
||||
|
||||
def pe_scan(file):
|
||||
try:
|
||||
fn = []
|
||||
with pefile.PE(file) as pe:
|
||||
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
||||
for func in entry.imports:
|
||||
try:
|
||||
fn.append(str(func.name, "utf-8"))
|
||||
except:
|
||||
pass
|
||||
if fn in known_malicious_list:
|
||||
return "Virus"
|
||||
return "Safe"
|
||||
return "Unknown"
|
||||
except Exception as e:
|
||||
return f"Error: {e}"
|
||||
|
||||
info = pe_scan("path to file")
|
||||
print(info)
|
||||
```
|
||||
|
||||
## Process Detect
|
||||
|
||||
Show the new process name, file path, cmd line, pid
|
||||
|
||||
```
|
||||
import psutil, time
|
||||
|
||||
def proc_detect():
|
||||
existing_processes = set()
|
||||
for p in psutil.process_iter():
|
||||
if p.pid not in existing_processes:
|
||||
existing_processes.add(p.pid)
|
||||
while True:
|
||||
time.sleep(0.1)
|
||||
for p in psutil.process_iter():
|
||||
try:
|
||||
if p.pid not in existing_processes:
|
||||
existing_processes.add(p.pid)
|
||||
name, file, cmd = p.name(), p.exe(), p.cmdline()
|
||||
print(f"Name: {name}")
|
||||
print(f"File: {file}")
|
||||
print(f"Pid: {p.pid}")
|
||||
print(f"Cmd: {cmd}")
|
||||
elif not psutil.pid_exists(p.pid):
|
||||
existing_processes.remove(p.pid)
|
||||
except:
|
||||
pass
|
||||
|
||||
proc_detect()
|
||||
```
|
||||
|
||||
## File Detect
|
||||
|
||||
Monitor file changes under the specified path
|
||||
|
||||
```
|
||||
import os, win32file, win32con
|
||||
|
||||
def file_detect(path):
|
||||
hDir = win32file.CreateFile(path,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)
|
||||
while True:
|
||||
for action, file in win32file.ReadDirectoryChangesW(hDir,10485760,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:
|
||||
fpath = os.path.join(path, file)
|
||||
if action == 1:
|
||||
print(f"File Create: {fpath}")
|
||||
elif action == 2:
|
||||
print(f"File Delete: {fpath}")
|
||||
elif action == 3:
|
||||
print(f"File Modify: {fpath}")
|
||||
elif action == 4:
|
||||
print(f"File Rename: {fpath}")
|
||||
elif action == 5:
|
||||
print(f"File Rename: {fpath}")
|
||||
except:
|
||||
pass
|
||||
|
||||
file_detect("path")
|
||||
PYAS/
|
||||
├── Driver/
|
||||
│ ├── PYAS_Driver.sys -------> Driver Protect (self protection driver for pyas by 0sha0)
|
||||
│ └── ...
|
||||
│
|
||||
├── Model/
|
||||
│ ├── PYAS_Model.json -------> Virus Database (the database must be in the specified dir)
|
||||
│ └── ...
|
||||
│
|
||||
├── Rules/
|
||||
│ ├── Yara_Rules.yar ---------> Yara Rules (yara rules in plain text format)
|
||||
│ ├── Yara_Rules.yrc ---------> Compile Rules (yara rules in compiled format)
|
||||
│ └── ...
|
||||
│
|
||||
├── PYAS.py ---------------------> Main PYAS Program (including animation, scan, protect functions, ...)
|
||||
├── PYAS_Engine.py -------------> Conversion Database (used to transform profiles and forecast data)
|
||||
├── PYAS_Suffixes.py -----------> File Suffixes (including scanned file suffixes and common suffixes)
|
||||
├── PYAS_Interface.py ----------> PyQt5 Interface (use QT designer, must be matched with the main program)
|
||||
├── PYAS_Resource.py -----------> PyQt5 Resource (status pictures, icon packages, button icons, ...)
|
||||
├── PYAS_Language.py -----------> Translate Dict (Traditional Chinese, Simplified Chinese, English)
|
||||
├── PYAS_Version.py ------------> Pyinstaller (file information, version information, original name, ...)
|
||||
└── ...
|
||||
```
|
||||
|
||||
## Official Website
|
||||
@@ -160,17 +52,26 @@ https://pyantivirus.wixsite.com/pyas
|
||||
|
||||
https://github.com/87owo/PYAS
|
||||
|
||||
## Microsoft Runtime
|
||||
|
||||
https://github.com/87owo/Microsoft_Runtime/releases
|
||||
|
||||
## PYAS Driver
|
||||
|
||||
https://github.com/0sha0/PYAS_Protection
|
||||
|
||||
## MIT license
|
||||
|
||||
https://github.com/87owo/PYAS/blob/main/LICENSE.md
|
||||
|
||||
## Support System
|
||||
|
||||
Windows 8.1, 10, 11 (64-bit), Ram 1GB, Rom 1GB or higher
|
||||
Windows 8.1, 10, 11 (64-bit), Ram 500MB, Rom 200MB or higher
|
||||
|
||||
Other systems may experience software malfunctions or crash
|
||||
|
||||
## Special Thanks
|
||||
360, Wix, VirusShare, mtkiao129, AV-T Team of LisectGroup
|
||||
|
||||
Wix, 0sha0, mtkiao129, AV-T Team of LisectGroup
|
||||
|
||||
Copyright© 2020~2024 PYAS Security By 87owo
|
||||
-167
@@ -1,167 +0,0 @@
|
||||
# PYAS (Python 防毒軟體)
|
||||
|
||||

|
||||
|
||||
## 文件訊息
|
||||
|
||||
PYAS.py -> PYAS主程式(包括動畫、掃描、保護功能等)
|
||||
|
||||
PYAS_Engine.py -> 轉換資料庫(用於相互轉換資料庫字典和清單)
|
||||
|
||||
PYAS_Extension.py -> 檔案副檔名(包括掃描檔案副檔名和常用檔案副檔名)
|
||||
|
||||
PYAS_Model.* -> 病毒庫(病毒庫必須放在同一目錄下)
|
||||
|
||||
PYAS_Interface.py -> PyQt5 Interface(由QT設計師設計,必須與主程式相符)
|
||||
|
||||
PYAS_Resource.py -> PyQt5資源(狀態圖片、圖示包、按鈕圖示等)
|
||||
|
||||
PYAS_Language.py -> 翻譯字典(繁體中文、簡體中文、英文)
|
||||
|
||||
PYAS_Version.py -> Pyinstaller Info(檔案資訊、版本資訊、原名等)
|
||||
|
||||
## 要求
|
||||
|
||||
使用 pip install requirements 來安裝需要的模組
|
||||
|
||||
```
|
||||
psutil==5.9.5
|
||||
pefile==2023.2.7
|
||||
requests==2.31.0
|
||||
pyperclip==1.8.2
|
||||
pywin32==306
|
||||
PyQt5==5.15.9
|
||||
```
|
||||
|
||||
## 哈希掃描
|
||||
|
||||
使用奇虎360雲端服務掃描已知惡意文件
|
||||
|
||||
```
|
||||
import hashlib, requests
|
||||
import xml.etree.ElementTree as xmlet
|
||||
|
||||
def hash_scan(file):
|
||||
try:
|
||||
with open(file, "rb") as f:
|
||||
text = str(hashlib.md5(f.read()).hexdigest())
|
||||
strBody = f'-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="md5s"\r\n\r\n{text}\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="format"\r\n\r\nXML\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="product"\r\n\r\n360zip\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="combo"\r\n\r\n360zip_main\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="v"\r\n\r\n2\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="osver"\r\n\r\n5.1\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="vk"\r\n\r\na03bc211\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="mid"\r\n\r\n8a40d9eff408a78fe9ec10a0e7e60f62\r\n-------------------------------7d83e2d7a141e--'
|
||||
response = requests.post('http://qup.f.360.cn/file_health_info.php', data=strBody, timeout=3)
|
||||
if response.status_code == 200:
|
||||
level = float(xmlet.fromstring(response.text).find('.//e_level').text)
|
||||
if level > 50:
|
||||
return "Virus"
|
||||
elif level <= 10:
|
||||
return "Safe"
|
||||
return "Unknown"
|
||||
return f"Error: {response.status_code}"
|
||||
except Exception as e:
|
||||
return f"Error: {e}"
|
||||
|
||||
info = hash_scan("path to file")
|
||||
print(info)
|
||||
```
|
||||
|
||||
## 文件掃描
|
||||
|
||||
取得pefile檔案函數導入表進行掃描
|
||||
|
||||
```
|
||||
import pefile
|
||||
|
||||
def pe_scan(file):
|
||||
try:
|
||||
fn = []
|
||||
with pefile.PE(file) as pe:
|
||||
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
||||
for func in entry.imports:
|
||||
try:
|
||||
fn.append(str(func.name, "utf-8"))
|
||||
except:
|
||||
pass
|
||||
if fn in known_malicious_list:
|
||||
return "Virus"
|
||||
return "Safe"
|
||||
return "Unknown"
|
||||
except Exception as e:
|
||||
return f"Error: {e}"
|
||||
|
||||
info = pe_scan("path to file")
|
||||
print(info)
|
||||
```
|
||||
|
||||
## 進程偵測
|
||||
|
||||
顯示新進程名稱、檔案路徑、cmd 行、pid
|
||||
```
|
||||
import psutil, time
|
||||
|
||||
def proc_detect():
|
||||
existing_processes = set()
|
||||
for p in psutil.process_iter():
|
||||
if p.pid not in existing_processes:
|
||||
existing_processes.add(p.pid)
|
||||
while True:
|
||||
time.sleep(0.1)
|
||||
for p in psutil.process_iter():
|
||||
try:
|
||||
if p.pid not in existing_processes:
|
||||
existing_processes.add(p.pid)
|
||||
name, file, cmd = p.name(), p.exe(), p.cmdline()
|
||||
print(f"Name: {name}")
|
||||
print(f"File: {file}")
|
||||
print(f"Pid: {p.pid}")
|
||||
print(f"Cmd: {cmd}")
|
||||
except:
|
||||
pass
|
||||
|
||||
proc_detect()
|
||||
```
|
||||
|
||||
## 檔案偵測
|
||||
|
||||
監控指定路徑下的檔案變化
|
||||
```
|
||||
import os, win32file, win32con
|
||||
|
||||
def file_detect(path):
|
||||
hDir = win32file.CreateFile(path,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)
|
||||
while True:
|
||||
for action, file in win32file.ReadDirectoryChangesW(hDir,10485760,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:
|
||||
fpath = os.path.join(path, file)
|
||||
if action == 1:
|
||||
print(f"File Create: {fpath}")
|
||||
elif action == 2:
|
||||
print(f"File Delete: {fpath}")
|
||||
elif action == 3:
|
||||
print(f"File Modify: {fpath}")
|
||||
elif action == 4:
|
||||
print(f"File Rename: {fpath}")
|
||||
elif action == 5:
|
||||
print(f"File Rename: {fpath}")
|
||||
except:
|
||||
pass
|
||||
|
||||
file_detect("path")
|
||||
```
|
||||
|
||||
## 官方網頁
|
||||
|
||||
https://pyantivirus.wixsite.com/pyas
|
||||
|
||||
https://github.com/87owo/PYAS
|
||||
|
||||
## 開源許可證
|
||||
|
||||
https://github.com/87owo/PYAS/blob/main/LICENSE.md
|
||||
|
||||
## 支援的系統
|
||||
|
||||
Windows 8.1, 10, 11 (64-bit),記憶體 1GB, 磁碟容量 1GB 或更高
|
||||
Other systems may experience software malfunctions or crash
|
||||
|
||||
## Special Thanks
|
||||
360, Wix, VirusShare, mtkiao129, AV-T Team of LisectGroup
|
||||
|
||||
Copyright© 2020~2024 PYAS Security By 87owo
|
||||
@@ -0,0 +1,71 @@
|
||||
# PYAS (Python 杀毒软件)
|
||||
|
||||

|
||||
|
||||
## 安装要求
|
||||
|
||||
```
|
||||
psutil==5.9.5
|
||||
pefile==2023.2.7
|
||||
requests==2.31.0
|
||||
pyperclip==1.8.2
|
||||
pywin32==306
|
||||
PyQt5==5.15.9
|
||||
```
|
||||
|
||||
## 文件信息
|
||||
|
||||
```
|
||||
PYAS/
|
||||
├── Driver/
|
||||
│ ├── PYAS_Driver.sys -------> 驱动程序 (0sha0 为 pyas 提供的自我保护驱动程序)
|
||||
│ └── ...
|
||||
│
|
||||
├── Model/
|
||||
│ ├── PYAS_Model.json -------> 病毒数据库 (数据库必须位于指定目录中)
|
||||
│ └── ...
|
||||
│
|
||||
├── Rules/
|
||||
│ ├── Yara_Rules.yar ---------> Yara 规则 (纯文本格式的 yara 规则)
|
||||
│ ├── Yara_Rules.yrc ---------> 编译规则 (编译格式的 yara 规则)
|
||||
│ └── ...
|
||||
│
|
||||
├── PYAS.py ---------------------> PYAS主程序(包含动画、扫描、保护等功能...)
|
||||
├── PYAS_Engine.py -------------> 转换数据库(用于转换剖面图和预报数据)
|
||||
├── PYAS_Suffixes.py -----------> 文件后缀(包含扫描文件后缀和常用后缀)
|
||||
├── PYAS_Interface.py ----------> PyQt5界面(使用QT设计器,需与主程序搭配使用)
|
||||
├── PYAS_Resource.py -----------> PyQt5资源(状态图片、图标包、按钮图标...)
|
||||
├── PYAS_Language.py -----------> 翻译词典(繁体中文、简体中文、英文)
|
||||
├── PYAS_Version.py ------------> 安裝信息(文件信息、版本信息、原名...)
|
||||
└── ...
|
||||
```
|
||||
|
||||
## 官方网页
|
||||
|
||||
https://pyantivirus.wixsite.com/pyas
|
||||
|
||||
https://github.com/87owo/PYAS
|
||||
|
||||
## 微软运行库
|
||||
|
||||
https://github.com/87owo/Microsoft_Runtime/releases
|
||||
|
||||
## 驱动程序
|
||||
|
||||
https://github.com/0sha0/PYAS_Protection
|
||||
|
||||
## 开源协议
|
||||
|
||||
https://github.com/87owo/PYAS/blob/main/LICENSE.md
|
||||
|
||||
## 支援系统
|
||||
|
||||
Windows 8.1, 10, 11 (64-bit), 内存 500MB, 存储 200MB 或更高
|
||||
|
||||
其他系统或版本可能会遇到软体功能故障或程序崩溃
|
||||
|
||||
## 特别感谢
|
||||
|
||||
360, Wix, VirusShare, mtkiao129, AV-T Team of LisectGroup
|
||||
|
||||
Copyright© 2020~2024 PYAS Security By 87owo
|
||||
@@ -0,0 +1,71 @@
|
||||
# PYAS (Python 防毒軟體)
|
||||
|
||||

|
||||
|
||||
## 安裝要求
|
||||
|
||||
```
|
||||
psutil==5.9.5
|
||||
pefile==2023.2.7
|
||||
requests==2.31.0
|
||||
pyperclip==1.8.2
|
||||
pywin32==306
|
||||
PyQt5==5.15.9
|
||||
```
|
||||
|
||||
## 檔案資訊
|
||||
|
||||
```
|
||||
PYAS/
|
||||
├── Driver/
|
||||
│ ├── PYAS_Driver.sys -------> 驅動程式 (0sha0 為 pyas 提供的自我保護驅動程式)
|
||||
│ └── ...
|
||||
│
|
||||
├── Model/
|
||||
│ ├── PYAS_Model.json -------> 病毒資料庫 (資料庫必須位於指定目錄)
|
||||
│ └── ...
|
||||
│
|
||||
├── Rules/
|
||||
│ ├── Yara_Rules.yar ---------> Yara 規則 (純文字格式的 yara 規則)
|
||||
│ ├── Yara_Rules.yrc ---------> 編譯規則 (編譯格式的 yara 規則)
|
||||
│ └── ...
|
||||
│
|
||||
├── PYAS.py ---------------------> PYAS主程式(包含動畫、掃描、保護等功能...)
|
||||
├── PYAS_Engine.py -------------> 轉換資料庫(用於轉換剖面圖和預報資料)
|
||||
├── PYAS_Suffixes.py -----------> 文件後綴(包含掃描文件後綴和常用後綴)
|
||||
├── PYAS_Interface.py ----------> PyQt5介面(使用QT設計器,需與主程式搭配使用)
|
||||
├── PYAS_Resource.py -----------> PyQt5資源(狀態圖片、圖示包、按鈕圖示...)
|
||||
├── PYAS_Language.py -----------> 翻譯字典(繁體中文、簡體中文、英文)
|
||||
├── PYAS_Version.py ------------> 安裝資訊(檔案資訊、版本資訊、原名...)
|
||||
└── ...
|
||||
```
|
||||
|
||||
## 官方網頁
|
||||
|
||||
https://pyantivirus.wixsite.com/pyas
|
||||
|
||||
https://github.com/87owo/PYAS
|
||||
|
||||
## 微軟運行庫
|
||||
|
||||
https://github.com/87owo/Microsoft_Runtime/releases
|
||||
|
||||
## 驅動程式
|
||||
|
||||
https://github.com/0sha0/PYAS_Protection
|
||||
|
||||
## 開源協議
|
||||
|
||||
https://github.com/87owo/PYAS/blob/main/LICENSE.md
|
||||
|
||||
## 支援系統
|
||||
|
||||
Windows 8.1, 10, 11 (64-bit),記憶體 500MB, 磁碟容量 200MB 或更高
|
||||
|
||||
其他系統或版本可能會遇到軟體功能故障或程序崩潰
|
||||
|
||||
## 特別感謝
|
||||
|
||||
Wix, 0sha0, mtkiao129, AV-T Team of LisectGroup
|
||||
|
||||
Copyright© 2020~2024 PYAS Security By 87owo
|
||||
File diff suppressed because it is too large.
Load diff
+256387
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user