当前位置:网站首页>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 .
边栏推荐
- Detailed explanation of Telnet remote login AAA mode [Huawei ENSP]
- Brush questions - Luogu -p1151 sub number integer
- 新唐NUC980设置DHCP或者静态IP
- bond0脚本
- RuntimeError: CUDA out of memory(已解决)[通俗易懂]
- 苹果手机端同步不成功,退出登录,结果再也登录不了
- Interpretation of featdepth self-monitoring model for monocular depth estimation (Part I) -- paper understanding and core source code analysis
- Easy entry natural language processing series 12 hidden Markov models
- Brush questions - Luogu -p1035 series summation
- Amd epyc 9664 flagship specification exposure: 96 core 192 threads 480MB cache 3.8ghz frequency
猜你喜欢

Doris学习笔记之与其他系统集成
![[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

依迅总经理孙峰:公司已完成股改,准备IPO

Typora cannot open the prompt to install a new version solution
![[original] nine point calibration tool for robot head camera calibration](/img/de/5ea86a01f1a714462b52496e2869d6.png)
[original] nine point calibration tool for robot head camera calibration

Business data analysis of CDA level1 knowledge point summary

Mysql表的操作

Brush questions - Luogu -p1047 trees outside the school gate

Interpretation of featdepth self-monitoring model for monocular depth estimation (Part 2) -- use of openmmlab framework

Deep understanding of pytorch distributed parallel processing tool DDP -- starting from bugs in engineering practice
随机推荐
NUC980 设置SSH Xshell连接
伯克利博士『机器学习工程』大实话;AI副总裁『2022 ML就业市场』分析;半导体创业公司大列表;大规模视频人脸属性数据集;前沿论文 | ShowMeAI资讯日报
金鱼哥RHCA回忆录:CL210管理存储--对象存储
[directory blasting tool] information collection stage: robots.txt, Yujian, dirsearch, dirb, gobuster
wangeditor 富文本编辑器
Data analysis interview records 1-5
Introducing mlops interpretation (I)
Workplace "digital people" don't eat or sleep 007 work system, can you "roll" them?
Famous handwritten note taking software recruit CTO · coordinate Shenzhen
飞盘局有多快乐?2022年轻人新潮运动报告
pt100测温电路图(ad590典型的测温电路)
Lesson of C function without brackets
手把手教学Yolov7的搭建及实践
Brush questions - Luogu -p1035 series summation
Three ways of redis cluster
Engineering monitoring multi-channel vibrating wire sensor wireless acquisition instrument external digital sensor process
CDA level Ⅰ 2021 new version simulation question 1 (with answers)
Teach you how to apply for SSL certificate
Okaleido launched the fusion mining mode, which is the only way for Oka to verify the current output
数字孪生 - 认知篇