benslimane Sofiane
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Rapport d'audit #### Résultat Nmap Starting Nmap 7.92 ( https://nmap.org ) at 2023-01-11 09:33 CET Stats: 0:01:41 elapsed; 0 hosts completed (1 up), 1 undergoing Service Scan Service scan Timing: About 96.97% done; ETC: 09:35 (0:00:03 remaining) Nmap scan report for www.spc2000.com (192.168.3.254) Host is up (0.0039s latency). Not shown: 65502 closed tcp ports (conn-refused) PORT STATE SERVICE VERSION 21/tcp open ftp vsftpd 2.3.4 |_ftp-anon: Anonymous FTP login allowed (FTP code 230) | ftp-syst: | STAT: | FTP server status: | Connected to 192.168.3.128 | Logged in as ftp | TYPE: ASCII | No session bandwidth limit | Session timeout in seconds is 300 | Control connection is plain text | Data connections will be plain text | vsFTPd 2.3.4 - secure, fast, stable |_End of status 22/tcp open ssh OpenSSH 4.7p1 Debian 8ubuntu1 (protocol 2.0) | ssh-hostkey: | 1024 60:0f:cf:e1:c0:5f:6a:74:d6:90:24:fa:c4:d5:6c:cd (DSA) |_ 2048 56:56:24:0f:21:1d:de\:a7:2b:ae:61:b1:24:3d:e8:f3 (RSA) 23/tcp open telnet Linux telnetd 25/tcp open smtp Postfix smtpd |_ssl-date: 2023-01-11T09:36:48+00:00; +59m56s from scanner time. |_smtp-commands: metasploitable.localdomain, PIPELINING, SIZE 10240000, VRFY, ETRN, STARTTLS, ENHANCEDSTATUSCODES, 8BITMIME, DSN | ssl-cert: Subject: commonName=ubuntu804-base.localdomain/organizationName=OCOSA/stateOrProvinceName=There is no such thing outside US/countryName=XX | Not valid before: 2010-03-17T14:07:45 |_Not valid after: 2010-04-16T14:07:45 | sslv2: | SSLv2 supported | ciphers: | SSL2_RC4_128_WITH_MD5 | SSL2_RC2_128_CBC_WITH_MD5 | SSL2_DES_192_EDE3_CBC_WITH_MD5 | SSL2_DES_64_CBC_WITH_MD5 | SSL2_RC2_128_CBC_EXPORT40_WITH_MD5 |_ SSL2_RC4_128_EXPORT40_WITH_MD5 53/tcp open domain ISC BIND 9.4.2 | dns-nsid: |_ bind.version: 9.4.2 80/tcp open http Apache httpd 2.2.8 ((Ubuntu)) |_http-server-header: Apache/2.2.8 (Ubuntu) |_http-title: SPC2000 111/tcp open rpcbind 2 (RPC #100000) | rpcinfo: | program version port/proto service | 100000 2 111/tcp rpcbind | 100000 2 111/udp rpcbind | 100003 2,3,4 2049/tcp nfs | 100003 2,3,4 2049/udp nfs | 100005 1,2,3 34791/udp mountd | 100005 1,2,3 44551/tcp mountd | 100021 1,3,4 44364/udp nlockmgr | 100021 1,3,4 49870/tcp nlockmgr | 100024 1 42554/tcp status |_ 100024 1 53224/udp status 139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP) 445/tcp open netbios-ssn Samba smbd 3.0.20-Debian (workgroup: WORKGROUP) 512/tcp open exec netkit-rsh rexecd 513/tcp open login OpenBSD or Solaris rlogind 514/tcp open shell Netkit rshd 1099/tcp open java-rmi GNU Classpath grmiregistry 2049/tcp open nfs 2-4 (RPC #100003) 2121/tcp open ftp ProFTPD 1.3.1 3306/tcp open mysql MySQL 5.0.51a-3ubuntu5 | mysql-info: | Protocol: 10 | Version: 5.0.51a-3ubuntu5 | Thread ID: 63 | Capabilities flags: 41516 | Some Capabilities: Support41Auth, SupportsTransactions, ConnectWithDatabase, Speaks41ProtocolNew, SupportsCompression, LongColumnFlag | Status: Autocommit |_ Salt: xpHX\`[)X_ScxTw|)UPqi 3632/tcp open distccd distccd v1 ((GNU) 4.2.4 (Ubuntu 4.2.4-1ubuntu4)) 5432/tcp open postgresql PostgreSQL DB 8.3.0 - 8.3.7 |_ssl-date: 2023-01-11T09:36:48+00:00; +59m56s from scanner time. | ssl-cert: Subject: commonName=ubuntu804-base.localdomain/organizationName=OCOSA/stateOrProvinceName=There is no such thing outside US/countryName=XX | Not valid before: 2010-03-17T14:07:45 |_Not valid after: 2010-04-16T14:07:45 5900/tcp open vnc VNC (protocol 3.3) | vnc-info: | Protocol version: 3.3 | Security types: |_ VNC Authentication (2) 6000/tcp open X11 (access denied) 6667/tcp open irc UnrealIRCd 6697/tcp open irc UnrealIRCd 8009/tcp open ajp13 Apache Jserv (Protocol v1.3) |_ajp-methods: Failed to get a valid response for the OPTION request 8080/tcp open http Apache Tomcat/Coyote JSP engine 1.1 |_http-open-proxy: Proxy might be redirecting requests |_http-server-header: Apache-Coyote/1.1 |_http-title: Apache Tomcat/8.0.28 |_http-favicon: Apache Tomcat 8787/tcp open drb Ruby DRb RMI (Ruby 1.8; path /usr/lib/ruby/1.8/drb) 10001/tcp open http WSGIServer 0.1 (Python 2.7.13) |_http-title: Site doesn't have a title (text/html; charset=UTF-8). |_http-server-header: WSGIServer/0.1 Python/2.7.13 10002/tcp open http WSGIServer 0.1 (Python 2.7.13) |_http-title: Site doesn't have a title (text/html; charset=UTF-8). |_http-server-header: WSGIServer/0.1 Python/2.7.13 10003/tcp open http WSGIServer 0.1 (Python 2.7.13) |_http-title: Site doesn't have a title (text/html; charset=UTF-8). |_http-server-header: WSGIServer/0.1 Python/2.7.13 10004/tcp open http WSGIServer 0.1 (Python 2.7.13) |_http-title: Site doesn't have a title (text/html; charset=UTF-8). |_http-server-header: WSGIServer/0.1 Python/2.7.13 40103/tcp open java-rmi GNU Classpath grmiregistry 42554/tcp open status 1 (RPC #100024) 44551/tcp open mountd 1-3 (RPC #100005) 49870/tcp open nlockmgr 1-4 (RPC #100021) Service Info: Hosts: metasploitable.localdomain, irc.Metasploitable.LAN; OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel Host script results: |_clock-skew: mean: 2h14m55s, deviation: 2h30m00s, median: 59m55s |_nbstat: NetBIOS name: METASPLOITABLE, NetBIOS user: <unknown>, NetBIOS MAC: <unknown> (unknown) | smb-security-mode: | account_used: <blank> | authentication_level: user | challenge_response: supported |_ message_signing: disabled (dangerous, but default) | smb-os-discovery: | OS: Unix (Samba 3.0.20-Debian) | Computer name: metasploitable | NetBIOS computer name: | Domain name: localdomain | FQDN: metasploitable.localdomain |_ System time: 2023-01-11T04:36:12-05:00 |_smb2-time: Protocol negotiation failed (SMB2) Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 176.15 seconds ### Vulns ##### Vuln 001 - Partage NFS non protégé Catégorie : Configuration Description : Le protocole Network File System (NFS) permet de partager un système de fichier sur le réseau. Ce protocole est ici vulnérable. Observations : Ici, le protocole permet, sans authentification, de monter le système de fichier entier sur notre machine et ainsi d'accéder à tous les fichiers dont les permissions le permettent. Cela permet de récupérer des informations si celles-ci ne sont pas protégées par des permissions spéciales. Pour cela, nous utilisons les commandes suivantes : ```shell= mkdir /mnt/audit sudo mount -t nfs 192.168.3.254:/ /mnt/audit ``` On peut voir que le système de fichier est bien monté. ![](https://i.imgur.com/M079U2t.png) Et que l'on peut accéder à certains fichiers. ![](https://i.imgur.com/ZebLqQE.png) Recommandation : Il est recommandé d'utiliser la version 4 du protocole NFS. Cette version oblige l'utilisation d'une authentification utilisant Kerberos. Si impossible, une il est fortement recommandé d'utiliser au minimum la version 3 et d'activer l'authentification des machines clientes. De plus il est important de protéger avec les permissions rwxr----- les fichiers voire rwx------ pour les fichiers confidentiels. CVSS 3.0 Score : 6.5 Medium Vecteur CVSS : CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N ![](https://i.imgur.com/uW5URFb.png) ##### Vuln 002 - Protocole SMB vulnérable Catégore : Configuration Description : Le protocole SMB est vulnérable à une attaque permettant de passer root (CVE-2007-2447). Observations : Après l'étape de reconnaissance, nous avons pu remarquer que la version de SMB utilisée, 3.0.20, était vulnérable à une attaque portant le nom de "usermap script". Cette vulnérabilité permet de passer root sur la machine. Nous utilisons donc Metasploit en sélectionnant le script exploitant la vulnérabilité. Nous choisissons les IP attaquées et recevant le reverse shell. ![](https://i.imgur.com/JkxPwXf.png) On voit alors que nous récupérons un accès root. Recommandation : Il est fortement recommandé de mettre à jour le protocole SMB à la dernière version. Score CVSS 3.0 : 9.1 Critical Vecteur CVSS : CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N ##### Vuln 003 - Mots de passe trop faibles Catégore : Configuration Description : Les mots de passe des différents comptes sont des mots de passes par défaut ou très faible. Observations : Après avoir récupéré un root avec la Vuln #002, nous avons pu accéder au fichier /etc/shadow. Nous avons donc souhaité vérifier la force des mots de passe. Pour cela nous avons cracké le fichier shadow pour obtenir le résultat suivant. ![](https://i.imgur.com/aFv8yUP.png) On remarque que les mots de passes sont soit les même que le nom d'utilisateur soit très faible et trouvable par une attaque bruteforce rapidement. Recommandation : Il est fortement recommandé de remplacer tous les mots de passes par des nouveaux respectant les recommandations de l'ANSSI. CVSS 3.0 Score : 8.2 High Vecteur CVSS : CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N ##### Vuln 004 - Droits sudo mal gérés Catégore : Configuration Description : Une mauvaise gestion des droits sudo à pu être relevée, permettant à un compte compromis de pouvoir exécuter des actions avec des droits privilégiès. Observations : Après avoir récupéré un root avec la Vuln #002, nous avons pu accéder au fichier /etc/sudoers. Nous avons alors pu observer que le compte spc2000 avait des droits sudo partout sans avoir à rentrer son mot de passe. ![](https://i.imgur.com/uFvxrzC.png) Recommandation : Il est fortement recommandé de ne pas laisser des comptes comportant des droits sudo sans être non authentifié. Pour cela, remplacer NOPASSWD:ALL par ALL si le compte doit garder tous ces droits sudo. Il est préférable que le compte n'ai des droits sudo uniquement sur les services et fichiers dont il a besoin. CVSS 3.0 Score : 7.1 High Vecteur CVSS : CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N ##### Vuln 05 CVSS 3.1 : 9.8 ![](https://i.imgur.com/ztCWIt9.png) ##### Vuln 06 - Configuration dangereuse du serveur VNC Le mot de passe configuré pour le serveur VNC sur le port 5900 est trop faible. Un attaquant ayant accès au réseau peut donc facilement obtenir les informations d'authentification grâce à une attaque par dictionnaire, et ainsi se connecter à distance sur la machine. ![](https://i.imgur.com/nmaLjEG.png) De plus, à l'ouverture de session à l'aide d'un outil de bureau à distance, les droits root nous sont gentillement accordés. CVSS 3.0 Score : 10 ![](https://i.imgur.com/QeTVrO7.png) ##### Vuln 07 - Faiblesse dans le service Distributed Ruby La version du service ruby DRB 1.8 présente une vulnérabilité dans la gestion des appels systèmes (SYSCALL) permettant à un attaquant d'envoyer ses propres SYSCALLS et ainsi d'obtenir un contrôle total sur la machine. Cette vulnérabilité est recensée sous CVE-2011-5330 avec un score CVSS 3.0 de 9.8. Un module Metasploit est disponible. Il suffit simplement de renseigner l'adresse IP de la machine cible et de choisir son payload : ![](https://i.imgur.com/z7qYb2m.png) ![](https://i.imgur.com/wj4JnNI.png) On note également que le service est mal configuré puisqu'il a été lancé avec l'user root. Recommandation : Mettre à jour la version DRB (dernière version 2.7.1) ##### Vuln 10 ![](https://i.imgur.com/uUBer0W.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully