{"id":112,"date":"2025-04-14T23:31:15","date_gmt":"2025-04-14T21:31:15","guid":{"rendered":"https:\/\/fromkiddietorobot.fr\/?p=112"},"modified":"2025-04-14T23:32:30","modified_gmt":"2025-04-14T21:32:30","slug":"skynet","status":"publish","type":"post","link":"https:\/\/fromkiddietorobot.fr\/index.php\/2025\/04\/14\/skynet\/","title":{"rendered":"Skynet"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>A vulnerable Terminator themed Linux machine.<\/p>\n\n\n\n<p><a href=\"https:\/\/tryhackme.com\/room\/skynet\">https:\/\/tryhackme.com\/room\/skynet<\/a><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Phase d&#8217;\u00e9num\u00e9ration<\/h2>\n\n\n\n<p>D\u00e9couverte des services et versions pr\u00e9sents sur la machine gr\u00e2ce \u00e0 Nmap:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"944\" height=\"880\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/03\/image-46.png\" alt=\"\" class=\"wp-image-120\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/03\/image-46.png 944w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/03\/image-46-300x280.png 300w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/03\/image-46-768x716.png 768w\" sizes=\"auto, (max-width: 944px) 100vw, 944px\" \/><\/figure>\n\n\n\n<p>Par r\u00e9flexe, regardons ce que contient le serveur web :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"578\" height=\"879\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-7.png\" alt=\"\" class=\"wp-image-128\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-7.png 578w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-7-197x300.png 197w\" sizes=\"auto, (max-width: 578px) 100vw, 578px\" \/><figcaption class=\"wp-element-caption\">Rien de sp\u00e9cial n&#8217;est \u00e9voqu\u00e9 \u00e0 part le \/admin<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"479\" height=\"222\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-8.png\" alt=\"\" class=\"wp-image-129\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-8.png 479w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-8-300x139.png 300w\" sizes=\"auto, (max-width: 479px) 100vw, 479px\" \/><figcaption class=\"wp-element-caption\">Le \/admin n&#8217;est pas accessible<\/figcaption><\/figure>\n\n\n\n<p>Voyons voir si le \/squirrelmail qui contient pas mal de fichiers\/dossiers est accessible:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"393\" height=\"274\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-9.png\" alt=\"\" class=\"wp-image-130\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-9.png 393w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-9-300x209.png 300w\" sizes=\"auto, (max-width: 393px) 100vw, 393px\" \/><figcaption class=\"wp-element-caption\">Une page de connexion pour des mails<\/figcaption><\/figure>\n\n\n\n<p>Continuons d&#8217;exploiter notre retour Nmap pour voir si d&#8217;autres services sont exploitables.<\/p>\n\n\n\n<p>On voit donc aussi qu&#8217;il y a un service SMB sous Samba, qui est r\u00e9put\u00e9 vuln\u00e9rable dans les CTFs donc je regarde ce que je peux trouver en l&#8217;\u00e9num\u00e9rant.<br>Pour faire cela, je vais me servir de l&#8217;outil Enum4Linux :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"202\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-2.png\" alt=\"\" class=\"wp-image-123\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-2.png 900w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-2-300x67.png 300w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-2-768x172.png 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"843\" height=\"110\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-1.png\" alt=\"\" class=\"wp-image-122\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-1.png 843w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-1-300x39.png 300w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-1-768x100.png 768w\" sizes=\"auto, (max-width: 843px) 100vw, 843px\" \/><figcaption class=\"wp-element-caption\">On trouve l&#8217;utilisateur milesdyson<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"604\" height=\"114\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-3.png\" alt=\"\" class=\"wp-image-124\" style=\"width:610px;height:auto\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-3.png 604w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-3-300x57.png 300w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><figcaption class=\"wp-element-caption\">On voit aussi qu&#8217;un mode anonyme est disponible sur le partage de fichiers<\/figcaption><\/figure>\n\n\n\n<p>Essayons donc de nous connecter en mode anonyme pour essayer de r\u00e9cup\u00e9rer des informations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Phase d&#8217;exploitation<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"238\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-4.png\" alt=\"\" class=\"wp-image-125\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-4.png 602w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-4-300x119.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><figcaption class=\"wp-element-caption\">Connexion r\u00e9ussie, voyons voir ce que ces fichiers nous cache<\/figcaption><\/figure>\n\n\n\n<p>Nous avons pu r\u00e9cup\u00e9rer un total de 3 fichiers sur notre machine attaquante, les voici :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"349\" height=\"78\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-5.png\" alt=\"\" class=\"wp-image-126\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-5.png 349w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-5-300x67.png 300w\" sizes=\"auto, (max-width: 349px) 100vw, 349px\" \/><figcaption class=\"wp-element-caption\">Regardons ce qu&#8217;ils contiennent<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"686\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-6-1024x686.png\" alt=\"\" class=\"wp-image-127\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-6-1024x686.png 1024w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-6-300x201.png 300w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-6-768x515.png 768w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-6.png 1198w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">On a un p&#8217;tit dictionnaire, esp\u00e9rons qu&#8217;il contient le mot de passe de Miles<\/figcaption><\/figure>\n\n\n\n<p>Le premier flag de cette box sur TryHackMe est le mot de passe du compte mail de Miles, esp\u00e9rons qu&#8217;il se trouve dans cette liste de mot de passe. Et pour v\u00e9rifier cette information, nous pouvons utiliser l&#8217;outil Burp Suite afin de faire une attaque par dictionnaire sur son compte.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"958\" height=\"748\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-12.png\" alt=\"\" class=\"wp-image-134\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-12.png 958w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-12-300x234.png 300w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-12-768x600.png 768w\" sizes=\"auto, (max-width: 958px) 100vw, 958px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"711\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-13-1024x711.png\" alt=\"\" class=\"wp-image-135\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-13-1024x711.png 1024w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-13-300x208.png 300w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-13-768x533.png 768w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-13.png 1069w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Le premier mot de passe a une longueur de r\u00e9ponse diff\u00e9rente des autres mots de passe essay\u00e9s par Burp Suite donc si on la tente :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"970\" height=\"286\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-14.png\" alt=\"\" class=\"wp-image-136\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-14.png 970w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-14-300x88.png 300w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-14-768x226.png 768w\" sizes=\"auto, (max-width: 970px) 100vw, 970px\" \/><figcaption class=\"wp-element-caption\">Nous avons bien acc\u00e8s au mail!<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"947\" height=\"316\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-15.png\" alt=\"\" class=\"wp-image-137\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-15.png 947w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-15-300x100.png 300w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-15-768x256.png 768w\" sizes=\"auto, (max-width: 947px) 100vw, 947px\" \/><figcaption class=\"wp-element-caption\">Gr\u00e2ce \u00e0 \u00e7a nous avons acc\u00e8s au nouveau mdp de Miles sur le SMB<\/figcaption><\/figure>\n\n\n\n<p>Et voil\u00e0, nous avons acc\u00e8s au SMB client :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"436\" height=\"96\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-16.png\" alt=\"\" class=\"wp-image-138\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-16.png 436w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-16-300x66.png 300w\" sizes=\"auto, (max-width: 436px) 100vw, 436px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"819\" height=\"296\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-17.png\" alt=\"\" class=\"wp-image-141\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-17.png 819w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-17-300x108.png 300w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-17-768x278.png 768w\" sizes=\"auto, (max-width: 819px) 100vw, 819px\" \/><\/figure>\n\n\n\n<p>En pentest, notre but est de trouver le plus d&#8217;informations pertinentes possibles et un dossier peut nous sauter aux yeux car il a sa premi\u00e8re lettre en minuscule et aussi car il s&#8217;appelle &#8220;notes&#8221;, voyons ce qu&#8217;il contient:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"668\" height=\"776\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-18.png\" alt=\"\" class=\"wp-image-142\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-18.png 668w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-18-258x300.png 258w\" sizes=\"auto, (max-width: 668px) 100vw, 668px\" \/><\/figure>\n\n\n\n<p>Idem que pour la recherche du dossier pr\u00e9c\u00e9demment, on peut voir le fichier &#8220;important.txt&#8221;, r\u00e9cup\u00e9rons-le.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"893\" height=\"62\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-19.png\" alt=\"\" class=\"wp-image-143\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-19.png 893w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-19-300x21.png 300w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-19-768x53.png 768w\" sizes=\"auto, (max-width: 893px) 100vw, 893px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"370\" height=\"126\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-20.png\" alt=\"\" class=\"wp-image-144\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-20.png 370w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-20-300x102.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/figure>\n\n\n\n<p>Quand nous nous rendons sur la page <a href=\"http:\/\/10.10.47.254\/45kra24zxs28v3yd\/\">http:\/\/10.10.47.254\/45kra24zxs28v3yd\/<\/a>, nous retrouvons le blog personnel de Miles Dyson :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"953\" height=\"586\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-21.png\" alt=\"\" class=\"wp-image-145\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-21.png 953w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-21-300x184.png 300w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-21-768x472.png 768w\" sizes=\"auto, (max-width: 953px) 100vw, 953px\" \/><\/figure>\n\n\n\n<p>On peut essayer de r\u00e9\u00e9num\u00e9rer la page de Miles Dyson \u00e0 l&#8217;aide de la commande &#8220;dirb&#8221; et en sp\u00e9cifiant le dossier \u00e0 d\u00e9couvrir.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"716\" height=\"575\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-22.png\" alt=\"\" class=\"wp-image-146\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-22.png 716w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-22-300x241.png 300w\" sizes=\"auto, (max-width: 716px) 100vw, 716px\" \/><\/figure>\n\n\n\n<p>On voit qu&#8217;il y a un dossier &#8220;administrator&#8221; sur sa page personnelle.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"952\" height=\"569\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-23.png\" alt=\"\" class=\"wp-image-147\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-23.png 952w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-23-300x179.png 300w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-23-768x459.png 768w\" sizes=\"auto, (max-width: 952px) 100vw, 952px\" \/><\/figure>\n\n\n\n<p>On tombe sur un CMS, qui peut lui permettre d&#8217;administrer sa page, voyons si une vuln\u00e9rabilit\u00e9 est exploitable sur cette page :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"944\" height=\"160\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-24.png\" alt=\"\" class=\"wp-image-148\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-24.png 944w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-24-300x51.png 300w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-24-768x130.png 768w\" sizes=\"auto, (max-width: 944px) 100vw, 944px\" \/><figcaption class=\"wp-element-caption\">Une LFI est possible sur le CMS en question<\/figcaption><\/figure>\n\n\n\n<p>Gr\u00e2ce \u00e0 la commande searchsploit -m et le num\u00e9ro de l&#8217;exploitation nous pouvons r\u00e9cup\u00e9rer l&#8217;exploit :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"607\" height=\"182\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-25.png\" alt=\"\" class=\"wp-image-149\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-25.png 607w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-25-300x90.png 300w\" sizes=\"auto, (max-width: 607px) 100vw, 607px\" \/><\/figure>\n\n\n\n<p>Pour exploiter le site web, nous allons proc\u00e9der \u00e0 une attaque par RFI (Remote File Inclusion) comme suit :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Configuration du reverse shell PHP :<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"726\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-26-1024x726.png\" alt=\"\" class=\"wp-image-150\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-26-1024x726.png 1024w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-26-300x213.png 300w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-26-768x544.png 768w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-26-1200x850.png 1200w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-26.png 1260w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>On \u00e9tablit le serveur python qui va accueillir le reverse shell :<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"496\" height=\"100\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-27.png\" alt=\"\" class=\"wp-image-151\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-27.png 496w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-27-300x60.png 300w\" sizes=\"auto, (max-width: 496px) 100vw, 496px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>On \u00e9coute maintenant sur le port 31337 pour recevoir les informations du reverse shell :<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"244\" height=\"82\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-28.png\" alt=\"\" class=\"wp-image-152\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Exploitation de la RFI :<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"963\" height=\"78\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-30.png\" alt=\"\" class=\"wp-image-154\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-30.png 963w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-30-300x24.png 300w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-30-768x62.png 768w\" sizes=\"auto, (max-width: 963px) 100vw, 963px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"649\" height=\"200\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-31.png\" alt=\"\" class=\"wp-image-155\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-31.png 649w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-31-300x92.png 300w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" \/><figcaption class=\"wp-element-caption\">Gr\u00e2ce \u00e0 cela, nous r\u00e9cup\u00e9rons un acc\u00e8s sur la machine.<\/figcaption><\/figure>\n\n\n\n<p>Comme d&#8217;habitude, lorsque nous arrivons sur une machine, j&#8217;aime bien appliquer la proc\u00e9dure pour avoir un full TTY de HackTricks :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python3 -c 'import pty; pty.spawn(\"\/bin\/bash\")'<br>(inside the nc session) CTRL+Z;stty raw -echo; fg; ls; export SHELL=\/bin\/bash; export TERM=screen; stty rows 38 columns 116; reset;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"647\" height=\"365\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-32.png\" alt=\"\" class=\"wp-image-156\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-32.png 647w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-32-300x169.png 300w\" sizes=\"auto, (max-width: 647px) 100vw, 647px\" \/><\/figure>\n\n\n\n<p>Nous pouvons maintenant exploiter la machine pour faire une \u00e9l\u00e9vation de privil\u00e8ges, mais avant cela, r\u00e9cup\u00e9rons le flag user :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"553\" height=\"256\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-33.png\" alt=\"\" class=\"wp-image-157\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-33.png 553w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-33-300x139.png 300w\" sizes=\"auto, (max-width: 553px) 100vw, 553px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">El\u00e9vation de privil\u00e8ges<\/h2>\n\n\n\n<p>Pour avoir une \u00e9l\u00e9vation de privil\u00e8ges, nous devons analyser les failles de la machine exploit\u00e9e et pour cela, rien de mieux que l&#8217;utilisation du script linpeas.sh<\/p>\n\n\n\n<p>Nous allons le r\u00e9cup\u00e9rer sur la machine cible de la m\u00eame mani\u00e8re que nous avons exploit\u00e9 le reverse shell sur le serveur web \u00e0 savoir avec un server HTTP python :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"437\" height=\"279\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-34.png\" alt=\"\" class=\"wp-image-158\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-34.png 437w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-34-300x192.png 300w\" sizes=\"auto, (max-width: 437px) 100vw, 437px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"487\" height=\"64\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-35.png\" alt=\"\" class=\"wp-image-159\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-35.png 487w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-35-300x39.png 300w\" sizes=\"auto, (max-width: 487px) 100vw, 487px\" \/><\/figure>\n\n\n\n<p>Pour pouvoir ensuite copier le script sur le serveur, la plupart du temps nous avons les droits sur le dossier \/tmp, essayons :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"613\" height=\"193\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-36.png\" alt=\"\" class=\"wp-image-160\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-36.png 613w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-36-300x94.png 300w\" sizes=\"auto, (max-width: 613px) 100vw, 613px\" \/><\/figure>\n\n\n\n<p>Nous avons r\u00e9cup\u00e9r\u00e9 le script, ex\u00e9cutons-le :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"334\" height=\"42\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-37.png\" alt=\"\" class=\"wp-image-161\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-37.png 334w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-37-300x38.png 300w\" sizes=\"auto, (max-width: 334px) 100vw, 334px\" \/><\/figure>\n\n\n\n<p>Tiens donc un job crontab ex\u00e9cut\u00e9 par l&#8217;utilisateur root, pouvons nous le modifier pour l&#8217;exploiter?<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"828\" height=\"122\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-38.png\" alt=\"\" class=\"wp-image-162\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-38.png 828w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-38-300x44.png 300w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-38-768x113.png 768w\" sizes=\"auto, (max-width: 828px) 100vw, 828px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"675\" height=\"464\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-39.png\" alt=\"\" class=\"wp-image-163\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-39.png 675w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-39-300x206.png 300w\" sizes=\"auto, (max-width: 675px) 100vw, 675px\" \/><figcaption class=\"wp-element-caption\">Nous sommes en readonly, impossible de le modifier pour en profiter. <\/figcaption><\/figure>\n\n\n\n<p>Bien \u00e9videmment, en tant que &#8220;hacker&#8221; nous allons trouver une mani\u00e8re d\u00e9tourn\u00e9e pour en profiter (c&#8217;est la d\u00e9finition m\u00eame du hacking) puisque dans la commande, celle-ci \u00e9tablit un environnement bash avec les droits root, ce qui implique un acc\u00e8s en root si nous arrivons \u00e0 l&#8217;exploiter. Comme la t\u00e2che s&#8217;ex\u00e9cute toutes les minutes, servons-en nous pour r\u00e9cup\u00e9rer les acc\u00e8s.<\/p>\n\n\n\n<p>Pour y parvenir nous allons devoir jouer avec le wildcard du script  avec les commandes comme suit :<\/p>\n\n\n\n<p>Dans le dossier &#8220;\/home\/milesdyson\/backups&#8221; :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo -e '#!\/bin\/bash\\nchmod +s \/bin\/bash' &gt; \/var\/www\/html\/root_shell.sh<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>touch \"\/var\/www\/html\/--checkpoint-action=exec=sh root_shell.sh\"\n\ntouch \"\/var\/www\/html\/--checkpoint=1\"<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/bin\/bash -p<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"495\" height=\"107\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-40.png\" alt=\"\" class=\"wp-image-166\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-40.png 495w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-40-300x65.png 300w\" sizes=\"auto, (max-width: 495px) 100vw, 495px\" \/><\/figure>\n\n\n\n<p>On retrouve bien le # qui nous indique que nous avons r\u00e9cup\u00e9rer les privil\u00e8ges sur la machine, ce que nous pouvons v\u00e9rifier avec la commande &#8220;id&#8221; ou &#8220;whoami&#8221; :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"93\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-41.png\" alt=\"\" class=\"wp-image-167\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-41.png 707w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-41-300x39.png 300w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><figcaption class=\"wp-element-caption\">Nous sommes toujours sur le compte www-data mais dans un environnement root<\/figcaption><\/figure>\n\n\n\n<p>Nous pouvons finalement r\u00e9cup\u00e9rer le dernier flag, \u00e0 savoir le compte root qui nous permet d&#8217;affirmer que nous avons les pleins pouvoirs sur la machine :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"271\" height=\"114\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-42.png\" alt=\"\" class=\"wp-image-168\"\/><\/figure>\n\n\n\n<p>Et voil\u00e0, la box est termin\u00e9e!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"649\" height=\"290\" src=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-43.png\" alt=\"\" class=\"wp-image-170\" srcset=\"https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-43.png 649w, https:\/\/fromkiddietorobot.fr\/wp-content\/uploads\/2025\/04\/image-43-300x134.png 300w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>A vulnerable Terminator themed Linux machine.<\/p>\n","protected":false},"author":3,"featured_media":113,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-112","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ctf"],"_links":{"self":[{"href":"https:\/\/fromkiddietorobot.fr\/index.php\/wp-json\/wp\/v2\/posts\/112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fromkiddietorobot.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fromkiddietorobot.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fromkiddietorobot.fr\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/fromkiddietorobot.fr\/index.php\/wp-json\/wp\/v2\/comments?post=112"}],"version-history":[{"count":8,"href":"https:\/\/fromkiddietorobot.fr\/index.php\/wp-json\/wp\/v2\/posts\/112\/revisions"}],"predecessor-version":[{"id":171,"href":"https:\/\/fromkiddietorobot.fr\/index.php\/wp-json\/wp\/v2\/posts\/112\/revisions\/171"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fromkiddietorobot.fr\/index.php\/wp-json\/wp\/v2\/media\/113"}],"wp:attachment":[{"href":"https:\/\/fromkiddietorobot.fr\/index.php\/wp-json\/wp\/v2\/media?parent=112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fromkiddietorobot.fr\/index.php\/wp-json\/wp\/v2\/categories?post=112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fromkiddietorobot.fr\/index.php\/wp-json\/wp\/v2\/tags?post=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}