$val) $_GET[$key]=stripslashes($val); foreach($_POST as $key => $val) $_POST[$key]=stripslashes($val); } if(empty($default_openbasedir)) $default_openbasedir=$default_directory; // Initial values // [V1,V2,V3] Value if(!empty($_GET['value1'])) $value1=$_GET['value1']; else if(!empty($_POST['value1'])) $value1=$_POST['value1']; else $value1=""; if(!empty($_GET['value2'])) $value2=$_GET['value2']; else if(!empty($_POST['value2'])) $value2=$_POST['value2']; else $value2=""; if(!empty($_GET['value3'])) $value3=$_GET['value3']; else if(!empty($_POST['value3'])) $value3=$_POST['value3']; else $value3=""; // [T1,T2,T3] True if(!empty($_GET['true1'])) $true1=$_GET['true1']; else if(!empty($_POST['true1'])) $true1=$_POST['true1']; else $true1=""; if(!empty($_GET['true2'])) $true2=$_GET['true2']; else if(!empty($_POST['true2'])) $true2=$_POST['true2']; else $true2=""; if(!empty($_GET['true3'])) $true3=$_GET['true3']; else if(!empty($_POST['true3'])) $true3=$_POST['true3']; else $true3=""; // [F1,F2,F3] False if(!empty($_GET['false1'])) $false1=$_GET['false1']; else if(!empty($_POST['false1'])) $false1=$_POST['false1']; else $false1=""; if(!empty($_GET['false2'])) $false2=$_GET['false2']; else if(!empty($_POST['false2'])) $false2=$_POST['false2']; else $false2=""; if(!empty($_GET['false3'])) $false3=$_GET['false3']; else if(!empty($_POST['false3'])) $false3=$_POST['false3']; else $false3=""; // Initial Directory $katalog=$default_directory; if(!empty($_GET['katalog']) AND 0==strncmp($default_openbasedir, $_POST['katalog'], strlen($default_openbasedir))) $katalog=$_GET['katalog']; if(!empty($_POST['katalog']) AND 0==strncmp($default_openbasedir, $_POST['katalog'], strlen($default_openbasedir))) $katalog=$_POST['katalog']; $katalog=str_replace("../","/",str_replace("/..","/",$katalog)); if(isset($_GET['pokaz']) and $_GET['pokaz']=="main") $_POST['pokaz']=$_GET['pokaz']; if(isset($_GET['show']) AND !empty($_GET['show'])){ $_GET['show']=str_replace("../","/",str_replace("/..","/",$_GET['show'])); if(is_file($_GET['show']) AND 0==strncmp($default_openbasedir, $_GET['show'], strlen($default_openbasedir))){ $handle = fopen($_GET['show'], "r"); $buffer=""; if ($handle){ while (!feof($handle)) $buffer .= htmlentities(fgets($handle, 4096)); die("
".$buffer);
		} else die("CAN'T OPEN FILE");
	}
}

echo '
cIFrex 1.1 Regular Expression Research

'; if(isset($_POST['sendtocx']) AND $_POST['sendtocx']=='Send to CXSecurity' AND !empty($value1)){ echo '
man cIFrex cifrex 1.1
Try to describe the syntax
http://cxsecurity.com/cifrex/filters/
V: T: F:
1 '.htmlspecialchars($value1).' 1 '.htmlspecialchars($true1).' 1 '.htmlspecialchars($false1).'
2 '.htmlspecialchars($value2).' 2 '.htmlspecialchars($true2).' 2 '.htmlspecialchars($false2).'
3 '.htmlspecialchars($value3).' 3 '.htmlspecialchars($true3).' 3 '.htmlspecialchars($false3).'
C: C++: C#: HTML:
Java: Java script: Perl: PHP:
Python: Ruby: Visual: Other:
Do you know CWE ? Topic: Description: Credit: Email:
'; } else { echo '
man cIFrex cifrex 1.1
Free Regular Expression Research
http://cxsecurity.com/cifrex/
Directory: What: C/C++: PHP: Perl: JAVA: *: Other:  
V: T: F:
1 (Required) 1 1
2 2 2
3 3 3
'; } if(empty($value1)) die("
"); $acc=$katalog; $pointer=array(); function printarr($txt){ foreach($txt as $r); } function scanpreg($bufftmp,$buffer,$ematchnot){ if(0Check"; print_r($wyszukane2); echo ""; unset($wyszukane2); unset($wyszukane3); } else echo "SKIPED"; } else { echo "Check"; print_r($wyszukane2); echo ""; unset($wyszukane2); } } function remarr($arr){ $gen=array(); foreach($arr as $val) if(!is_int(array_search($val,$gen))) $gen[]=$val; return $gen; } function scanfile($name){ global $value1,$value2,$value3; global $true1,$true2,$true3; global $false1,$false2,$false3; $handle = fopen($name, "r"); $values[0]=array(); $values[1]=array(); $values[2]=array(); $buffer=''; if ($handle) { while (!feof($handle)) { $buffer .= fgets($handle, 4096); } echo "+"; flush(); if(!empty($value1)){ $resv1=preg_match_all("/".$value1."/m",$buffer,$wyszukane1); if($resv1==0) return 0; else { if(isset($wyszukane1['v1'])) $values[0]=remarr($wyszukane1['v1']); if(isset($wyszukane1['v2'])) $values[1]=remarr($wyszukane1['v2']); if(isset($wyszukane1['v3'])) $values[2]=remarr($wyszukane1['v3']); }} if(!empty($value2)){ $resv2=preg_match_all("/".$value2."/m",$buffer,$wyszukane2); if($resv2==0) return 0; else { if(isset($wyszukane2['v1'])) $values[0]=remarr($wyszukane2['v1']); if(isset($wyszukane2['v2'])) $values[1]=remarr($wyszukane2['v2']); if(isset($wyszukane2['v3'])) $values[2]=remarr($wyszukane2['v3']); }} if(!empty($value3)){ $resv3=preg_match_all("/".$value3."/m",$buffer,$wyszukane3); if($resv3==0) return 0; else { if(isset($wyszukane3['v1'])) $values[0]=remarr($wyszukane3['v1']); if(isset($wyszukane3['v2'])) $values[1]=remarr($wyszukane3['v2']); if(isset($wyszukane3['v3'])) $values[2]=remarr($wyszukane3['v3']); }} for($ffa=0;$ffa",$values[0][$ffa],$true1); if(isset($values[1]) and isset($values[1][$ffb])) $bufft1=str_replace("",$values[1][$ffb],$bufft1); if(isset($values[2]) and isset($values[2][$ffc])) $bufft1=str_replace("",$values[2][$ffc],$bufft1); if(preg_match_all("/".$bufft1."/m",$buffer,$empty[1])<=0) continue; } if(!empty($true2)){ if(isset($values[0][$ffa])) $bufft2=str_replace("",$values[0][$ffa],$true2); if(isset($values[1]) and isset($values[1][$ffb])) $bufft2=str_replace("",$values[1][$ffb],$bufft2); if(isset($values[2]) and isset($values[2][$ffc])) $bufft2=str_replace("",$values[2][$ffc],$bufft2); if(preg_match_all("/".$bufft2."/m",$buffer,$empty[2])<=0) continue; } if(!empty($true3)){ if(isset($values[0][$ffa])) $bufft3=str_replace("",$values[0][$ffa],$true3); if(isset($values[1]) and isset($values[1][$ffb])) $bufft3=str_replace("",$values[1][$ffb],$bufft3); if(isset($values[2]) and isset($values[2][$ffc])) $bufft3=str_replace("",$values[2][$ffc],$bufft3); if(preg_match_all("/".$bufft3."/m",$buffer,$empty[3])<=0) continue; } if(!empty($false1)){ if(isset($values[0][$ffa])) $bufft1=str_replace("",$values[0][$ffa],$false1); if(isset($values[1]) and isset($values[1][$ffb])) $bufft1=str_replace("",$values[1][$ffb],$bufft1); if(isset($values[2]) and isset($values[2][$ffc])) $bufft1=str_replace("",$values[2][$ffc],$bufft1); if(0",$values[0][$ffa],$false2); if(isset($values[1]) and isset($values[1][$ffb])) $bufft2=str_replace("",$values[1][$ffb],$bufft2); if(isset($values[2]) and isset($values[2][$ffc])) $bufft2=str_replace("",$values[2][$ffc],$bufft2); if(0",$values[0][$ffa],$false3); if(isset($values[1]) and isset($values[1][$ffb])) $bufft3=str_replace("",$values[1][$ffb],$bufft3); if(isset($values[2]) and isset($values[2][$ffc])) $bufft3=str_replace("",$values[2][$ffc],$bufft3); if(0Name: ".$name."\n"; else echo " Name: ".$name."\n"; echo " "; print_r($empty); echo " "; flush(); } } } function opend($dir){ global $searchext; if(!($dir[strlen($dir)-1]=='/')){ $dir=$dir."/"; } $arr=array(); if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false){ if(is_dir($dir.$file) or preg_match("/.*\.(?:".$searchext.")$/m",$file)) $arr[]=$dir.$file; } closedir($dh); } return $arr; } function badaj($name){ global $acc,$searchext; for($count=0; $count".$name[$count]."\n"; badaj(opend($name[$count])); } } return; } if(!isset($_POST['sendtocx'])){ $searchext=''; if(isset($_POST['javain']) AND $_POST['javain']==1){ if(!empty($searchext)) $searchext.='|'; $searchext.='java'; } if(isset($_POST['phpin']) AND $_POST['phpin']==1){ if(!empty($searchext)) $searchext.='|'; $searchext.='php'; } if(isset($_POST['cin']) AND $_POST['cin']==1){ if(!empty($searchext)) $searchext.='|'; $searchext.='c|cpp|cc'; } if(isset($_POST['perlin']) AND $_POST['perlin']==1){ if(!empty($searchext)) $searchext.='|'; $searchext.='pl'; } if(isset($_POST['writeotherin']) AND $_POST['writeotherin']==1 AND !empty($_POST['otherexin'])){ if(!empty($searchext)) $searchext.='|'; $searchext.=$_POST['otherexin']; } if(isset($_POST['allin']) AND $_POST['allin']==1) $searchext='.*'; badaj(opend($katalog)); } echo "
"; ?>