M 108: Kali Virtual Machine (15 pts) M 108:Kali虚拟机(15分)

What You Need for This Project你需要什么这个项目

Task 1: Preparing your Host Machine任务1:准备主机

The physical computer you use is called a "Host".您使用的物理计算机称为“主机”。 The virtual machines that run on it are called "Guests".在其上运行的虚拟机称为“来宾”。

Installing VMware安装VMware

If you are working in S214, the lab machines should already have VMware installed.如果您在S214中工作,实验室机器应该已经安装了VMware。

If you are using your own PC, you can get the free VMware Player here:如果您使用自己的PC,可以在此处获取免费的VMware Player:

https://my.vmware.com/en/web/vmware/free#desktop_end_user_computing/vmware_workstation_player/14_0 https://my.vmware.com/en/web/vmware/free#desktop_end_user_computing/vmware_workstation_player/14_0

If you are using a Mac, you can get a free copy of VMware Fusion from the college as explained by your instructor, or use VirtualBox.如果您使用的是Mac,您可以按照教师的说明从学院获得免费的VMware Fusion副本,或者使用VirtualBox。

Install VMware with the default options.使用默认选项安装VMware。

Task 2: Preparing a Kali Virtual Machine任务2:准备Kali虚拟机

Downloading a Kali VM File下载Kali VM文件

In a Web browser, go to:在Web浏览器中,转到:

https://www.offensive-security.com/kali-linux-vmware-virtualbox-image-download/ https://www.offensive-security.com/kali-linux-vmware-virtualbox-image-download/

Click " Kali Linux 64 bit VM 7z ", as shown below.单击“ Kali Linux 64位VM 7z ”,如下所示。

Installing 7-Zip安装7-Zip

If you are using Windows, downoad and install 7-Zip .如果您使用的是Windows,请下载并安装7-Zip

Then right-click the Kali .7z file and use the "7-Zip" item to unzip it.然后右键单击Kali .7z文件并使用“7-Zip”项解压缩它。

If you are using a Mac, unzip the file with The Unarchiver .如果您使用的是Mac,请使用The Unarchiver解压缩该文件。

Starting your Kali Virtual Machine启动您的Kali虚拟机

In VMware Player, at the top left, click Player , File , Open... , as shown below.在VMware Player的左上角,单击“ 播放器” ,“ 文件” ,“ 打开...” ,如下所示。

Navigate to the Kali VM you unzipped and start it.导航到解压缩的Kali VM并启动它。

Troubleshooting: Number of Processors故障排除:处理器数量

If you see a message saying the virtual machine is configured to use four processors, adjust it with these steps:如果您看到一条消息,指出虚拟机已配置为使用四个处理器,请使用以下步骤进行调整:
  • On the left side of the VMware Player window, click Kali once to select it.在VMware Player窗口的左侧,单击Kali一次以选择它。
  • On the lower right side of the VMware Player window, click " Edit virtual machine settings ".在VMware Player窗口的右下角,单击“ 编辑虚拟机设置 ”。
  • On the left side of the Virtual Machine Settings window, click Processors在“虚拟机设置”窗口的左侧,单击“ 处理器”
  • On the right side of the Virtual Machine Settings window, adjust the number to 1 and click OK在“虚拟机设置”窗口的右侧,将数字调整为1 ,然后单击“ 确定”

Troubleshooting: Slow Performance故障排除:性能低下

If your virtual machines run very slowly, your host machine may be low on RAM.如果虚拟机运行速度非常慢,则主机可能内存不足。
You can adjust the RAM using the Virtual Machine Settings window, as explained in the previous Troubleshooting box.您可以使用“虚拟机设置”窗口调整RAM,如上一个“故障排除”框中所述。

Try lowering the RAM on the Kali VM to 1024 MB.尝试将Kali VM上的RAM降低到1024 MB。

Log in to Kali with the username root and a password of toor使用用户名root和密码toor登录Kali

You should see the Kali Linux desktop as shown below:您应该看到Kali Linux桌面,如下所示:

Testing your Kali Linux Networking测试您的Kali Linux网络

At the top left of the Kali Linux desktop, click the rectangular black icon to open a Terminal window.在Kali Linux桌面的左上角,单击矩形黑色图标以打开终端窗口。

In the Terminal window, type in this command to find your IP address, and then press the Enter key:在“终端”窗口中,键入此命令以查找您的IP地址,然后按Enter键:

ping google.com
You should see replies, as shown below.您应该看到回复,如下所示。 Press Ctrl+C to stop the pings.Ctrl + C可停止ping。

Task 3: Fixing Kali Annoyances任务3:解决Kali烦恼

Fixing VMware Tools修复VMware Tools

VMware Tools is needed to allow copy-and-paste into and out of a virtual machine.需要VMware Tools才能允许复制和粘贴进出虚拟机。 Unfortunately it works very poorly on Kali.不幸的是,它对卡利的效果很差。 You can try these fixes, or just abandon it and install SSH.您可以尝试这些修复,或者只是放弃它并安装SSH。

I recommend just using SSH, with these instructions:我建议只使用SSH,并提供以下说明:

Installing SSH on Kali 在Kali上安装SSH

If you want to try to get VMware Tools working, proceed with the steps below.如果您想尝试使VMware Tools正常工作,请继续执行以下步骤。

On your host Windows system, in your Web browser, use the mouse to highlight and copy this command:在主机Windows系统上,在Web浏览器中,使用鼠标突出显示并复制此命令:

echo "Copy and paste works!"
On your Kali Linux system, in a Terminal window, right-click and click Paste .在Kali Linux系统的“终端”窗口中,右键单击并单击“ 粘贴” If VMware tools is working, the command appears, as shown below.如果VMware工具正在运行,则会显示该命令,如下所示。

If the command did not appear, perform these steps to fix VMware Tools.如果未显示该命令,请执行以下步骤以修复VMware Tools。

Removing open-vm-tools删除open-vm-tools

In a Terminal window, execute these commands:在终端窗口中,执行以下命令:
apt purge open-vm-tools-desktop -y apt purge open-vm-tools-desktop -y
apt purge open-vm-tools -y apt purge open-vm-tools -y
rm -rf /etc/vmware-tools rm -rf / etc / vmware-tools

Installing VMware's Version安装VMware版本

From the VMware menu bar, click " Virtual Machine ", " Install VMware Tools ".在VMware菜单栏中,单击“ 虚拟机 ”,“ 安装VMware Tools ”。

Click Install .单击安装

A CD icon appears on your Kali desktop, as shown below. Kali桌面上会出现一个CD图标,如下所示。

Double-click the CD icon.双击CD图标。 Right-click VMwareTools...tar.gz and click " Copy to... ", as shown below.右键单击VMwareTools ... tar.gz,然后单击“ 复制到... ”,如下所示。

In the "Select Copy Destination" box, on the left side, click Downloads .在“选择复制目标”框中,在左侧单击“ 下载”

At the top right, click Select , as shown below.在右上角,单击“ 选择” ,如下所示。

Close the VMware Tools window.关闭VMware Tools窗口。

In a Terminal window, execute these commands:在终端窗口中,执行以下命令:

cd光盘
cd Downloads cd下载
tar xzf VMwareTools* tar xzf VMwareTools *
cd vmware-tools-distrib cd vmware-tools-distrib
./vmware-install.pl ./vmware-install.pl

The installer asks many questions.安装程序提出了很多问题。 Accept the default directories, but make sure the answer to every yes/no question is yes , including this one, which is "no" by default:接受默认目录,但要确保每个是/否问题的答案都是肯定的 ,包括这个,默认情况下为“否”:

Reboot your virtual machine.重新启动虚拟机。

Execute this command to start VMware tools:执行此命令以启动VMware工具:

service vmware-tools start服务vmware-tools启动
Now you can copy and paste text and files between the Kali VM and the Mac host!现在,您可以在Kali VM和Mac主机之间复制和粘贴文本和文件!

Making VMware Tools Start Automatically使VMware Tools自动启动

This is a very old-fashioned way to do it, but it works.这是一种非常老式的方式,但它确实有效。

Execute this command to make a Bash script:执行此命令以生成Bash脚本:

nano /usr/local/bin/startvm nano / usr / local / bin / startvm
Paste in the code below:粘贴在下面的代码中:
#!/bin/bash #!/斌/庆典
if [ $(/usr/sbin/service vmware-tools status | grep Active: | grep inactive | wc -l) -gt 0 ] if [$(/ usr / sbin / service vmware-tools status | grep Active:| grep inactive | wc -l)-gt 0]
then然后
  /usr/sbin/service vmware-tools start / usr / sbin / service vmware-tools启动
fi科幻

Press Ctrl+X , Y , Enter to save the file.Ctrl + XYEnter保存文件。

Execute this command to make the script executable:执行此命令以使脚本可执行:

chmod +x /usr/local/bin/startvm chmod + x / usr / local / bin / startvm
Execute this command to create a cron job:执行此命令以创建cron作业:
crontab -e crontab -e
Press Enter to use nano.Enter键以使用nano。

Add this line at the end of the file, as shown below.在文件末尾添加此行,如下所示。

* * * * * /usr/local/bin/startvm * * * * * / usr / local / bin / startvm

Press Ctrl+X , Y , Enter to save the file.Ctrl + XYEnter保存文件。

Now VMware Tools will start automatically :)现在VMware Tools将自动启动:)

Power Saving省电

By default, Kali 2.0 will keep locking the screen after a few seconds of inactivity, which is irritating.默认情况下,Kali 2.0会在几秒钟不活动后继续锁定屏幕,这很烦人。 To fix this, on the left side of the Kali 2.0 desktop, click the bottom button to " Show Applications ", as shown below.要解决此问题,请在Kali 2.0桌面的左侧单击底部按钮以“ 显示应用程序 ”,如下所示。

On the right side of the Kali 2.0 desktop, click the lowest circle to show the bottom screen.在Kali 2.0桌面的右侧,单击最下面的圆圈以显示底部屏幕。

Then click Settings , as shown below.然后单击“设置” ,如下所示。

In the "All Settings" window, click Power .在“所有设置”窗口中,单击“ 电源”

Set "Blank screen" to Never , as shown below.将“空白屏幕”设置为“ 从不” ,如下所示。

Task 4: Finding the Linux Version任务4:查找Linux版本

In the Terminal window, type in this command and then press the Enter key:在“终端”窗口中,键入此命令,然后按Enter键:
uname -a
You should see information about your Linux version, as shown below.您应该看到有关Linux版本的信息,如下所示。


M 108: Version (15 pts) M 108:版本(15分)

Find the text covered by a gray box in the image above.找到上图中灰色框所覆盖的文字。 That's the flag.那是旗帜。


Shutting Down your Virtual Machine关闭虚拟机

In the VMware Player window, in the upper right corner, click the X. A box pops up, offering three choices, as shown below.在VMware Player窗口的右上角,单击X.弹出一个框,提供三个选项,如下所示。

Suspend freezes your VM in its current state. 挂起将VM冻结在当前状态。 This is usually the best choice.这通常是最好的选择。

Power Off is only for emergencies, when the guest operating system has crashed. 断电仅用于客户操作系统崩溃时的紧急情况。 It's the equivalent of pulling out the power plug on a real computer.这相当于在真正的计算机上拔出电源插头。

Click Suspend .单击“ 暂停”

Integrated with Canvas 6-27-18与Canvas 6-27-18集成
SSH link fixed incorrectly 9-10-18 SSH链接修复不正确9-10-18
SSH link restored 9-11-18 SSH链接已恢复9-11-18
Adapted for 128 1-14-19适应128 1-14-19
Converted to a CTF 2-28-19转换为CTF 2-28-19