Skip to content

Commit 376816e

Browse files
grayddqgrayddq
authored andcommitted
bug
1 parent bdcca1b commit 376816e

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

lib/Backdoor_Analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def get_malware_info(self):
264264
# 分析文件是否包含恶意特征或者反弹shell问题
265265
def analysis_file(self, file):
266266
try:
267-
time.sleep(0.01)
267+
time.sleep(0.05)
268268
if not os.path.exists(file): return ""
269269
if os.path.isdir(file): return ""
270270
if " " in file: return ""

lib/File_Analysis.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,26 @@ def __init__(self):
2929
def check_system_integrity(self):
3030
suspicious, malice = False, False
3131

32+
system_file = ["depmod", "fsck", "fuser", "ifconfig", "ifdown", "ifup", "init", "insmod", "ip", "lsmod",
33+
"modinfo", "modprobe", "nologin", "rmmod", "route", "rsyslogd", "runlevel", "sulogin", "sysctl",
34+
"awk", "basename", "bash", "cat", "chmod", "chown", "cp", "cut", "date", "df", "dmesg", "echo",
35+
"egrep", "env", "fgrep", "find", "grep", "kill", "logger", "login", "ls", "mail", "mktemp",
36+
"more", "mount", "mv", "netstat", "ping", "ps", "pwd", "readlink", "rpm", "sed", "sh", "sort",
37+
"su", "touch", "uname", "gawk", "mailx", "adduser", "chroot", "groupadd", "groupdel", "groupmod",
38+
"grpck", "lsof", "pwck", "sestatus", "sshd", "useradd", "userdel", "usermod", "vipw", "chattr",
39+
"curl", "diff", "dirname", "du", "file", "groups", "head", "id", "ipcs", "killall", "last",
40+
"lastlog", "ldd", "less", "lsattr", "md5sum", "newgrp", "passwd", "perl", "pgrep", "pkill",
41+
"pstree", "runcon", "sha1sum", "sha224sum", "sha256sum", "sha384sum", "sha512sum", "size", "ssh",
42+
"stat", "strace", "strings", "sudo", "tail", "test", "top", "tr", "uniq", "users", "vmstat", "w",
43+
"watch", "wc", "wget", "whereis", "which", "who", "whoami"]
44+
3245
binary_list = ['/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/', '/usr/local/sbin/', '/usr/local/bin/']
3346
try:
3447
for dir in binary_list:
3548
if not os.path.exists(dir): continue
3649
for file in gci(dir):
37-
if not os.path.exists(file): continue
38-
if os.path.isdir(file): continue
39-
if (os.path.getsize(file) == 0) or (
40-
round(os.path.getsize(file) / float(1024 * 1024)) > 10): continue
50+
filename = os.path.basename(file)
51+
if not filename in system_file: continue
4152
malware = self.analysis_file(file)
4253
if malware:
4354
self.file_malware.append(
@@ -135,7 +146,7 @@ def check_contents_ip(self, contents):
135146
# 分析文件是否包含恶意特征、反弹shell特征、境外ip类信息
136147
def analysis_file(self, file):
137148
try:
138-
time.sleep(0.01)
149+
time.sleep(0.05)
139150
if not os.path.exists(file): return ""
140151
if os.path.isdir(file): return ""
141152
if " " in file: return ""

lib/Proc_Analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def check_contents_ip(self, contents):
5757
# 分析文件是否包含恶意特征、反弹shell特征、境外ip类信息
5858
def analysis_file(self, file):
5959
try:
60-
time.sleep(0.01)
60+
time.sleep(0.05)
6161
if not os.path.exists(file): return ""
6262
if os.path.isdir(file): return ""
6363
if " " in file: return ""

0 commit comments

Comments
 (0)