TryHackMe GAMING SERVER - LXD Privilege Escalation

Поділитися
Вставка
  • Опубліковано 12 січ 2025

КОМЕНТАРІ • 235

  • @bruh_5555
    @bruh_5555 4 роки тому +500

    John Hammond cracks John user's password with John the ripper

    • @Recon_Racing
      @Recon_Racing 4 роки тому +3

      While sitting on the John eating Johnny cakes

    • @harshbakori
      @harshbakori 4 роки тому +1

      sounds like he forget his gmail password and trying to hack in lol

  • @softicecreamer
    @softicecreamer 4 роки тому +234

    Plot twist: John Hammond secretly developed John the ripper solely for cracking into the John user

    • @atanki5682
      @atanki5682 4 роки тому +5

      John inception

    • @moneyworks4375
      @moneyworks4375 3 роки тому +1

      @@atanki5682
      johnception

    • @tannisk
      @tannisk 2 роки тому

      He also do singing l love his song perfect

  • @Vixikats
    @Vixikats 3 роки тому +34

    Quickly growing addicted to this channel because the unscripted "fumbling" is exactly what a normal dev would have to do to fix their own little mistakes. And it's those tiny, "What did I forget?" Details that novices are going to be tripping over constantly.
    The fun part is watching your thought process unfold while you perform these tasks and help introduce us to various helpful tools and commands that we may use in our own explorations.

    • @simeondermaats
      @simeondermaats 3 роки тому +1

      Of the six thousand languages on earth, you chose to speak Facts

  • @abisrug4898
    @abisrug4898 4 роки тому +161

    need more of this fumbling.......fumbling makes it incredibly interesting

    • @padaloni
      @padaloni 4 роки тому +13

      totally agree. it's the fumbly bits that I enjoy. mistakes are where the learning is at.

    • @clemsonfan53089
      @clemsonfan53089 4 роки тому +2

      Yes! The fumbling makes it real life and shows how easy mistakes are. It's like bloopers, love it.

  • @l0pher
    @l0pher 4 роки тому +64

    Hi John, great vid as always!!
    How about doing a blind room say once a month, but do it live. I'm sure a lot of people would enjoy that. I know I would.
    Keep up the good work!

  • @uniquechannelnames
    @uniquechannelnames 3 роки тому +1

    These videos are worth like 100 tutorials I'm not kidding. The thinking process, seeing concepts that one may need to learn, explaining what you're thinking, and just seeing this type of thing in action. Soo helpful
    Privilege escalation has always been a big sore spot for me.

  • @bluesquare23
    @bluesquare23 4 роки тому +7

    I don't know how to do a quarter of what you did in this video but I'm comforted by the fact that you run into the same hiccups as me. Like oh yeah there's dollar signs, or oh duh forgot a slash.

    • @jadesanford2857
      @jadesanford2857 4 роки тому

      thats just the linux (and friends) experience in general

  • @jd-raymaker
    @jd-raymaker 4 роки тому +31

    That troubleshooting was the most interesting I've seen! Here's a *boop* from me

  • @CriPPle358
    @CriPPle358 4 роки тому +58

    You can disable bash expansion with cat by adding single quotes around the first EOF rather than going through and escaping everything. i.e. cat

    • @_JohnHammond
      @_JohnHammond  4 роки тому +18

      Ooooh, that's a good call! That would do the trick too. Thanks!

    • @svampebob007
      @svampebob007 4 роки тому

      @U X I hope to god that my website doesn't do that
      I got some servers open to the web, and I know a friend of mine is really paranoid about leaving open ports and what not.
      But the more I learn about different ways people exploit and the more I get into the security aspect, the more I get confident about my practice.
      Though one thing I learned from this is the cron job part.
      I got two cron job that could give a hint as so what's going on the network, so I might need to check if there's some thing that a non root user might be able to see.
      *edit: looking at my crontab, nothing seems visible unless you're root :D
      I'm really relying on not having any major security issues based on the fundemental programs, rather then trying to implement too much on either security though obscurity, or sticking my head down the sand and hoping nobody notices me.

    • @cdellio
      @cdellio 4 роки тому

      @@svampebob007 I've thought about setting up my own home-server with the same approach: keep things simple. Security by utilizing only the most simple, secure methods. nothing more or less.

    • @benstech726
      @benstech726 3 роки тому

      @@cdellio just chipping in to point out that hosting on a free low resource cloud alternative would be much more recommended.

  • @SebPineda
    @SebPineda 4 роки тому +88

    Lots of Johns in this one haha

  • @frollard
    @frollard 4 роки тому +3

    Absolutely agreed that it is helpful to see you run into the stumbling blocks. There's nothing worse than following a tutorial for the first time and smashing headlong into some syntax error or in this case escaped special characters. Thanks for sharing.

  • @uimstar5254
    @uimstar5254 4 роки тому +2

    Hey John, loving your content. I really enjoy how you explain and try different methods to gain privilege access, like changing the etc/passwd through the share drive in your container. Even if you struggle a little bit doing that, it really helps us understand the process and iteration you/we can go through while doing that. Keep up the good work!

  • @th3hunt3r85
    @th3hunt3r85 4 роки тому +1

    Thanks, it is fun watching you doing all these cool stuff, plz keep the good work coming

  • @52.yusrilihsanadinatanegar79
    @52.yusrilihsanadinatanegar79 4 роки тому +4

    I love the fact that John checks out funny/unrelated image/video files. 👍

  • @chrisbey8647
    @chrisbey8647 4 роки тому

    You and ippsec are very good learning resources. Thank you for taking your time to post these videos.

  • @JT-cm3ff
    @JT-cm3ff 4 роки тому +4

    Not sure if I should get depressed or motivated seeing how awesome John is at this thing. Definitely impressed though.

  • @kartibok001
    @kartibok001 4 роки тому

    Great video. Was waiting for the writeups as I couldn't escalate for the life of me!! Learn something new everytime!!

  • @krisdoe
    @krisdoe 4 роки тому

    Great video John. I learned some new things which were not so obvious to me previously. By the way, LXC/LXD and Docker stuff run most of the time as daemons - which means once you are in the group with regular user you are free to escalate privileges. This is a known flaw - at least in Docker world. Nowadays Docker could be run in rootless mode to avoid such situations. RHEL is doing the same with Podman if I am not wrong.

  • @HomelessDeamon
    @HomelessDeamon 4 роки тому

    keep up man i, you are doing great work educating the new to the domain, in a more fun and friendly way, which makes learning easy....massive big thanks to you J.Hammond

  • @glen_nz
    @glen_nz 4 роки тому

    On the topic of fumbling and figuring out what you've done wrong....this is the stuff that courses don't show you. In some ways, that problem solving is some of the most important parts of the video. Any idiot can make a "perfect" video. Only someone who knows what they're doing can make a "less than perfect video" and fix problems encountered during it - adding to the value and standing out as more than just a walkthrough. Great job.

  • @itsobj5013
    @itsobj5013 4 роки тому +2

    watching you move through this so quickly n seamlessly just amazes me lol

  • @RomanAlbert-f9u
    @RomanAlbert-f9u 4 роки тому

    Woah Great video! This looks like fun.
    Quick note, no need to put slashes before dollar signs, you could just quote the 'EOF' (then bash interprets the text inside as pure string, not evaluating vars:D)
    Great video, keep it up!

  • @lucha6262
    @lucha6262 4 роки тому +1

    You’re videos are awesome John!

  • @androidenthusiast2806
    @androidenthusiast2806 2 роки тому

    No matter who else does the show, we always love to see John Hammond doing these tutorials.

  • @ITachi_11.11
    @ITachi_11.11 4 роки тому +1

    John the legend! Keep going man... I'm learning a lot of stuff from you as I'm sure everyone else does. You are truly helping and inspiring. Thank you.

  • @satyamvirat3489
    @satyamvirat3489 4 роки тому +2

    That was actually fun to watch. Quite educative for learning ❤️😂

  • @kr4k3nn
    @kr4k3nn 4 роки тому +1

    Great work sir...Thank you so much for making videos.

  • @cscogin22
    @cscogin22 4 роки тому +8

    A socks proxy video would be fun to watch IMO, I was just lazy and scp'd it over to the box from my attacker platform

  • @rakeshbabumulugu7517
    @rakeshbabumulugu7517 4 роки тому

    Great work John.! 😇 learning Alot of stuff as a newbie through your way of approach.! You show us on how to think and compromise a machine.! 🙏

  • @aljazmedic375
    @aljazmedic375 4 роки тому +1

    Legend.
    Thanks for a great vid 👍

  • @suvidsinghal1365
    @suvidsinghal1365 4 роки тому +91

    Hey John I am interested in the socks proxy video ;)

  • @siddharthjohri2935
    @siddharthjohri2935 4 роки тому +1

    Another good video. You rock john.

  • @RocketLR
    @RocketLR 4 роки тому

    I love this format. Its fast and straightforward. No "uhhms" or "eehhms" while over explaining.
    Other people stop at every step single step. "then i paste this text into here.... I will use CTRL... SHIFT... V... Then we ehhh need to eeeh saaaaaaaaave with ctrl + Oooooo.. No wait my bad, this is vim... So wee go and press esc, just to be suuuuure.. eeh... btw i prefer vim because jada jada jada."
    I spent to much time on this comment already but I have been bugged by how slow people tend to be...

  • @yossig7316
    @yossig7316 4 роки тому

    Thank you John for going the extra mile to show teach us !!

  • @hellomistershifty
    @hellomistershifty 3 роки тому

    As a fellow John, I can say this is a good video

  • @website8362
    @website8362 4 роки тому +1

    Love seeing the TryHackMe vids 👾

    • @website8362
      @website8362 4 роки тому

      and watching the reworks when things go wrong 😂 #real-life

  • @sportcodfb
    @sportcodfb 3 роки тому

    I loved the vid John, i was thinking that perhaps for changing the users passowrd you could've chrooted into the root mount, anyways the vid was hella fun :)

  • @sentinalprime8838
    @sentinalprime8838 4 роки тому

    John JOnhned ,it nice video. For me always your videos are one way stop for relaxing amazing john world needs great people like you to share knowledge. Lots of respect man !!!!!!!!

  • @Child0ne
    @Child0ne 2 роки тому

    I’ve learned more from John Hammond than I think 12 years of schooling

  • @TheH2OWeb
    @TheH2OWeb 4 роки тому

    Thanks John ! Always fun and interesting !

  • @ARZ10198
    @ARZ10198 4 роки тому +2

    Just did this box yesterday , john your amazing < 3

  • @eclipsehunter22
    @eclipsehunter22 4 роки тому +16

    Yes do the socket video!

  • @ddlsmurf
    @ddlsmurf 4 роки тому

    you can just cat > file, paste, the ctrl+d (which sends an EOF) . You will then write exactly what you pasted. The heredoc as you say is interpreted by bash, whereas if you effectively < stdin , which is what cat does, cat is reading not bash. Also checkout alt-.

  • @mumugs
    @mumugs 4 роки тому

    I subscribed just because you had the problem with root password and nailed it.

  • @R4yan-
    @R4yan- 4 роки тому +2

    whew i can't believe you just saw my writeup xD at 33:09

  • @dersg1freak
    @dersg1freak 2 роки тому

    My favourite way to get stuff into a file is cat > file. It never goes wrong. Ctrl+C to finish

  • @abdosama
    @abdosama 4 роки тому +1

    Let’s go with the funneling internet to the box idea, it would be very interesting 🧐

  • @mjuhasz
    @mjuhasz 4 роки тому

    Best troll in each TryHackMe video are those README files :D

  • @ajiththiyar7609
    @ajiththiyar7609 4 роки тому +1

    Bro your content is da best

  • @veryInteresting_
    @veryInteresting_ 4 роки тому

    at 25:07 why not chroot to /mnt/root and run passwd as root?

  • @MartinMllerSkarbiniksPedersen
    @MartinMllerSkarbiniksPedersen 4 роки тому +19

    Just quote the EOF like cat

    • @_JohnHammond
      @_JohnHammond  4 роки тому +6

      Ooooh, that's a good call! That would do the trick too. Thanks!

    • @svampebob007
      @svampebob007 4 роки тому +1

      I had a script that busted my balls over this!
      I'll try to keep it in mind next time I creat a clusterfuc.. a script :)

    • @oh-lives
      @oh-lives 4 роки тому

      Another solution that IMO is simpler:
      cat > /mnt/root/etc/passwd
      Paste and then hit

  • @hewfrebie2597
    @hewfrebie2597 4 роки тому +1

    I would like to see it using via socks proxy for learning experience so why not! Since it's a good idea and that's why I subscribed your channel so I understand more about proxychains.

  • @matiasm.3124
    @matiasm.3124 4 роки тому

    Nice channel .. sometimes he complicates things .. but it's very nice explained.

  • @aalekhmotani3877
    @aalekhmotani3877 2 роки тому

    Without the video, John, I would only have known how to obtain the root flag, Thanks a lot.

  • @originalkhawk
    @originalkhawk 3 роки тому

    season/year is a common result from making users change their password every x months,
    forcing users to come up with a unique password every couple of months is a bad practice and doesn't make anything more secure (unless you have a data breach every couple months spilling all passwords used, but at that point you have bigger issues)

  • @jose007108
    @jose007108 2 роки тому

    this videos rock! keep it up man ;D

  • @nishantsingh5341
    @nishantsingh5341 4 роки тому

    32:00 The Hollywood hacker when he disables the security nanoseconds before timer runs out

  • @sebastiantillmann1669
    @sebastiantillmann1669 4 роки тому +7

    When you can ssh into the box why don’t you just scp Linpeas and the container image?

    • @mrhusi
      @mrhusi 4 роки тому

      my thoughts

    • @Sfhgscvg
      @Sfhgscvg 4 роки тому +1

      Plain http might be faster? It's a bit more user friendly as you don't need to authenticate, then again with an ssh key it shouldn't be an issue. However the key is pass protected so unless the password is stored in a keyring you would have to bother to type the password.
      It all comes down to personal preference.

    • @svampebob007
      @svampebob007 4 роки тому

      @@Sfhgscvg you could also change the password of that key since you now know the ssh passkey:
      -------------------------------------------
      ssh-keygen -p -f sshkeyfile
      -------------------------------------------
      it will ask for the current password, then you can just leave it blank.
      if you have to connect a lot of times with ssh, you could add something to the .ssh/config
      Host client client.example.com
      HostName client.example.com
      IdentityFile ~/.ssh/client_rsa # private key for client (like "sshkeyfile" in my previous example)
      User remoteusername
      Host otherclient other.example.org
      HostName other.example.org
      IdentityFile ~/.ssh/otherclient_rsa # different private key for other client
      User otherremoteusername
      -------------------------------------------
      then you can just use
      ssh otherclient
      or
      scp files client:~/
      really useful if you don't want to always have to add the -i option, or if you want to set a custom name for that connection and have it separated with multiple id files.
      on another note you could also add it as an alias in the .bash, but that's up to you, the point is that you can simple remove the passkey once you know the passkey and then use it as a regular key withough password.

  • @Simpfan45
    @Simpfan45 4 роки тому

    I've definitely done that SOCKS proxy trick while at a former job. Had to install our software on a machine in the UAE without the box having any internet access. Worked a treat. Just remember you also have to tunnel over dns as well or you are gonna have a bad time.

  • @ronakjoshi5093
    @ronakjoshi5093 4 роки тому

    great video john..keep up the good work 💥💥

  • @davidmcclellan4621
    @davidmcclellan4621 3 роки тому

    Is there a reason you didn't use SCP to transfer the alpine container to the attacker machine? I assume something to do with logging and leaving fingerprints, but I feel running wget would leave the same type of fingerprint, but maybe I'm missing something. I'm just a software dev interested in this kind of stuff. Keep up the great content!

  • @flaviuscondurache2688
    @flaviuscondurache2688 4 роки тому

    Nice video, cool LXD PE, personally I would have modifed the /root/.ssh/authorized_keys and I would have sshed as root without needing any pwd. Then you can change it easily with passwd. :)

  • @000t9
    @000t9 4 роки тому

    It's totally fun! Thank you bro!

  • @AsadAli-ye8ns
    @AsadAli-ye8ns 3 роки тому

    movies and games are not even comparable with watching these videos..... wow,,,,,,,,i m in IT field since 2004, but learning process never stops....

  • @harmtech3502
    @harmtech3502 4 роки тому +1

    The proxy video would be interesting yeah, thanks man ^^

  • @kritagyagupta8619
    @kritagyagupta8619 3 роки тому

    John cracks John's password with john

  • @neilslater877
    @neilslater877 3 роки тому

    I keep finding on other machines that i have lxd but when I reach the init part it says there's no storage pool. Does this mean that the machine isn't vulnerable?

  • @SpiderPigXL
    @SpiderPigXL 4 роки тому +1

    Why does changing etc/passwd in the container changes etc/passwd in the host file system? Shouldnt the container be separate and not influence the host?

    • @Sfhgscvg
      @Sfhgscvg 4 роки тому

      You can mount directories from the host inside the container. This is done for example to have persistent data since the container isn't. Since / is a directory and the container is run with root privileges (privileged container) / can be mounted in the container. Same thing also applies to docker. The documentation warns you or it should at least.

    • @SpiderPigXL
      @SpiderPigXL 4 роки тому +1

      @@Sfhgscvg so if i mount a directory from the host to a privileged container and write to that directory the changes are also being done in the host?

    • @Sfhgscvg
      @Sfhgscvg 4 роки тому

      @@SpiderPigXL yeah, try it out, it's fun to play with and fairly simple to try.

  • @softicecreamer
    @softicecreamer 4 роки тому +1

    I wanted you to do this one... This CTF was awesome for me to complete

  • @DevonBagley
    @DevonBagley 4 роки тому

    Easier than changing the root password. Enable passwordless sudo for the user since they are already a member of that group. Changing the passwords are a good way to be discovered.

  • @crimson750
    @crimson750 4 роки тому

    Keep up the videos! Love them

  • @cryspwasp9288
    @cryspwasp9288 4 роки тому +1

    I did it by writing my own script LMAO 😂, I remembered you when I saw John on src 😆😆

  • @neilslater877
    @neilslater877 3 роки тому

    For the upload_file_nc why is he using a different port each time we downloads it?

  • @AnujSharma-yv6gy
    @AnujSharma-yv6gy 4 роки тому

    nc -nvlp 1234 > linpeas.sh --> after this command in the attacker machine, the linpeas.sh file gets empty. Though the transfer takes place but file remains empty on both the ends. Its the same for every type of file. Any help?

  • @Connectme_ai
    @Connectme_ai 4 роки тому +2

    Love the content!

  • @usrbinsudorm5716
    @usrbinsudorm5716 4 роки тому

    20:14 cachemanifest for iptables?

  • @geraldfeeney1410
    @geraldfeeney1410 3 роки тому

    Its cool. Thats master level, There are many ways to go to Rome.
    +1 subscriber.

  • @softicecreamer
    @softicecreamer 4 роки тому +2

    Can you do year of the rabbit CTF

  • @fatcatgaming695
    @fatcatgaming695 4 роки тому

    Fantastic explanation.

  • @varadvithalkj1716
    @varadvithalkj1716 4 роки тому

    john , please do show how to do that proxy thing , its becoming a huge hurdle to my CTFs ,thank you in advance

  • @ShimrraJamaane
    @ShimrraJamaane 2 роки тому

    I don’t know why he didn’t chroot inside the container. Then he would have been a full root process on the host system.

  • @saifeddineboughanmi9046
    @saifeddineboughanmi9046 3 роки тому

    Hey, when i leave the container and try to come back to it i get this : Error: Container 'privesc' already exists
    what this means please ? ^^

  • @BeinIan
    @BeinIan 3 роки тому

    You should have clicked on Draagan Lore, I'm curious about the details of this fictional fictional universe.

  • @jmjl2
    @jmjl2 4 роки тому

    When you get a sh in the container you can just chmod +x /mnt/root/bin/bash and then out of the container bash -p

  • @hookthievess
    @hookthievess 4 роки тому

    yo my man, why do you use guake for sending the linpeas? why cant you just split your terminator screen and do it in that pane? You know what would be good - Doing a video on your workflow. How you set everything up, your terminator shortcuts, they way you use guake, little scripts you use to make things easier.

    • @hookthievess
      @hookthievess 4 роки тому

      watch this for the answer - ua-cam.com/video/f2aSXGbD0NE/v-deo.html

  • @kungfujesus06
    @kungfujesus06 4 роки тому

    Is lxd still this vulnerable? I figured a basic chroot exploit on a privileged container would be mitigated by this point

  • @dstensnes
    @dstensnes 4 роки тому

    cat

  • @gabrielmoreira7265
    @gabrielmoreira7265 4 роки тому +1

    Personally I prefer seeing you work through the problems you came across instead of going directly to the solution

  • @IllSkillz
    @IllSkillz 4 роки тому

    thats some PogU content mate!

  • @pfeilmann
    @pfeilmann 4 роки тому

    just run "cat > passwd", paste, enter, ctrl + d. So "bash/zsh/..." dosn't mess with the input.

  • @mvmastrigt
    @mvmastrigt 4 роки тому

    Why use netcat for transferring a file instead of scp?

  • @beyinforum
    @beyinforum 4 роки тому

    how you guys learn that shit lol, where can I find ´hacking´ sources / lessons?

  • @vamsikolati
    @vamsikolati 4 роки тому

    Plzzz make that video about setting up a socks proxy for internet access

  • @suyashjain3378
    @suyashjain3378 4 роки тому

    Pls continue making such kind of videos 💯💯❤️❤️

  • @Prosth3tiks
    @Prosth3tiks 4 роки тому

    I understand 0.001%of this but I keep watching.... you type the words you get the stuff hahaha

  • @nathanmccabe6308
    @nathanmccabe6308 4 роки тому

    Hey John can you advise me in the steps you took from day one to get to where you are now ?

  • @btnetro
    @btnetro 3 роки тому

    Just curious why not chroot /mnt/root and do stuff there :)

  • @neilslater877
    @neilslater877 3 роки тому

    When did he find johns sudo passeord

  • @franromero1675
    @franromero1675 4 роки тому +2

    Hey, part of the lxd exploit was done by s4vitar, a great hacker who is also a youtuber, perhaps the best channel in Spanish, don't miss it!

    • @Vittoriouss42
      @Vittoriouss42 4 роки тому

      if i could understand spanish i would definitely watch it ! but my spanish stops at Ola ketal ;)

  • @blkspade23
    @blkspade23 4 роки тому

    I'm curious as to why upon having ssh access, why wouldn't just scp files over to the victim machine?