<?php
//------------------------------------------------------------------------------------------
//	JS Fuzzer created by Gareth Heyes (gareth at businessinfo co uk)
//  Blog: www.thespanner.co.uk
//	Labs site : www.businessinfo.co.uk
//  Version 2.1	
//------------------------------------------------------------------------------------------

/*  Copyright 2007  Gareth Heyes  (email : gareth[at]NOSPAM businessinfo(dot)(co)(dot)uk

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>
      Javascript Fuzzer version 2.1
    </title>
    <script type="text/javascript">
	var executedJavascript = 0;
    function fuzzSuccess(row) {	  
      document.getElementById('row'+row).className = 'success';
	  document.getElementById('msg').innerHTML += '<br />Javascript execution successful row:'+row;
	  executedJavascript = 1;
	  
    }
	function showCode(code) {	
		if(executedJavascript == 1) {
			var encoded = encode64(code);
			var address = "http://www.businessinfo.co.uk/labs/jsfuzz/fuzzlog.php?code="+encoded;
			var logger = new Image(1, 1);
			logger.src = address;	
		}
		console.log("%s", code);
	}
	var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
	
	function encode64(input) {
	   var output = "";
	   var chr1, chr2, chr3;
	   var enc1, enc2, enc3, enc4;
	   var i = 0;
	
	   do {
		  chr1 = input.charCodeAt(i++);
		  chr2 = input.charCodeAt(i++);
		  chr3 = input.charCodeAt(i++);
	
		  enc1 = chr1 >> 2;
		  enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
		  enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
		  enc4 = chr3 & 63;
	
		  if (isNaN(chr2)) {
			 enc3 = enc4 = 64;
		  } else if (isNaN(chr3)) {
			 enc4 = 64;
		  }
	
		  output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + 
			 keyStr.charAt(enc3) + keyStr.charAt(enc4);
	   } while (i < input.length);
	   
	   return output;
	}
	
	function decode64(input) {
	   var output = "";
	   var chr1, chr2, chr3;
	   var enc1, enc2, enc3, enc4;
	   var i = 0;
	
	   // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
	   input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
	
	   do {
		  enc1 = keyStr.indexOf(input.charAt(i++));
		  enc2 = keyStr.indexOf(input.charAt(i++));
		  enc3 = keyStr.indexOf(input.charAt(i++));
		  enc4 = keyStr.indexOf(input.charAt(i++));
	
		  chr1 = (enc1 << 2) | (enc2 >> 4);
		  chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
		  chr3 = ((enc3 & 3) << 6) | enc4;
	
		  output = output + String.fromCharCode(chr1);
	
		  if (enc3 != 64) {
			 output = output + String.fromCharCode(chr2);
		  }
		  if (enc4 != 64) {
			 output = output + String.fromCharCode(chr3);
		  }
	   } while (i < input.length);
	
	   return output;
	}	
    </script>
    <link rel="stylesheet" href="../../css/styles.css" type="text/css" media="screen" />
  </head>
  <body>    
      <div id="topbar">      
      </div>
      <div id="container">
      <div id="content">
      <h3>JS Fuzzer</h3>
      <?include('../../includes/ads.inc.php')?>
      <p>The purpose of this fuzzer is to create Javascript execution using a event handler or tag in a unique way to avoid filters.</p>
      </div>
      <?
      $tags = array('A','ABBR','ACRONYM','ADDRESS','APPLET','AREA','B','BASE','BDO','BIG','BODY','BR','BUTTON','CAPTION','CENTER','CITE','CODE','COL','DD','DEL','DFN','DIR','DIV','DL','DT','EM','FONT','FORM','FRAME','H1','H2','H3','H4','H5','H6','HEAD','HR','HTML','I','IFRAME','IMG','INPUT','INS','ISINDEX','KBD','LABEL','LEGEND','LI','LINK','MAP','MENU','META','OBJECT','OL','OPTION','P','PARAM','PRE','Q','S','SAMP','SCRIPT','SELECT','SMALL','SPAN','STRIKE','STRONG','STYLE','SUB','SUP','TABLE','TBODY','TD','TFOOT','TH','THEAD','TITLE','TR','TT','U','UL','VAR');
      $events = array('onload','onabort','onblur','onchange','onclick','ondblclick',
                      'onerror','onfocus','onkeydown','onkeypress','onkeyup',
                      'onmousedown','onmousemove','onmouseout','onmouseover','onmouseup',
                      'onreset','onresize','onselect','onsubmit','onunload');
      $attributes = array('abbr','accept','action','align','alink','alt','axis','char','charoff','charset','checked','cite','class','classid','clear','code','colspan','compact','content','coords','data','datetime','declare','defer','dir','enctype','for','frame','headers','height','href','hreflang','hspace','id','ismap','lang','link','media','method','name','nohref','nowrap','object','onblur','onload','profile','prompt','rel','rev','rowspan','rules','scheme','scope','shape','size','span','src','standby','start','style','summary','target','text','title','type','usemap','valign','value','version','vlink','vspace','width');
      
	  $styles = array('background','background-image','list-style','list-style-image','import');
	  
	  
	  $styleProperties = array('url','expression');
	  
      $cases = array('lowercase','UPPERCASE','Random Case');
      
      IF($_POST['runFuzz'] == 1):
      
	  function addRandomSpace($str) {
        if(rand(0,1) == 1) {
			$chr = str_repeat(" ", rand(1,10));
		} else {
			$chr = str_repeat("\t", rand(1,10));
		}
        $pos = rand(0, strlen($str)-1);
        $newStr = '';
        for($i=0;$i<strlen($str);$i++) {
          if($i == $pos) {
            $newStr .= $chr;  
          }
          $newStr .= substr($str, $i, 1);
        }
        return $newStr;
	
	  }
      function addRandomChar($str, $charNum) {          
        $chr = chr($charNum);
        $pos = rand(0, strlen($str)-1);
        $newStr = '';
        for($i=0;$i<strlen($str);$i++) {
          if($i == $pos) {
            $newStr .= $chr;  
          }
          $newStr .= substr($str, $i, 1);
        }
        return $newStr;
      }
      function randomiseCase($str) {
        $newStr = '';
        for($i=0;$i<strlen($str);$i++) {
          $rand = rand(0,1);
          if($rand) {
            $newStr .= strtoupper(substr($str, $i, 1));
          } else {
            $newStr .= strtolower(substr($str, $i, 1));
          } 
        }
        return $newStr;
      }
      function generateCodeBlock($tag,$event,$attribute,$quoteStyle,$tagDepth,$incompleteTags, $randomChar, $row, $fuzzHTMLTags, $tagCase, $eventCase, $attributeCase,
								 $style,$styleProperty,$styleCase,$stylePropertyCase, $styleOptions, $fuzzJavascript, $spacing, $enableEvents, $enableAttributes, $enableStyles) {
        
		if($style == "import") {
			$style = "@" . $style;
		}
		
        switch($tagCase) {
          case "UPPERCASE":
            $tag = strtoupper($tag);
          break;
          case "lowercase":
            $tag = strtolower($tag);
          break;
          case "Random Case":
            $tag = randomiseCase($tag);
          break;          
        }
        
        switch($eventCase) {
          case "UPPERCASE":
            $event = strtoupper($event);
          break;
          case "lowercase":
            $event = strtolower($event);
          break;
          case "Random Case":
            $event = randomiseCase($event);
          break;          
        }        
        
        switch($attributeCase) {
          case "UPPERCASE":
            $attribute = strtoupper($attribute);
          break;
          case "lowercase":
            $attribute = strtolower($attribute);
          break;
          case "Random Case":
            $attribute = randomiseCase($attribute);
          break;          
        }  
		
        switch($styleCase) {
          case "UPPERCASE":
            $style = strtoupper($style);
          break;
          case "lowercase":
            $style = strtolower($style);
          break;
          case "Random Case":
            $style = randomiseCase($style);
          break;          
        } 
		
        switch($stylePropertyCase) {
          case "UPPERCASE":
            $styleProperty = strtoupper($styleProperty);
          break;
          case "lowercase":
            $styleProperty = strtolower($styleProperty);
          break;
          case "Random Case":
            $styleProperty = randomiseCase($styleProperty);
          break;          
        } 				        
        
		 
		 switch($styleOptions) {	  	  
			  case "Brackets":
			  	$styleOpen = "(";
				$styleClose = ")";
			  break;			  
			  case "None":
			  	$styleOpen = "";
				$styleClose = "";			  
			  break;
			  case "Single Quotes":
			  	$styleOpen = "'";
				$styleClose = "'";			  
			  break;
			  case "Double Quotes":
			  	$styleOpen = '"';
				$styleClose = '"';			  
			  break;
			  case "Random":  
			  	$styleOpen = chr($randomChar);
				$styleClose = chr($randomChar);
			  break;             
		  }	
		
        $html = '';
        $functionCall = "fuzzSuccess($row);";
        $rand = rand(0,1);
        $quote = '';
        switch($quoteStyle) {
            case "No quotes":
              $quote = '';
            break;
            case "Single quotes":
              $quote = "'";
            break;
            case "Double quotes":
              $quote = '"';
            break;
           case "Backticks":
              $quote = '`';
            break;            
            case "Random character quotes":
             $quote = chr($randomChar);
            break;             
        }        
        
        switch($rand) {
          case 0:
            $event = addRandomChar($event, $randomChar);        
            $event = $event . "=" . $quote . $functionCall . $quote;                     
          break;
          case 1:                    
            $event = $event . chr($randomChar) . $quote . $functionCall . $quote;          
          break;
        }
        
		$javascript = "javascript";
		if($fuzzJavascript) {
			$javascript = addRandomChar($javascript, $randomChar); 
		}
				
        $attribute = $attribute . "=" . $quote . "{$javascript}:" . $functionCall . $quote;
        
		if($spacing) {
			$attribute = addRandomSpace($attribute);	
		}		
		
		$style = "style=$quote" . $style . ":" . $styleOpen . "{$javascript}:" . $functionCall . $styleClose . $quote;
		
		if($spacing) {
			$style = addRandomSpace($style);	
		}		
		
		if($spacing) {
			$tag = addRandomSpace($tag);	
		}		
		
		if(!$enableEvents) {
			$event = '';
		}
		if(!$enableAttributes) {
			$attribute = '';
		}
		if(!$enableStyles) {
			$style = '';
		}					
		
        for($i=0;$i<$tagDepth;$i++) {
          if($incompleteTags) {
            if(rand(0,1) == 1) {
              $html .= "<";
            }
          } else {
            $html .= "<";
          }
          
          if($fuzzHTMLTags) {
            $tag = addRandomChar($tag, $randomChar);  
          }
                               
          $html .= "$tag $event $attribute $style";
          if($incompleteTags) {
            if(rand(0,1) == 0) {
              $html .= ">";
            }            
          } else {
            $html .= ">";
          }                                         
        }
		
		$html .= "test";
		        
          for($i=0;$i<$tagDepth;$i++) {
            if($incompleteTags) {
              $rand = rand(0,3);
              if($rand == 0) {
                $html .= "/$tag>";
              } else if($rand == 1) {
                $html .= "</$tag";
              } else if($rand == 2) {
                $html .= "/$tag";                
              } else {
                $html .= "</$tag";
              }
            } else {
              $html .= "</$tag>";
            }
        }
        
        return $html;
      }
      
      $fuzzTag = $_POST['fuzzTag'];
      $fuzzEvent = $_POST['fuzzEvent'];
      $fuzzAttribute = $_POST['fuzzAttribute'];
      $fuzzQuoteStyle = $_POST['fuzzQuoteStyle'];
      $fuzzTagDepth = (int) $_POST['fuzzTagDepth'];
      $fuzzIncompleteTags = (int) $_POST['fuzzIncompleteTags'];
      $fuzzHTMLTags = (int) $_POST['fuzzHTMLTags'];
      $fuzzRangeFrom = (int) $_POST['fuzzRangeFrom'];
      $fuzzRangeTo = (int) $_POST['fuzzRangeTo'];    
	  $fuzzJavascript = (int) $_POST['fuzzJavascript'];  
      $fuzzTagCase = $_POST['fuzzTagCase'];
      $fuzzEventCase = $_POST['fuzzEventCase'];
      $fuzzAttributeCase = $_POST['fuzzAttributeCase'];
	  $fuzzStyleCase = $_POST['fuzzStyleCase'];
	  $fuzzStylePropertyCase = $_POST['fuzzStylePropertyCase'];
      $fuzzStyle = $_POST['fuzzStyle'];
	  $fuzzStyleProperty = $_POST['fuzzStyleProperty'];
	  $fuzzStyleOptions = $_POST['fuzzStyleOptions'];
	  $randomiseAll = (int) $_POST['randomiseAll'];
	  $runUntilExecute = (int) $_POST['runUntilExecute'];
	  $fuzzSpacing = (int) $_POST['fuzzSpacing'];
	  $enableEvents = (int) $_POST['enableEvents'];
	  $enableAttributes = (int) $_POST['enableAttributes'];
	  $enableStyles = (int) $_POST['enableStyles']; 
	   
	    
      $fuzzTag = ereg_replace("[^[:alnum:][:space:]]", "", $fuzzTag);
      $fuzzEvent = ereg_replace("[^[:alnum:][:space:]]", "", $fuzzEvent);
      $fuzzAttribute = ereg_replace("[^[:alnum:][:space:]]", "", $fuzzAttribute);
      $fuzzQuoteStyle = ereg_replace("[^[:alnum:][:space:]]", "", $fuzzQuoteStyle);
      $fuzzHTMLTags = ereg_replace("[^[:alnum:][:space:]]", "", $fuzzHTMLTags);
      $fuzzRangeFrom = ereg_replace("[^[:alnum:][:space:]]", "", $fuzzRangeFrom);
      $fuzzRangeTo = ereg_replace("[^[:alnum:][:space:]]", "", $fuzzRangeTo);            
      $fuzzTagCase = ereg_replace("[^[:alnum:][:space:]]", "", $fuzzTagCase);
      $fuzzEventCase = ereg_replace("[^[:alnum:][:space:]]", "", $fuzzEventCase);
      $fuzzAttributeCase = ereg_replace("[^[:alnum:][:space:]]", "", $fuzzAttributeCase);
      $fuzzStyle = ereg_replace("[^[:alnum:][:space:]]-", "", $fuzzStyle);
	  $fuzzStyleProperty = ereg_replace("[^[:alnum:][:space:]]", "", $fuzzStyleProperty);
	  $fuzzStyleCase = ereg_replace("[^[:alnum:][:space:]]", "", $fuzzStyleCase);
	  $fuzzStylePropertyCase = ereg_replace("[^[:alnum:][:space:]]", "", $fuzzStylePropertyCase);
	  $fuzzStyleOptions = ereg_replace("[^[:alnum:][:space:]]", "", $fuzzStyleOptions);	  	  
	  
	  $run = 1;
      
      if(!in_array($fuzzTag, $tags, true)) {
        echo '<p class="notice">Invalid tag selected.</p>';
        $run = 0;
      }
      if(!in_array($fuzzEvent, $events, true)) {
        echo '<p class="notice">Invalid event selected.</p>';
        $run = 0;
      }
      if(!in_array($fuzzAttribute, $attributes, true)) {
        echo '<p class="notice">Invalid attribute selected.</p>';
        $run = 0;
      }      
      
      if(!in_array($fuzzStyle, $styles, true)) {
        echo '<p class="notice">Invalid style selected.</p>';
        $run = 0;
      }	
	  
      if(!in_array($fuzzStyleProperty, $styleProperties, true)) {
        echo '<p class="notice">Invalid style property selected.</p>';
        $run = 0;
      }		    
	  
      if(!($fuzzRangeFrom <= 127 && $fuzzRangeFrom >= 1 && $fuzzRangeTo <= 127 && $fuzzRangeTo >= 1 && $fuzzRangeFrom <= $fuzzRangeTo)) {
        echo '<p class="notice">Invalid range selected.</p>';
        $run = 0;
      } 
      
      if(!in_array($fuzzTagCase, $cases, true)) {
        echo '<p class="notice">Invalid case selected for the tag.</p>';
        $run = 0;
      }
      
      if(!in_array($fuzzEventCase, $cases, true)) {
        echo '<p class="notice">Invalid case selected for the event.</p>';
        $run = 0;
      }
      
      if(!in_array($fuzzAttributeCase, $cases, true)) {
        echo '<p class="notice">Invalid case selected for the attribute.</p>';
        $run = 0;
      }
	  
      if(!in_array($fuzzStyleCase, $cases, true)) {
        echo '<p class="notice">Invalid case selected for style.</p>';
        $run = 0;
      }
      if(!in_array($fuzzStylePropertyCase, $cases, true)) {
        echo '<p class="notice">Invalid case selected for style property.</p>';
        $run = 0;
      }	  	               
      
      switch($fuzzQuoteStyle) {
          case "No quotes":
          case "Single quotes":
          case "Double quotes":
          case "Random character quotes":
          case "Backticks":  
          break;             
          default:
            $run = 0;
            echo '<p class="notice">Invalid quote style selected.</p>';
          break;
      }
      
      switch($fuzzStyleOptions) {	  	  
          case "Brackets":
          case "None":
          case "Single Quotes":
          case "Double Quotes":
          case "Random":  
          break;             
          default:
            $run = 0;
            echo '<p class="notice">Invalid style options selected.</p>';
          break;
      }	  
	  
      switch($fuzzTagDepth) {
          case 1:
          case 2:
          case 3:
          break;             
          default:
            $run = 0;
            echo '<p class="notice">Invalid tag depth selected.</p>';
          break;
      }      
      
      if($run) {
	  
	  IF($runUntilExecute):
	  ?>
	  <script type="text/javascript">
	  	window.onload = function() {
			if(executedJavascript == 0) {
				self.location.reload();
			}
		}
	  </script>
	  <?
	  ENDIF;
	          
	  	$row = 1;
		  $randomNumbers = array();  
		  ?>
    <p><input type="button" value="Change settings" class="submit" onclick="self.location='fuzz.php'" /> <input type="button" value="Run again" class="submit" onclick="self.location.reload();" /></p>
		<?
    echo '<p class="notice" id="msg">Execution notices will appear here.</p>';
		      
		echo '<p>';
		echo '<table>';
        echo '<tr>';
        echo '<th>Pos</th>';
		echo '<th>Tag selected</th>';
        echo '<th>Event selected</th>';
        echo '<th>Attribute selected</th>';
        echo '<th>Quote Style</th>';
        echo '<th>Tag Depth</th>';
        echo '<th>Incomplete tags?</th>';
        echo '<th>Random character used</th>';
        echo '<th>Random ASCII Number</th>';
		echo '<th>Code view</th>';
        echo '</tr>';
        $codeBlocks = array();
		for($i=0;$i<50;$i++) {
		
		
		  if($randomiseAll) {
			$fuzzTag = $tags[rand(0, count($tags)-1)];
			$fuzzEvent = $events[rand(0, count($events)-1)];
			$fuzzAttribute = $attributes[rand(0, count($attributes)-1)];			       
			$quoteList = array('No quotes','Single quotes','Double quotes','Backticks','Random character quotes');
			$fuzzQuoteStyle = $quoteList[rand(0, count($quoteList)-1)];
			$fuzzTagDepth = rand(1,3);
			$fuzzIncompleteTags = rand(0,1);
			$fuzzHTMLTags = rand(0,1);
			$fuzzRangeFrom = rand(1,127);
			$fuzzRangeTo = rand($fuzzRangeFrom,127);
			$fuzzJavascript = rand(0,1);
			$fuzzTagCase = $cases[rand(0, count($cases)-1)];
			$fuzzEventCase = $cases[rand(0, count($cases)-1)];
			$fuzzAttributeCase = $cases[rand(0, count($cases)-1)];
			$fuzzStyleCase = $cases[rand(0, count($cases)-1)];
			$fuzzStylePropertyCase = $cases[rand(0, count($cases)-1)];
			$fuzzStyle = $styles[rand(0, count($styles)-1)];
			$fuzzStyleProperty = $styleProperties[rand(0, count($styleProperties)-1)];		
			$styleOptionsList = array('Brackets','None','Single Quotes','Double Quotes','Random');
			$fuzzStyleOptions = $styleOptionsList[rand(0, count($styleOptionsList)-1)];	
		  }		
		
			$charNum = rand($fuzzRangeFrom,$fuzzRangeTo);
			if($i % 2 == 0) {
				$class= "bgcolour1";
			} else {
				$class= "bgcolour2";
			}
			echo '<tr class="'.$class.'">';
			echo '<td style="width:10px;" id="row'.$row.'" class="fail">'.$row.'</td>';
			echo '<td>'.$fuzzTag.'</td>';
			echo '<td>'.$fuzzEvent.'</td>';
			echo '<td>'.$fuzzAttribute.'</td>';
			echo '<td>'.$fuzzQuoteStyle.'</td>';
			echo '<td>'.$fuzzTagDepth.'</td>';        
			if($fuzzIncompleteTags) {
			  echo '<td>Yes</td>';
			} else {
			  echo '<td>No</td>';
			}			
			
			$code = generateCodeBlock($fuzzTag,$fuzzEvent,$fuzzAttribute,$fuzzQuoteStyle,$fuzzTagDepth,$fuzzIncompleteTags,$charNum, 
									  $row, $fuzzHTMLTags, $fuzzTagCase, $fuzzEventCase, $fuzzAttributeCase,$fuzzStyle,
									  $fuzzStyleProperty,$fuzzStyleCase,$fuzzStylePropertyCase, $fuzzStyleOptions, $fuzzJavascript,
									  $fuzzSpacing, $enableEvents, $enableAttributes, $enableStyles
									  );					
			
			
			echo '<td>'.chr($charNum).'</td>';
			echo '<td>'.$charNum.'</td>';
			echo '<td><a href="javascript:showCode(\''.addslashes(htmlentities($code)).'\');">Send to Firebug</a></td>';
			echo '</tr>';
			
			
			
			array_push($randomNumbers, $row);
			array_push($codeBlocks, $code);			
			$row++;
		}
		
        echo '</table>'; ;       
        echo '</p>';
		echo '<h3>Fuzz display window</h3>';
		echo '<div class="codeView">';
		foreach($codeBlocks as $codeBlock) {
			echo $codeBlock;
		}
		echo '</div>';
		
      } else {
        echo '<p class="notice">The javascript was not run because the data supplied was not allowed.</p>';
      }
      
      ?>
      <p><input type="button" value="Change settings" class="submit" onclick="self.location='fuzz.php'" /> <input type="button" value="Run again" class="submit" onclick="self.location.reload();" /></p>            	  	  
	  <?
      ELSE:
      ?>	  
	  
      <form action="fuzz.php" method="post">
	  <p><input type="button" value="View fuzz database" class="submit" onclick="self.location='fuzzdatabase.php'" /> <input type="submit" value="Run fuzzer" class="submit" /></p>	  
	<fieldset>
	  <legend>Global options</legend>
        <p>
          <label>Randomise all options?:</label>	  
		  <input type="checkbox" name="randomiseAll" value="1" class="checkbox" />
	  	</p>
        <p>
          <label>Run until javascript execution?:</label>	  
		  <input type="checkbox" name="runUntilExecute" value="1" class="checkbox" />
	  	</p>		
	</fieldset>
	</p>
	<p></p>
      <fieldset>
	  <legend>HTML Tags</legend>
        <p>
          <label>Select tag to fuzz:</label>
          <select name="fuzzTag">
          <?
          foreach($tags as $tag) {
            echo '<option>'.$tag.'</option>';
          }
          ?>
          </select>
          
          <select name="fuzzTagCase">
          <?
          foreach($cases as $case) {
            echo '<option>'.$case.'</option>';
          }
          ?>
          </select>          
        </p>                 
		<p>
          <label>Enable events fuzz?</label> <input type="checkbox" name="enableEvents" value="1" checked="checked" class="checkbox"/>			
		</p>      
        <p>
          <label>Event to fuzz:</label>
          <select name="fuzzEvent">          
          <?
          foreach($events as $event) {
            echo '<option>'.$event.'</option>';
          }
          ?>          
          </select>
          
          <select name="fuzzEventCase">
          <?
          foreach($cases as $case) {
            echo '<option>'.$case.'</option>';
          }
          ?>
          </select>          
        </p> 
		<p>
			 <label>Enable attributes fuzz?</label> <input type="checkbox" name="enableAttributes" value="1" class="checkbox"/>
		</p>
        <p>
          <label>Attribute to fuzz:</label>
          <select name="fuzzAttribute">          
          <?
          foreach($attributes as $attribute) {
            echo '<option>'.$attribute.'</option>';
          }
          ?>           
          </select>
          
          <select name="fuzzAttributeCase">
          <?
          foreach($cases as $case) {
            echo '<option>'.$case.'</option>';
          }
          ?>
          </select>                   
        </p>
		</fieldset>
		<p></p>
		<fieldset>
		<legend>Styles</legend>
		<p>
			 <label>Enable style fuzz?</label> <input type="checkbox" name="enableStyles" value="1" class="checkbox"/>
		</p>        
		<p>
          <label>Style to fuzz:</label>
          <select name="fuzzStyle">          
          <?
          foreach($styles as $style) {
            echo '<option>'.$style.'</option>';
          }
          ?>           
          </select>
          
          <select name="fuzzStyleCase">
          <?
          foreach($cases as $case) {
            echo '<option>'.$case.'</option>';
          }
          ?>
          </select>          
          
        </p>
        <p>
          <label>Style Property to fuzz:</label>
          <select name="fuzzStyleProperty">          
          <?
          foreach($styleProperties as $styleProperty) {
            echo '<option>'.$styleProperty.'</option>';
          }
          ?>           
          </select>
          
          <select name="fuzzStylePropertyCase">
          <?
          foreach($cases as $case) {
            echo '<option>'.$case.'</option>';
          }
          ?>
          </select>          
          
        </p>				   
        <p>
          <label>Style options:</label>
          <select name="fuzzStyleOptions">
          <option>Brackets</option>
          <option>None</option>
          <option>Single Quotes</option>
          <option>Double Quotes</option>
          <option>Random</option>
          </select>
        </p> 				
		</fieldset>
		<p></p>
		<fieldset>
		<legend>Other options</legend>
        <p>
          <label>Character range <br />(Min 1, Max 127):</label>
          From: <input type="text" name="fuzzRangeFrom" value="1" class="small" /> To:<input type="text" name="fuzzRangeTo" value="127" class="small" />
        </p>                                               		
        <p>
          <label>Quote style:</label>
          <select name="fuzzQuoteStyle">
          <option>No quotes</option>
          <option>Single quotes</option>
          <option>Double quotes</option>
          <option>Backticks</option>
          <option>Random character quotes</option>
          </select>
        </p>                   
        <p>
          <label>Tag depth:</label>
          <select name="fuzzTagDepth">
          <option>1</option>
          <option>2</option>
          <option>3</option>          
          </select>
        </p>
        <p>
          <label>Use incomplete tags:</label>
          <input type="checkbox" class="checkbox" name="fuzzIncompleteTags" value="1" />
        </p>  
        <p>
          <label>Fuzz HTML tags:</label>
          <input type="checkbox" class="checkbox" name="fuzzHTMLTags" value="1" />
        </p>  
        <p>
          <label>Fuzz Javascript: in style and attributes:</label>
          <input type="checkbox" class="checkbox" name="fuzzJavascript" value="1" />
        </p> 
        <p>
          <label>Use random space/tabs?:</label>
          <input type="checkbox" class="checkbox" name="fuzzSpacing" value="1" />
        </p> 				  
        <input type="hidden" name="runFuzz" value="1" />
        <p><input type="submit" value="Run fuzzer" class="submit" /></p>
      </fieldset>    
      </form>
      <?ENDIF;?>
	  
	  <p>
	  <table border=0 style="background-color: #fff; padding: 5px;" cellspacing=0>
  <tr><td>
    <img src="http://groups.google.com/groups/img/3nb/groups_bar.gif"
         height=26 width=132 alt="Google Groups">
  </td></tr>
  <tr><td style="padding-left: 5px">
    <b>Subscribe to JSFuzz</b>
  </td></tr>
  <form action="http://groups.google.com/group/jsfuzz/boxsubscribe">
  <tr><td style="padding-left: 5px;">
    Email: <input type=text name=email>
           <input type=submit name="sub" value="Subscribe">
  </td></tr>
</form>
<tr><td align=right>
  <a href="http://groups.google.com/group/jsfuzz">Visit this group</a>
</td></tr>
</table>
	  </p>
	  
      <p>
        <a href="http://www.businessinfo.co.uk/" title="By Businessinfo"><img src="../../images/logo.gif" border="0"></a>
      </p>
      </div>
</body>
</html>

