当前位置:网站首页>Sqli labs installation environment: ubuntu18 php7
Sqli labs installation environment: ubuntu18 php7
2022-07-25 14:08:00 【The goal is technology house】
1. Installation environment
sudo apt-get install apache2 // download apache
sudo apt-get install php //2019.7.23 Now all the downloads are php7.2
sudo apt-get install mysql-server // download mysql
sudo apt-get install libapache2-mod-php //php And apache2 relation
sudo apt-get install php-mysql //mysql And php relation
2. Verify that the environment is built successfully
Browser open http://localhost, appear It works Interface , explain Apache2 The environment was built successfully .
stay /var/www/html Under the folder , New file test.php, The contents are as follows :
<?php
phpinfo();
?>
Browser open http://localhost/test.php, appear php Of info Information , explain php Installation successful .
And then /var/www/html Under the folder , New file test.html, Content and test.php identical , Browser access http://localhost/test.html, If appear php Of info Information , explain Apache2 Can correctly parse html Medium php, You can do the next step ; If it's blank , explain Apache2 Can't parse correctly html Medium php, Additional operations are needed .
There are many ways to solve this problem online , There is a convenient and interesting way to share :
The method idea reference link :https://blog.csdn.net/qq_37756513/article/details/70821168, But slightly different .
find /etc/apache2/mods-available/ Under the php7.2.conf file , Put the
<FilesMatch ".+\.ph(ar|p|tml)$">
Change to :
<FilesMatch ".+\.(ph(ar|p|tml)|html|htm)$">
Explain the part in quotation marks :
. Used to match any character except newline ,+ Represents one or more matches to the preceding subexpression ,\. Used for matching . character , therefore .+\. You can match any file name plus . Symbol . For example, for test.php, It can match test. This part .
In the first line ph(ar|p|tml) It refers to the suffix that can match phar、php、phtml The file of .$ The symbol indicates the end .
Considering that our goal is to make Apache2 Can match html Wait for the documents , So I added html and htm Two suffix types , If necessary in the future , You can also add .
Now restart Apache2 service :sudo /etc/init.d/apache2 restart, Get the prompt of successful restart .
Revisit http://localhost/test.html, You can get php Of info Information , explain Apache2 Can correctly parse html Medium php.
Command line window input sudo mysql -uroot -p, The default password is empty , Directly enter , Get into mysql Command interaction interface , explain mysql Database installed successfully .
3. Database configuration
My user name is root, The account with empty password encountered some problems when using , So I decided to create a new user to connect to the database locally or remotely .
First, enter in the way just mentioned MySQL Command interaction interface , Create a new user first user, Enable users to log in on any remote host :
CREATE USER 'user'@'%' IDENTIFIED BY '123';
Then give users the authority to add, delete, modify and query all tables in all databases :
GRANT ALL ON *.* TO 'user'@'%';
4. download sqli-labs
Because we use PHP7, The original sqli-labs It uses PHP5, The functions used are different .
So here from https://github.com/skyblueee/sqli-labs-php7 Download the file , Unpack it and put it into the directory /var/www/html in .
modify sqli-labs In the folder ,sql-connections Under folder db-creds.inc file , Put the user name dbuser And password dbpass Change to your new setting .
Watch yourself sqli-labs The structure of the folder , If the path of your folder is /var/www/html/sqli-labs/index.html, Then through the :
http://localhost/sqli-labs/index.html
You can successfully access sqli-labs The home page of !
Remember to click Setup/reset Database for labs link , To reset the database . If the return page is successfully perhaps correctly Etc , The installation is successful !
The next step is to get yourself ubuntu Of IP Address , Try to access through other hosts sqli-labs, Click on Setup/reset Database for labs link , Observe whether the remote host can successfully reset the database .
边栏推荐
- What problems should SEOER pay attention to when baidu searches and attacks pirated websites?
- Data analysis business core
- pt100测温电路图(ad590典型的测温电路)
- 新唐NUC980设置DHCP或者静态IP
- Mysql表的操作
- 应急科普|收好这份暑期安全指南,让孩子安全过暑假!
- 职场「数字人」不吃不睡007工作制,你「卷」得过它们吗?
- Data analysis interview records 1-5
- 如何设计一个高并发系统?
- einsum(): operands do not broadcast with remapped shapes [original->remapped]: [1, 144, 20, 17]->[1,
猜你喜欢

Word set paste to retain only text

Idea settings ignore file configuration when submitting SVN

IDEA设置提交SVN时忽略文件配置

如何设计一个高并发系统?
![[directory blasting tool] information collection stage: robots.txt, Yujian, dirsearch, dirb, gobuster](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[directory blasting tool] information collection stage: robots.txt, Yujian, dirsearch, dirb, gobuster

What problems should SEOER pay attention to when baidu searches and attacks pirated websites?

Brush questions - Luogu -p1146 coin flip
![[original] nine point calibration tool for robot head camera calibration](/img/de/5ea86a01f1a714462b52496e2869d6.png)
[original] nine point calibration tool for robot head camera calibration
知名手写笔记软件 招 CTO·坐标深圳

Nuc980 set up SSH xshell connection
随机推荐
Oka pass rights and interests analysis is the best choice to participate in okaleido ecological construction
Package management apt, dpkg
飞沃科技IPO过会:年营收11.3亿 湖南文旅与沅澧投资是股东
redis集群的三种方式
Pytest.mark.parameterize and mock use
应急科普|收好这份暑期安全指南,让孩子安全过暑假!
Easy entry natural language processing series 12 hidden Markov models
手把手教学Yolov7的搭建及实践
Interpretation of featdepth self-monitoring model for monocular depth estimation (Part 2) -- use of openmmlab framework
【学习记录】plt.show()闪退解决方法
轻松入门自然语言处理系列 12 隐马尔可夫模型
Gartner 2022 top technology trend: Super automation
Construction and practice of yolov7 in hands-on teaching
[force deduction] 1030. Arrange matrix cells in distance order
数字孪生 - 认知篇
Engineering monitoring multi-channel vibrating wire sensor wireless acquisition instrument external digital sensor process
[原创]九点标定工具之机械手头部相机标定
Day1: 130 questions in three languages
MySQL 01: Source command
Apple failed to synchronize on its mobile terminal, and logged out. As a result, it could not log in again