在Windows10上安装WSL使用binwalk命令

Posted 皓月盈江

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在Windows10上安装WSL使用binwalk命令相关的知识,希望对你有一定的参考价值。

Windows 10 推出的WSL 功能可以协助我们直接使用binwalk 分析Windows 内的文件

一、WSL 准备

1、打开控制面板→应用→程序和功能→启动或关闭Windows 功能,打开“适用于Linux 的Windows 子系统”和“虚拟机平台”,随后需要重启。

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
2、打开Windows 10 自带的应用商店(Microsoft Store),搜索Linux,找到自己喜欢的Linux 发行版,安装。
在这里插入图片描述

在这里插入图片描述

3、以Ubuntu 为例,安装成功后,在开始菜单内找到Ubuntu 并打开
在这里插入图片描述
4、稍等片刻后,提示输入Unix 用户名,输入用户名,按回车键

5、提示输入Unix 密码,输入合适的密码,按回车键

在输入密码的过程中,密码不会显示在屏幕上

6、再次输入一遍密码确认无误,按回车键

在这里插入图片描述
二、Linux 换源

1、备份现有的源

sudo mv /etc/apt/sources.list /etc/apt/sources.listbackup
sudo rm /etc/apt/sources.list
sudo touch /etc/apt/sources.list

操作时需要输入一次刚才设置的Unix 密码

2、更换国内源

以清华大学TUNA为例:打开
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
复制灰色文本框内的内容

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

回到WSL窗口,输入命令:
(如果vim没有这个命令,可以百度搜索安装方法)

vim /etc/apt/sources.list

将刚才复制的清华大学源粘贴到sources.list 内,:wq!强制保存退出

如果提示/etc/apt/sources.list" E212: Can’t open file for writing错误
解决方案:

:w !sudo tee % > /dev/null

回到WSL窗口,输入命令:

sudo apt update

等待操作完成。

三、安装binwalk
输入命令:

sudo apt install binwalk

等待操作完成

四、使用binwalk

在Windows 内打开任意一个文件夹,其中包含我们需要使用binwalk分析的文件(例如 test.jpg),按下Shift键,同时右击鼠标,在右键菜单中选择“在此处打开Linux Shell”

输入命令:

binwalk test.jpg

以上是关于在Windows10上安装WSL使用binwalk命令的主要内容,如果未能解决你的问题,请参考以下文章

在 Windows 10 上的 WSL2 上使用 JDK 的正确方法是啥?

Windows10上安装使用Linux子系统(WSL)

Windows学习总结(23)——在 Windows 10 子系统 ubuntu 上利用 WSL2 安装 docker 的 2 种方式

Windows学习总结(23)——在 Windows 10 子系统 ubuntu 上利用 WSL2 安装 docker 的 2 种方式

在 Windows 10 Home 上使用 WSL2 上的 Docker Desktop 时,如何更改 docker 映像的位置?

在 Windows 10 上使用 Intellij IDEA 在 WSL 2 中运行和调试 Java