Hi there, Im building a proxy site (well built and running apart from one small problem) which only gives access to certain outside sites (this proxy is accessable internally and externally - needs the IP to view the sites).

I have run into a problem with one of the sites, it decides to think that all the files are located on our server instead of the site we are pointing at, all the other links are fine but this one keeps coming up with "not found" and 500 error pages.

Error is:

[Thu Feb 19 10:30:45 2009] [error] [client 10.10.200.6] File does not exist: /srv/www/vproxy.ssl/commonmenu.do, referer: https://<site removed for security reasons>uk/index.php?q=uggc%3A%2F%2Fsvaq.tnyrtebhc.pbz%2Fzrah%2Fpbzzbazrah.qb%3FhfreTebhcAnzr%3Dine_wvfp

And

[Fri Jan 30 13:13:01 2009] [error] [client 10.10.200.6] File does not exist: /srv/www/vproxy.ssl/new/index.php?q=http%3A%2F%<site removed for security reasons>%2Fmenu%2Fcommonmenu.do%3FuserGroupName%3D<group removed>%26finalAuth%3Dtrue&hl=200, referer: https://<site removed for security reasons>uk/new/commonmenu.do?userGroupName=<group removed>c&action=updateCspList&searchTerm=&DB=SPN.SP00_ITOF_

Anyone got any idea's? The code is sound as it works on other sites which have more or less the same security 🙁

Any help would be welcomes with loving embrase 😛

    The post action:

    <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
        <ul id="form">
          <li id="address_bar"><label><name of site> <input id="address_box" type="hidden" name="<?php echo $GLOBALS['_config']['url_var_name'] ?>" value="<?php //echo isset($GLOBALS['_url']) ? htmlspecialchars($GLOBALS['_url']) : '' ?>URL" onfocus="this.select()" /></label> <input id="go" type="submit" value="Go" /></li>
        </ul>
      </form>

    The full code:

    <?php
    
    if (basename(__FILE__) == basename($_SERVER['PHP_SELF']))
    {
        exit(0);
    }
    
    echo '<?xml version="1.0" encoding="utf-8"?>';
    
    ?>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
    <head>
      <title>Varndean College - LRC resource access</title>
      <link rel="stylesheet" type="text/css" href="style.css" title="Default Theme" media="all" />
    </head>
    <body onload="document.getElementById('address_box').focus()">
    <div id="container">
      <h1 id="title" align="center">Resource access <br/>&nbsp;</h1>
      <ul id="navigation">
      </ul>
    <?php
    
    switch ($data['category'])
    {
        case 'auth':
    ?>
      <div id="auth"><p>
      <b>Enter your username and password for "<?php echo htmlspecialchars($data['realm']) ?>" on <?php echo $GLOBALS['_url_parts']['host'] ?></b>
      <form method="post" action="">
        <input type="hidden" name="<?php echo $GLOBALS['_config']['basic_auth_var_name'] ?>" value="<?php echo base64_encode($data['realm']) ?>" />
        <label>Username <input type="text" name="username" value="" /></label> <label>Password <input type="password" name="password" value="" /></label> <input type="submit" value="Login" />
      </form></p></div>
    <?php
            break;
        case 'error':
            echo '<div id="error"><p>';
    
        switch ($data['group'])
        {
            case 'url':
                echo '<b>URL Error (' . $data['error'] . ')</b>: ';
                switch ($data['type'])
                {
                    case 'internal':
                        $message = 'Failed to connect to the specified host. '
                                 . 'Possible problems are that the server was not found, the connection timed out, or the connection refused by the host. '
                                 . 'Try connecting again and check if the address is correct.';
                        break;
                    case 'external':
                        switch ($data['error'])
                        {
                            case 1:
                                $message = 'The URL you\'re attempting to access is blacklisted by this server. Please select another URL.';
                                break;
                            case 2:
                                $message = 'The URL you entered is malformed. Please check whether you entered the correct URL or not.';
                                break;
                        }
    
      }
                            break;
                    }
                    break;
                case 'resource':
                    echo '<b>Resource Error:</b> ';
                    switch ($data['type'])
                    {
                        case 'file_size':
                            $message = 'The file your are attempting to download is too large.<br />'
                                     . 'Maxiumum permissible file size is <b>' . number_format($GLOBALS['_config']['max_file_size']/1048576, 2) . ' MB</b><br />'
                                     . 'Requested file size is <b>' . number_format($GLOBALS['_content_length']/1048576, 2) . ' MB</b>';
                            break;
                        case 'hotlinking':
                            $message = 'It appears that you are trying to access a resource through this proxy from a remote Website.<br />'
                                     . 'For security reasons, please use the form below to do so.';
                            break;
                    }
                    break;
            }
    
        echo 'An error has occured while trying to browse through the proxy. <br />' . $message . '</p></div>';
        break;
    }
    ?>
    <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
        <ul id="form">
          <li id="address_bar"><label><name of site> <input id="address_box" type="hidden" name="<?php echo $GLOBALS['_config']['url_var_name'] ?>" value="<?php //echo isset($GLOBALS['_url']) ? htmlspecialchars($GLOBALS['_url']) : '' ?>URL" onfocus="this.select()" /></label> <input id="go" type="submit" value="Go" /></li>
        </ul>
    <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
        <ul id="form">
          <li id="address_bar">
            <label>Encyclopedia Britannica <input id="address_box" type="hidden" name="<?php echo $GLOBALS['_config']['url_var_name'] ?>" value="<?php //echo isset($GLOBALS['_url']) ? htmlspecialchars($GLOBALS['_url']) : '' ?>search.eb.com" onfocus="this.select()" /></label> <input id="go" type="submit" value="Go" /></li>
    
    
      </form>
        </ul>
      </form>
    </div>
    </body>
    </html>
    
    
    

    Sorry that the code looks alittle dodgy 🙁. This is the main part of the code, the second link works fine, the URL was removed from the first as it contains info on the company along with login details.

    There are now 20 links and only one doesnt work, I think its down to their css script and our proxy script

      Write a Reply...