The find / Command – Write-up – TryHackMe

Cette room de TryHackMe est consacrée à l’utilisation de la commande find. Comme indiquez en toute 1ier ligne : “When you know exactly what you’re looking for, you don’t need to search for it; you just have to find it. ”  Lorsque vous savez exactement ce que vous recherchez, vous n’avez pas besoin de le rechercher ; Tu dois juste le trouver. 

Vous pouvez trouver cette room à cette adresse.

Ce didacticiel vous aidera à comprendre comment utiliser efficacement la commande find dans un contexte CTF. Il est écrit de manière à ce que vous n’ayez pas à vous référer à la page de manuel pour le compléter, bien que je recommande la page de manuel pour une lecture plus approfondie.

 

Task 1 Start finding

Pas de tâche particulière à effectuer…

Task 2 Be more specific

  • Find all files whose name ends with “.xml”

find / -type f -name “*.xml”

  • Find all files in the /home directory (recursive) whose name is “user.txt” (case insensitive)

find /home -type f -iname “user.txt”

  • Find all directories whose name contains the word “exploits”

find / -type f -name “*exploits*”

Task 3 Know exactly what you're looking for

  • Find all files owned by the user “kittycat”

find / -type f -user “kittycat”

  • Find all files that are exactly 150 bytes in size

find / -type f -size 150 b

  • Find all files in the /home directory (recursive) with size less than 2 KiB’s and extension “.txt”

find /home -type f -size 2 kb -name “*.txt”

Pour les 4 questions suivantes, voici un lien pour calculer automatiquement les permissions, permissions-calculator

  • Find all files that are exactly readable and writeable by the owner, and readable by everyone else (use octal format)

find / -type f -perm 644

  • Find all files that are only readable by anyone (use octal format)

find / -type f -perm /444

  • Find all files with write permission for the group “others”, regardless of any other permissions, with extension “.sh” (use symbolic format)

find / -type f -perm -o=w -name “*.sh”

  • Find all files with write permission for the group “others”, regardless of any other permissions, with extension “.sh” (use symbolic format)

find /usr/bin -type f -user root -perm -u=s

  • Find all files that were not accessed in the last 10 days with extension “.png”

find / -type f -time +10 -name “*.png”

  • Find all files in the /usr/bin directory (recursive) that have been modified within the last 2 hours

find /usr/bin -type f -mmin -120

 
0 0 votes
Évaluation de l'article
S’abonner
Notifier de
0 Commentaires
Inline Feedbacks
View all comments