[Day 3] OSINT Nothing escapes detective McRed¶
Je l’ai attendu tout hier sans l’avoir, c’est donc le 4 que je me lance sur le chall du 3 ! Petit coup de coeur pour le thème d’aujourd’hui qui est de l’OSINT !
Le cours¶
Cette fois, il y a trop d’images pour les explications de l’OSINT, alors on va rester somaire :
Les google Dorks¶
inurl: Searches for a specified text in all indexed URLs. For example, inurl:hacking will fetch all URLs containing the word « hacking ».
filetype: Searches for specified file extensions. For example, filetype:pdf « hacking » will bring all pdf files containing the word « hacking ».
site: Searches all the indexed URLs for the specified domain. For example, site:tryhackme.com will bring all the indexed URLs from tryhackme.com.
cache: Get the latest cached version by the Google search engine. For example, cache:tryhackme.com.
Le noms de domaine¶
WHOIS database stores public domain information such as registrant (domain owner),
Les fuites de données¶
The robots.txt is a publicly accessible file created by the website administrator and intended for search engines to allow or disallow indexing of the website’s. Major social media and tech giants have suffered data breaches in the past. As a result, the leaked data is publicly available and, most of the time contains PII like usernames, email addresses, mobile numbers and even passwords
Des sources diverses¶
GitHub is a renowned platform that allows developers to host their code through version control. A developer can create multiple repositories and set the privacy setting as well. A common flaw by developers is that the privacy of the repository is set as public, which means anyone can access it.
Les questions du jour :¶
What is the name of the Registrar for the domain santagift.shop?¶
Question basique sur de l’OSINT : retrouver des informations sur le nom de domaine. Pour ça, on a WHOIS. Et l’on trouve très vite le nom.
whois santagift.shop
Registar : NameCheap INC
Find the website’s source code (repository) on github.com and open the file containing sensitive credentials. Can you find the flag?¶
On dispose déjà d’un jolie indice ici :
McRed, the recon master, searched various terms on GitHub to find something useful like
SantaGiftShop,SantaGift,SantaShopetc. Luckily, one of the terms worked, and he found the website’s complete source code publicly available through OSINT.
Commençons donc par le commencement : SantaGiftShop On trouve très vite ce repo. En lisant le readme, on voit que les credentials sont dans le fichier config.php. En plus de nous donner la reponse à la question suivante, on trouve également le flag !
<?php
$FLAG = '{THM_OSINT_WORKS}';
/**
* If you have arrived here, the flag value is {THM_OSINT_WORKS}
*
**/
What is the name of the file containing passwords?¶
Cf question précédente : le repo nous donne le nom du fhicher.
What is the name of the QA server associated with the website?¶
Ok, le « QA » est en faite le serveur de test. Ce n’est donc pas forcément choquant de trouver des informations pour un serveur de test (si ce dernier est hors ligne, ne contient pas de donnée etc etc etc). En descendant un peu le code du fichier config.php, on trouve donc rapidement les informations associées :
if($ENV = "QA"){
// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'SantaGiftShop' );
/** Database username */
define( 'DB_USER', 'ubuntu' );
/** Database password */
define( 'DB_PASSWORD', 'S@nta2022' );
/** Database hostname */
define( 'DB_HOST', 'qa.santagift.shop' );
/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );
/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
}
What is the DB_PASSWORD that is being reused between the QA and PROD environments?¶
Malheuresement, en plus des infos de QA, on trouve également celles de prod … Devinez quel est le mot de passe ?
if($ENV = "PROD"){
// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'SantaGiftShop' );
/** Database username */
define( 'DB_USER', 'ubuntu' );
/** Database password */
define( 'DB_PASSWORD', 'S@nta2022' );
/** Database hostname */
define( 'DB_HOST', 'santagift.shop' );
/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );
/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
}
Voilà une « room d’OSINT » pas forcément très osintée mais bon. On reste sur le 3e jour, le calendrier doit être simple encore. En espérant que ça va se corser un peu plus !