如何使用“PHP” 彩蛋进行敏感信息获取
关于“PHP彩蛋”的说法也许很多老PHPer已经都知道或听说了,好像是早在PHP4版本的时候就有彩蛋了,挺好玩儿的,可能近年来逐渐被人们遗忘了,其实彩蛋功能在PHP脚本引擎默认情况下是开启。
写个phpinfo();然后访问,再加上以下的GET值即可查阅
下面就用Discuz官方论坛做一下测试:
http://www.discuz.net/?=PHPE9568F34-D428-11d2-A769-00AA001ACF42
http://www.discuz.net/?=PHPE9568F35-D428-11d2-A769-00AA001ACF42
http://www.discuz.net/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
http://www.discuz.net/?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000
如上4个链接加红色的部分是PHP源码/ext/standard/info.h中定义的GUID值,如下图所示
关于PHP彩蛋这个玩法已经被国外的某些Web漏洞扫描器(例如:HP WebInspect)所使用了,用其来探测被扫描的网站使用的是何种Web开发语言。其实在渗透测试过程中经常遇见某些网站难以辨别出使用了何种Web开发语言,因为有些网站采用动态脚本生成纯静态HTML页或者是采用URL重写实现伪静态页面,如果网站使用的是PHP开发的话,可以尝试使用彩蛋的探测法,在很多情况下可以一针见血的鉴定出来,因为默认情况下彩蛋的功能在php.ini中是开启的,当然如果不想让别人通过彩蛋的方式来获取网站的敏感信息的话,那就在php.ini中将expose_php = Off即可!
看完上面这些可能有些人会说既然php.ini中的expose_php = On,那么直接抓包看看http头信息不就OK了,可是某些大站点Web服务器的前面都是有反向代理服务器的,所以还不能完全依赖于捕获http头中的信息。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

In this chapter, we are going to learn the following topics related to routing ?

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Validator can be created by adding the following two lines in the controller.
