VM in Kali create a shared folder with DVWA installation, configuration,

A few days later did not send blog, learn what not any, just today, our school class Network Security Association arrived and took over the collection before today tops the kali uploaded by VMware shared folders from the machine to the last full installation dvwa comparison of course, there are a number of chiefs before the integration of useful articles about, however, is not necessarily for everyone. Fast in September, and came maybe can look after the newborn.

 

One. Install VMware-tools

Nothing to talk about, click on the top of the Virtual Machine menu, click VMware-tools installed ok.

 

two. Create a shared folder

In the case of shutdown, click on the top of the Virtual Machine menu, click on Settings, or direct shortcut keys Ctrl + D,

Then click on Options, you can see the shared folder

 

 

 

Always select Enable and then set about the shared folder location, and the rest default on it.

 

three. hgfs file does not appear

 

After the shared folder settings, we should have been in a different location - next to find shared files plus hgfs mnt folder - computer. But I do not have. If some of you, you can skip this point.

 

 

 

If not, you can try these three commands:

apt-get install open-vm-dkms
mount -t vmhgfs .host:/ /mnt/

 

If the first command appears this result: E: Unable to locate package open-vm-dkms

 

Can try:

apt-get install open-vm-tools
 mkdir  /mnt/hgfs
 mount -t vmhgfs  .host:/  /mun/hgfs

 

If the first command appears:

 

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it

 

则输入:

rm /var/cache/apt/archives/lock
rm /var/lib/dpkg/lock

 

之后再次输入之前三条即可,这时候就可以看到出现hgfs文件夹了。

 

四.安装VMware-tools

然后接着说回VMware-tools,我们要注意将下载好的的VMware tools的压缩包移动到tmp文件夹下面,否则会没有权限进行接下来的操作。以下,你下载的VMware tools这个的名称下文我们用VMT来代替

 

 

所以我们使用以下代码

cp VMT. tar.gz /tmp

cd /tmp     进入TMP目录

tar -zxvf VMT.tar.gz 解压

cd vmware-tools-distrib/

sudo ./vmware-install.pl

然后一直按回车

最后再reboot 重启一下

共享文件夹 完成

 

五.

然后我们可以将DVWA-master在本机上下好或者在kali上下载,github也行:https://github.com/ethicalhack3r/DVWA,官网http://www.dvwa.co.uk/也行

当然,也可以直接在终端上下载:

wget https://github.com/ethicalhack3r/DVWA/archive/master.zip

mv master.zip /var/www/html   移动到/var/www/html/ 文件夹下

cd /var/www/html

unzip master.zip

mv DVWA-master dvwa  改个名字

chown www-data:www-data /var/www/html/dvwa/hackable/uploads   

chown   www-data:www-data /var/www/html/dvwa/external/phpids/0.6/lib/IDS/tmp/phpids_log.txt

dvwa文件夹提权

chmod -R 777 /var/www/html/dvwa

 

六.配置环境

 

因为kali自带php mysql apache环境

所以我们直接启动就可以完成一些任务了

service apache2 stop 关闭Apache

service mysql start  开启MySQL

mysql -u root -p 打开MySQL 要注意MySQL语句后面有个 ; 不要忘记 然后回车

use mysql 使用数据库

update user set password=PASSWORD('xxxxxx') where User='root';     更改 root 密码为 xxxxxx

flush privileges; 刷新 MySQL 的系统权限相关表

create database dvwa; 创建数据库 dvwa

由于 Kali Linux 下 MySQL 默认是使用 MariaDB, 所以无法使用 root 用户连接 mysql ,必须创建一个新的用户用于连接使用,可以赋予他 root 权限.

在mysql下直接  grant all on dvwa.* to dvwa@localhost identified by 'password';

或者先 create user ‘ 名字’@’ 密码’ INDENTIFIED BY ‘ ’;

再给权限   GRANT ALL PRIVILEGES ON *.* to 'dvwauser'@'localhost';也可

然后刷新一下 flush privileges;

最后退出 quit

 

 

七.进入DVWA

 

进去之前先更改/var/www/html/dvwa/config/文件夹上的config.inc.php.dist文件的后缀dist去掉

 

然后再打开这个文件,把db_user和db_password改成你的mysql数据库的账号密码

 

进去之前要记得将之前所说的

service apache2 start

service mysql start

然后进入127.0.0.1/dvwa/或者localhost/dvwa/

点击create/reset database即可进入DVWA,尽情享用吧。。

 

 

好了,内容就到这里了。希望这篇文章对看到这里的您有所帮助,感谢观看。

参考链接

https://blog.csdn.net/DynastyDoubleH/article/details/82862411

https://blog.csdn.net/happy_hsf/article/details/82530046

Guess you like

Origin www.cnblogs.com/S413/p/11332861.html