Jump to content

HosterSlice

Helpers
  • Posts

    46
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by HosterSlice

  1. Is there anything else you would like it to monitor?

     

    As in update, here is what it currently monitors:

     

    stevie.heliohost.org

    • Apache
    • SSL Apache
    • MySQL
    • cPanel
    • SSL cPanel
    • SSL Webmail
    • FTP
    • WebMail
    • POP3
    • IMAP
    • SMTP
    • Secure SMTP
    • IMAP 4 Over SSL
    • Secure POP3

     

    johnny.heliohost.org

    • Apache
    • SSL Apache
    • MySQL
    • cPanel
    • SSL cPanel
    • SSL Webmail
    • FTP
    • WebMail
    • POP3
    • IMAP
    • SMTP
    • Secure SMTP
    • IMAP 4 Over SSL
    • Secure POP3

    www.helionet.org

    • Apache
    • MySQL

     

    www.heliohost.org

    • Apache
    • MySQL

  2. This came up in my current project, so I thought I would share.

    <?php
    function rawshell($cmd) {
     $t = time()."txt";
     $cmds = explode(";",$cmd);
     $out = '';
     foreach($cmds as $c) {
    exec($c." &> ".$t);
    $out .= file_get_contents($t);
     }
     exec("rm -f ".$t);
     return $out;
    }
    echo rawshell("ls -al; whoami");
    

     

    What this will do is give you the output you would get as if you had done it via ssh.

     

    **NOTE: THIS WILL NOT WORK ON SITES HOSTED HERE AS EXEC AND THE LIKE ARE DISABLED FOR SECURITY PURPOSES!**

  3. Hi Walfix,

     

    There is an easy fix for this.

     

    First, you will want to use this function:

    <?php
    function mime_content_type($filename, $mimePath = './') {
      $fileext = substr(strrchr($filename, '.'), 1);
      if (empty($fileext)) return (false);
      $regex = "/^([\w\+\-\.\/]+)\s+(\w+\s)*($fileext\s)/i";
      $lines = file("$mimePath/mime.types");
      foreach($lines as $line) {
      if (substr($line, 0, 1) == '#') continue; // skip comments
      $line = rtrim($line) . " ";
      if (!preg_match($regex, $line, $matches)) continue; // no match to the extension
      return ($matches[1]);
      }
      return (false); // no match at all
    }
    ?>
    

     

    Then, download this file to your home folder:

    http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types

     

    I recommend addind the following to the bottom:

    application/x-httpd-php php

     

    This is because by default it does not have the php extension in it,

     

    Then, use the function like so:

     

     

    <?php
    $type = mime_content_type($filename);
    ?>
    

×
×
  • Create New...