/ Published in: PHP
URL: http://www.mechanicmatt.com
OOP class Proxy Server script, requires CURL. This was designed to be used with AJAX. Just point your AJAX script to post to this script passing the post action as $url. CURL will handle it from there and echo the response. To access the response, simply look at $phpProxy->response;
Expand |
Embed | Plain Text
<?php /* By: Matt Ford Purpose: This is a PHP powered proxy script for XSS scripting */ class phpProxy { public $url = null; //request url public $headers = null; //boolean headers public $mimeType = null; //mimetype of response private $session = null; //curl session public $response = null; //curl response public function __construct($request) { $this->phpProxy($request); } public function phpProxy($request) { if ($this->url != "") { $this->initRequest(); } else { $this->response = null; } } private function initRequest() { $this->session = curl_init($this->url); if ($_SERVER["REQUEST_METHOD"] == "POST") { foreach ($_POST as $k => $v) { $postVars[] = $k . "=" . $v; } curl_setopt ($this->session, CURLOPT_POST, true); curl_setopt ($this->session, CURLOPT_POSTFIELDS, $postVars); } else {} curl_setopt($this->session, CURLOPT_HEADER, ($this->headers == "true") ? true : false); curl_setopt($this->session, CURLOPT_FOLLOWLOCATION, true); curl_setopt($this->session, CURLOPT_RETURNTRANSFER, true); $this->response = curl_exec($this->session); if ($this->mimeType != "") { } else {} //echo $this->response; curl_close($this->session); } } $phpProxy = new phpProxy($_REQUEST); ?>
You need to login to post a comment.
