如何在 Linux/Unix/Windows 中发现隐藏的进程和端口
2018-02-09 16:53
573 查看
unhide是一个小巧的网络取证工具,能够发现那些借助 rootkit、LKM 及其它技术隐藏的进程和 TCP/UDP 端口。这个工具在 Linux、UNIX 类、MS-Windows 等操作系统下都可以工作。根据其 man 页面的说明:
Unhide 通过下述三项技术来发现隐藏的进程。
进程相关的技术,包括将
/proc目录与 /bin/ps 命令的输出进行比较。
系统相关的技术,包括将 /bin/ps 命令的输出结果同从系统调用方面得到的信息进行比较。
穷举法相关的技术,包括对所有的进程 ID 进行暴力求解,该技术仅限于在基于 Linux2.6 内核的系统中使用。
绝大多数的 Rootkit 工具或者恶意软件借助内核来实现进程隐藏,这些进程只在内核内部可见。你可以使用
unhide或者诸如 rkhunter 等工具,扫描 rootkit 程序 、后门程序以及一些可能存在的本地漏洞。
这篇文章描述了如何安装 unhide 并搜索隐藏的进程和 TCP/UDP 端口。
如何安装 unhide
首先建议你在只读介质上运行这个工具。如果使用的是 Ubuntu 或者 Debian 发行版,输入下述的 apt-get/apt 命令以安装 Unhide:1 2 | $ sudo apt-get install unhide |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | [sudo] password for vivek: Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: rkhunter The following NEW packages will be installed: unhide 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 46.6 kB of archives. After this operation, 136 kB of additional disk space will be used. Get:1 http://in.archive.ubuntu.com/ubuntu artful/universe amd64 unhide amd64 20130526-1 [46.6 kB] Fetched 46.6 kB in 0s (49.0 kB/s) Selecting previously unselected package unhide. (Reading database ... 205367 files and directories currently installed.) Preparing to unpack .../unhide_20130526-1_amd64.deb ... Unpacking unhide (20130526-1) ... Setting up unhide (20130526-1) ... Processing triggers for man-db (2.7.6.1-2) ... |
如何在 RHEL/CentOS/Oracle/Scientific/Fedora 上安装 unhide
输入下列 yum Type the following yum command (first turn on EPLE repo on a CentOS/RHEL version 6.x or version 7.x):输入以下的 yum 命令(CentOS/RHEL 6.x 或 7.x 上首先打开 EPEL 仓库):
1 2 | $ sudo yum install unhide |
1 2 | $ sudo dnf install unhide |
如何在 Arch 上安装 unhide
键入以下 pacman 命令安装:1 2 | $ sudo pacman -S unhide |
如何在 FreeBSD 上安装 unhide
可以通过以下的命令使用 port 来安装 unhide:1 2 3 | # cd /usr/ports/security/unhide/ # make install clean |
1 2 | # pkg install unhide |
如何使用 unhide 工具?
unhide 的语法是:1 2 | unhide [options] test_list |
test_list参数可以是以下测试列表中的一个或者多个标准测试:
brute
proc
procall
procfs
quick
reverse
sys
或基本测试:
checkbrute
checkchdir
checkgetaffinity
checkgetparam
checkgetpgid
checkgetprio
checkRRgetinterval
checkgetsched
checkgetsid
checkkill
checknoprocps
checkopendir
checkproc
checkquick
checkreaddir
checkreverse
checksysinfo
checksysinfo2
checksysinfo3
你可以通过以下示例命令使用
unhide:
1 2 3 4 | # unhide proc # unhide sys # unhide quick |
1 2 3 4 5 6 7 8 9 10 | Unhide 20130526 Copyright © 2013 Yago Jesus & Patrick Gouin License GPLv3+ : GNU GPL version 3 or later http://www.unhide-forensics.info NOTE : This version of unhide is for systems using Linux >= 2.6 Used options: [*]Searching for Hidden processes through comparison of results of system calls, proc, dir and ps |
如何使用 unhide-tcp 工具辨明 TCP/UDP 端口的身份
以下是来自 man 页面的介绍:unhide-tcp取证工具通过对所有可用的 TCP/IP 端口进行暴力求解的方式,辨别所有正在监听,却没有列入 /bin/netstat 或者 /bin/ss 命令输出的 TCP/IP 端口身份。
注一:对于 FreeBSD、OpenBSD系统,一般使用 netstat 命令取代在这些操作系统上不存在的 iproute2,此外,sockstat 命令也用于替代 fuser。
注二:如果操作系统不支持 iproute2 命令,在使用
unhide时需要在命令上加上
-n或者
-s选项。
1 2 | # unhide-tcp |
1 2 3 4 5 6 7 | Unhide 20100201 http://www.security-projects.com/?Unhide Starting TCP checking Starting UDP checking |
但在下述示例中,我展示了一些有趣的事。
1 2 | # unhide-tcp |
1 2 3 4 5 6 7 8 9 10 11 | Unhide 20100201 http://www.security-projects.com/?Unhide Starting TCP checking Found Hidden port that not appears in netstat: 1048 Found Hidden port that not appears in netstat: 1049 Found Hidden port that not appears in netstat: 1050 Starting UDP checking |
netstat -tulpn和
ss命令确实没有反映出这三个隐藏的端口:
1 2 3 4 | # netstat -tulpn | grep 1048 # ss -lp # ss -l | grep 1048 |
unhide:
1 2 3 | $ man unhide $ man unhide-tcp |
Windows 用户如何安装使用 unhide
你可以通过这个页面获取 Windows 版本的 unhide。相关文章推荐
- 如何在 Linux/Unix/Windows 中发现隐藏的进程和端口
- 如何在 Linux/Unix/Windows 中发现隐藏的进程和端口
- 如何在windows和linux下查看进程使用的端口或通过端口查看进程
- Windows和Linux下如何查看端口被哪个进程占用的方法
- 如何在Window或Linux/Unix中查找并干掉占用指定端口的进程
- Windows和Linux下如何查看端口被哪个进程占用
- windows和Linux查看端口占用进程并关闭
- windows和linux下使用命令查找端口对应的进程pid并杀死进程
- Windows 如何查看本地端口被进程占用的情况?
- 在linux/unix下如何去掉windows下的换行符
- windows & Linux 下命令行查看端口占用情况并且关闭进程
- linux如何查看端口被哪个进程占用
- 发现并解决linux高I/O Wait问题 – 如何发现linux中引起高io等待的进程
- unix/linux 系统实现多个进程监听同一个端口
- 如何在Windows中编译Linux Unix的代码?
- 如何在Windows平台下实现进程隐藏
- windows下关于如何查询现在某个端口是否被占用,占用这个端口的进程
- linux如何查看端口被哪个进程占用的方法
- Unix/Linux如何创建一个后台进程(run background process)
- 如何在Windows中编译Linux Unix的代码?