Mac PHP 环境配置+渗透环境

时间:2021-06-22 19:32:42

/*
最近购入一台mac pro 配置自己的php环境以及渗透环境 留个笔记
*/
Mac 自带的PHP 加 apache 所以就不需要install 咯。只需要down个mysql 就好了。
0x1  启动环境
   sudo apachectl start   启动
   sudo apachectl -v  查看版本
   sudo vi /etc/apache2/httpd.conf  编辑http.conf
  
find LoadModule php5_module libexec/apache2/libphp5.so  replace #

  :wq! 退出

  sudo cp /etc/php.ini.default /etc/php.ini  拷贝默认配置过来

  mac默认的wwwroot 在  /Library/WebServer/Documents/   进入cd

  vi info.php

  

phpinfo();

  sudo apachectl  restart

  install mysql  去官网下载一个

  sudo vi /etc/bashrc

   #mysql

   alias mysql='/usr/local/mysql/bin/mysql'

   alias mysqladmin='/usr/local/mysql/bin/mysqladmin'
  
  
   down phpmyadmin  or  brew install phpmyadmin  
   sudo vi /etc/apache2/httpd.conf    
    
<Directory "/Library/WebServer/Documents/phpMyAdmin-4.4.1">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>

  cd phpmyadmin

  cp config.sample.inc.php  config.inc.php

  sudo vi config.inc.php  修改自己的root password 将localhost : 127.0.0.1

  配置好之后 php 脚本调试不显示错误 那么继续修改

  how to display error 
  sudo vi /etc/php.ini
  display_errors = On
  error_reporting = E_ALL | E_STRICT
 
  sudo vi /etc/apache2/httpd.conf
  php_flag display_errors        on
  php_value error_reporting       2039
 
  sudo apachectl stop 
  sudo apachectl start 
mysql start log 
  
show variables like ‘general_log_file’;  view mysql log file
general_log_file | /usr/local/mysql/data/S4b0rdeMacBook-Pro.log
sudo chmod a+x /usr/local/mysql/data/S4b0rdeMacBook-Pro.log 赋予权限
sudo cat /usr/local/mysql/data/S4b0rdeMacBook-Pro.log view
 
渗透环境安装:
brew http://brew.sh/  installed 
sudo gitclonehttps://github.com/sqlmapproject/sqlmap.git   //install sqlmap 
sudo vi /etc/bashrc
#sqlmap
alias sqlmap='python /#/sqlmap.py'
alias sqlmaapi = 'python /#/sqmap.py'
 
down brup