Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Hacking Perl Script

  1. #1
    falco85 is offline Programmer
    Join Date
    Apr 2006
    Posts
    105
    Rep Power
    0

    Hacking Perl Script

    I was looking through my log files and happened by a file upload that should not have been uploaded (through a script somehow they managed to upload although they shouldn't have access). I then immediatly went to the directory the script was inserted into "/tmp" and opened the file. The first line reads #!/usr/bin/perl and even though I have used perl before I still don't entirely understand what this script does.

    Edit: Code Removed

    I can see that it opens lynx and connects to the local machine but what does this do:

    [highlight="Perl"]
    $system= 'echo "`uname -a`";echo "`id`";/bin/sh';
    [/highlight]

    I understand echo and uname but is it calling /bin/sh?

    From this point down I do not understand. Any of this I do not really understand what it is doing:

    [highlight="Perl"]
    EDIT: Code Removed
    [/highlight]

    Can someone help me figure out what the intention of this script is?
    Last edited by Jordan; 01-30-2009 at 06:13 AM.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    KevinADC is offline Programmer
    Join Date
    Jan 2007
    Posts
    125
    Rep Power
    0
    hmmm.... I don't know what it is trying to do. Maybe ask on PerlMonks - The Monastery Gates if you get an answer post back here.

  4. #3
    Lop's Avatar
    Lop
    Lop is offline Speaks fluent binary
    Join Date
    May 2006
    Posts
    1,178
    Rep Power
    30
    It looks like it is just loading a website. The arguments could be anything though. It doesn't look malicious.

  5. #4
    zosorock is offline Newbie
    Join Date
    Nov 2007
    Posts
    1
    Rep Power
    0
    I believe it is indeed malicious. In my case I was presented with a mailqueue of 9000 emails trying to send out a phising/scam type of email (excerpt below), right after this script showed up.

    I am not that good of a server admin but I am pretty sure this script started it somehow.

    Excerpt of the email:
    The Local Organizing Committee of the Heineken European Champions League is glad to announce to the world the giving away of the sum of TWO HUNDRED MILLION POUNDS to 100 lucky email addresses all over the world.

    I hope you didn't have the same problem... it was pretty annoying to delete all those... thankfully they all came from nobody@.
    Last edited by zosorock; 11-17-2007 at 11:58 PM.

  6. #5
    ETbyrne's Avatar
    ETbyrne is offline Learning Programmer
    Join Date
    Nov 2007
    Location
    Lapeer, MI
    Posts
    30
    Rep Power
    0
    Did you ever find out what it was?

  7. #6
    TkTech's Avatar
    TkTech is offline The Crazy One
    Join Date
    Jun 2006
    Location
    Canada
    Posts
    1,412
    Blog Entries
    1
    Rep Power
    31
    It in itself is not malicious. It connects to an external server and port passed as parameters to the script and sends all of the detailed system information to that server. Then that can be used to find commmon security flaws for that os/aric

  8. #7
    psousa is offline Newbie
    Join Date
    Oct 2008
    Posts
    1
    Rep Power
    0

    Re: Hacking Perl Script

    Quote Originally Posted by falco85 View Post
    I was looking through my log files and happened by a file upload that should not have been uploaded (through a script somehow they managed to upload although they shouldn't have access). I then immediatly went to the directory the script was inserted into "/tmp" and opened the file. The first line reads #!/usr/bin/perl and even though I have used perl before I still don't entirely understand what this script does.



    I can see that it opens lynx and connects to the local machine but what does this do:

    [highlight="Perl"]
    $system= 'echo "`uname -a`";echo "`id`";/bin/sh';
    [/highlight]

    I understand echo and uname but is it calling /bin/sh?

    From this point down I do not understand. Any of this I do not really understand what it is doing:

    [highlight="Perl"]

    [/highlight]

    Can someone help me figure out what the intention of this script is?
    Same issue here. Do you have any news on this issue?

    My details:


    Hello.

    Today I found a /tmp script (/tmp/back).
    I have APF firewall and anti-DoS, secured tmp's and modsecurity2 on apache2 running gotroot rules.

    How can it is possible to write a perl file on /tmp? File has not run permitions, but is a Perl file, so I think they ran it. I found this script after someone to send mail bomb through the server (about 9000 each time).

    Server simptoms:
    several connections from my server to ftp.hosteurope.de
    several phishing emails being sent over my server

    Script code:
    Email Bazilian content:
    (...) Estamos fazendo atualizações críticas em nossos servidores, por esse motivo é necessário o recadastro de seus dados cadastrais para ter acesso a todos os serviços do Internet Banking Caixa.
    Para realizar a atualização, basta baixar o programa de atualização da Caixa que segue link abaixo. (...)
    How can server possible be compromised?

    Any help will be appreciated.

    Regards.
    Last edited by Jordan; 01-30-2009 at 06:14 AM.

  9. #8
    KevinADC is offline Programmer
    Join Date
    Jan 2007
    Posts
    125
    Rep Power
    0

    Re: Hacking Perl Script

    This is a perl forum, not a server setup or server related issues forum. The fact that it is a perl script has no bearing on how your server was compromised, it could have well been a shell script, like bash or ksh. The place to ask is on a forum that discusses the particular server you use or possibly a system administrator forum.

  10. #9
    d0m14n is offline Newbie
    Join Date
    Dec 2008
    Posts
    1
    Rep Power
    0

    Re: Hacking Perl Script

    yes he is indeed correct when we hack we use uname -a on a linux system to derive the architechture of machine in question your just lucky that person isnt good i would have made a backdoor and passed the installed apps etc kernel version to a db and compiled exploits then netcatted them to you and exploited you thank god im a white hat lol

  11. #10
    Stenna Guest

    Question Re: Hacking Perl Script

    what you think for this perl script ?
    is it working or not ?

Closed Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [HELP] convert Perl script to Bash shell script
    By Egypte in forum Linux Programming and Scripting
    Replies: 2
    Last Post: 04-24-2011, 05:37 PM
  2. Joomla! Hacking Script
    By Jordan in forum Security Tutorials
    Replies: 107
    Last Post: 04-07-2011, 03:07 PM
  3. Replies: 1
    Last Post: 02-27-2010, 11:34 PM
  4. Replies: 3
    Last Post: 02-08-2010, 09:07 AM
  5. Packet Loss Perl Script
    By Jordan in forum Tutorials
    Replies: 1
    Last Post: 04-29-2007, 10:29 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts