如何使用“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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

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

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Linux new version
SublimeText3 Linux latest version
