Ejemplo n.º 1
0
function performRequest($request)
{
    $response = "";
    $settings = readSettings();
    if ($settings["use_proxy"] == "1") {
        // POST via proxy
        $post_url = "http://" . __REQUEST_HOST . ":" . __REQUEST_PORT . __REQUEST_SCRIPT;
        $head = "POST " . $post_url . " HTTP/1.0\r\n";
        //$head .= "Host: ".__REQUEST_HOST."\r\n";
        $head .= "User-Agent: PHPot " . __HPOT_TAG2 . "\r\n";
        if ($settings["proxy_auth"] == "basic") {
            $head .= "Proxy-Authorization: Basic " . base64_encode($settings["proxy_user"] . ":" . $settings["proxy_pass"]) . "\r\n";
        }
        $head .= "Cache-Control: no-store, no-cache\r\n";
        $head .= "Accept: */*\r\n";
        $head .= "Pragma: no-cache\r\n";
        $head .= "Content-Type: application/x-www-form-urlencoded\r\n";
        $head .= "Content-Length: " . strlen($request) . "\r\n";
        $head .= "Connection: close\r\n\r\n";
    } else {
        // POST directly
        $head = "POST " . __REQUEST_SCRIPT . " HTTP/1.1\r\n";
        $head .= "Host: " . __REQUEST_HOST . "\r\n";
        $head .= "User-Agent: PHPot " . __HPOT_TAG2 . "\r\n";
        $head .= "Content-Type: application/x-www-form-urlencoded\r\n";
        $head .= "Content-Length: " . strlen($request) . "\r\n";
        $head .= "Connection: close\r\n\r\n";
    }
    $errno = NULL;
    $errstr = NULL;
    $fd = @fsockopen($settings["sock_host"], $settings["sock_port"], $errno, $errstr, 20);
    if (!$fd) {
        // Socket Error
        die("\n<BR>Unable to contact the Server. Are outbound connections disabled? (If a proxy is required for outbound traffic, you may configure the honey pot to use a proxy. For instructions, visit http://www.projecthoneypot.org/settings_help.php)<BR>\n");
        return "-1";
    } else {
        fputs($fd, $head . $request);
        while (!feof($fd)) {
            $response .= fgets($fd, 4096);
        }
        fclose($fd);
    }
    return $response;
}
Ejemplo n.º 2
0
    <td align="left"><textarea name="genres" cols="45" rows="4" style="width:100%;"><?php 
            echo readSettings($settings_data['genres']);
            ?>
</textarea></td>
  </tr>
  <tr>
    <td align="right" valign="middle"><strong><?php 
            echo $lang_admin_garbageFilter;
            ?>
:</strong>
      <br />(<?php 
            echo $lang_admin_onePerLine;
            ?>
)</td>
    <td align="left"><textarea name="garbage" cols="45" rows="4" style="width:100%;"><?php 
            echo readSettings($settings_data['garbage']);
            ?>
</textarea></td>
  </tr>
  <tr>
    <td align="right" valign="top">&nbsp;</td>
    <td align="right"><input name="save" type="submit" value="Save Information" /></form></td>
  </tr>
</table>
</div>

<div style="float:left;padding-left:20px;">
<table width="300" border="0">
  <tr>
    <td>
    <div style="line-height:20px;">
Ejemplo n.º 3
0
if (file_exists('config.php')) {
    require_once 'config.php';
} else {
    require_once 'functions.php';
}
require_once 'includes/RestrictCSRF.php';
//DB existence check, Creates DB files if not present
if (!file_exists('params.php')) {
    require 'includes/createdbs.php';
} else {
    require_once 'params.php';
}
if (!file_exists($dbName . '-settings.db') || !file_exists($dbName . '-logs.db') || !file_exists($dbName . '-crons.db') || !file_exists($dbName . '-users.db')) {
    require 'includes/createdbs.php';
}
readSettings();
if ((isset($_GET['lang']) || isset($_COOKIE['FBMPGPLang'])) && file_exists('lang/' . (isset($_GET['lang']) ? $_GET['lang'] : $_COOKIE['FBMPGPLang']) . '-lang.php')) {
    require_once 'lang/' . (isset($_GET['lang']) ? $_GET['lang'] : $_COOKIE['FBMPGPLang']) . '-lang.php';
} else {
    require_once 'lang/' . $adminOptions['lang'] . '-lang.php';
}
if ($adminOptions['scriptTitle'] != "") {
    $lang['Script Title'] = $adminOptions['scriptTitle'];
}
if ($adminOptions['scriptHeading'] != "") {
    $lang['Heading'] = $adminOptions['scriptHeading'];
}
if (isset($_GET['lang']) && file_exists('lang/' . $_GET['lang'] . '-lang.php')) {
    setcookie("FBMPGPLang", $_GET['lang'], time() + 86400 * 365);
    $_COOKIE['FBMPGPLang'] = $_GET['lang'];
}