linux取证教程,Linux中的取证(Forensics in Linux)

Linux中的取证(Forensics in Linux)

数字调查的主要问题是通过加密或任何其他格式保护重要证据或数据。 基本示例是存储密码。 因此,有必要了解Linux操作系统在数字取证实施中的使用,以保护这些有价值的数据。

所有本地用户的信息大多存储在以下两个文件中 -/etc/passwd

etc/shadow

第一个是必需的,它存储所有密码。 第二个文件是可选的,它存储有关本地用户的信息,包括散列密码。

关于将密码信息存储在文件中的安全性问题出现了问题,每个用户都可以读取该信息。 因此,散列密码存储在/etc/passwd ,其中内容由特殊值“ x ”替换。

必须在/etc/shadow查找相应的哈希值。 /etc/passwd的设置可能会覆盖/etc/shadow的详细信息。

Linux中的两个文本文件每行包含一个条目,条目由多个字段组成,以冒号分隔。

/etc/passwd的格式如下 -Sr.No.字段名称和描述

1Username

该字段由人类可读格式的属性组成

2Password hash

它由根据Posix crypt函数的编码形式的密码组成

如果哈希密码保存为empty ,则相应的用户将不需要任何密码即可登录系统。 如果此字段包含无法通过哈希算法生成的值(例如感叹号),则用户无法使用密码登录。

具有锁定密码的用户仍可以使用其他身份验证机制(例如,SSH密钥)登录。 如前所述,特殊值“ x ”表示必须在影子文件中找到密码哈希。

password hash包括以下内容 -Encrypted salt - encrypted salt有助于维护屏幕锁定,引脚和密码。

Numerical user ID - 该字段表示用户的ID。 Linux内核将此用户标识分配给系统。

Numerical group ID - 该字段指的是用户的主要组。

Home directory - 新进程以此目录的引用启动。

Command shell - 此可选字段表示成功登录系统后要启动的默认shell。

数字取证包括收集与跟踪证据相关的信息。 因此,用户ID在维护记录时很有用。

使用Python,可以自动分析所有这些信息以获取分析指标,重建最近的系统活动。 通过Linux Shell的实现,跟踪简单易行。

Python Programming with Linux

例子 (Example)import sys

import hashlib

import getpass

def main(argv):

print '\nUser & Password Storage Program in Linux for forensic detection v.01\n'

if raw_input('The file ' + sys.argv[1] + ' will be erased or overwrite if

it exists .\nDo you wish to continue (Y/n): ') not in ('Y','y') :

sys.exit('\nChanges were not recorded\n')

user_name = raw_input('Please Enter a User Name: ')

password = hashlib.sha224(getpass.getpass('Please Enter a Password:')).hexdigest()

# Passwords which are hashed

try:

file_conn = open(sys.argv[1],'w')

file_conn.write(user_name + '\n')

file_conn.write(password + '\n')

file_conn.close()

except:

sys.exit('There was a problem writing the passwords to file!')

if __name__ == "__main__":

main(sys.argv[1:])

输出 (Output)

密码以pass_db.txt中的十六进制格式存储,如以下屏幕截图所示。 保存文本文件以进一步用于计算取证。

2f1aa935620b944460527105d636405c.png

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Linux Forensics is the most comprehensive and up-to-date resource for those wishing to quickly and efficiently perform forensics on Linux systems. It is also a great asset for anyone that would like to better understand Linux internals. Linux Forensics will guide you step by step through the process of investigating a computer running Linux. Everything you need to know from the moment you receive the call from someone who thinks they have been attacked until the final report is written is covered in this book. All of the tools discussed in this book are free and most are also open source. Dr. Philip Polstra shows how to leverage numerous tools such as Python, shell scripting, and MySQL to quickly, easily, and accurately analyze Linux systems. While readers will have a strong grasp of Python and shell scripting by the time they complete this book, no prior knowledge of either of these scripting languages is assumed. Linux Forensics begins by showing you how to determine if there was an incident with minimally invasive techniques. Once it appears likely that an incident has occurred, Dr. Polstra shows you how to collect data from a live system before shutting it down for the creation of filesystem images. Linux Forensics contains extensive coverage of Linux ext2, ext3, and ext4 filesystems. A large collection of Python and shell scripts for creating, mounting, and analyzing filesystem images are presented in this book. Dr. Polstra introduces readers to the exciting new field of memory analysis using the Volatility framework. Discussions of advanced attacks and malware analysis round out the book. Book Highlights 370 pages in large, easy-to-read 8.5 x 11 inch format Over 9000 lines of Python scripts with explanations Over 800 lines of shell scripts with explanations A 102 page chapter containing up-to-date information on the ext4 filesystem Two scenarios described in detail with images available from the book website All scripts and other support files are availab

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值