Skip to content

Commit

Permalink
Update User_Analysis.py
Browse files Browse the repository at this point in the history
文件权限出现“.”的特殊情况
  • Loading branch information
grayddq authored Dec 30, 2019
1 parent 628db62 commit e0caf5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/plugins/User_Analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ def passwd_file_analysis(self):
if not os.path.exists(file): continue
shell_process = os.popen("ls -l " + file + " 2>/dev/null |awk '{print $1}'").read().splitlines()
if len(shell_process) != 1: continue
if file == '/etc/passwd' and shell_process[0] != '-rw-r--r--':
if file == '/etc/passwd' and shell_process[0].strip('.') != '-rw-r--r--':
malice_result(self.name, u'账户密码文件扫描', file, '',
u'passwd文件权限变更,不为-rw-r--r--', u'ls -l /etc/passwd', u'可疑')
suspicious = True
elif file == '/etc/shadow' and shell_process[0] != '----------':
elif file == '/etc/shadow' and shell_process[0].strip('.') != '----------':
malice_result(self.name, u'账户密码文件扫描', file, '',
u'shadow文件权限变更,不为----------', u'ls -l /etc/shadow', u'可疑')
suspicious = True
Expand Down

1 comment on commit e0caf5f

@knigth95
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是否该源程序包只支持Cenos系统,是否支持Ubuntu,如果需要修改适配Ubuntu,那应该如何操作

Please sign in to comment.