Linux Hackers Become Root with CURL & Sudo

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 มิ.ย. 2024
  • jh.live/pwyc || Jump into Pay What You Can training at whatever cost makes sense for you! jh.live/pwyc
    Play my "Book Store" challenge on HackingHub: app.hackinghub.io/book-store
    Learn Cybersecurity - Name Your Price Training with John Hammond: nameyourpricetraining.com
    WATCH MORE:
    Dark Web & Cybercrime Investigations: • Tracking Cybercrime on...
    Malware & Hacker Tradecraft: • Malware Analysis & Thr...
    📧JOIN MY NEWSLETTER ➡ jh.live/email
    🙏SUPPORT THE CHANNEL ➡ jh.live/patreon
    🤝 SPONSOR THE CHANNEL ➡ jh.live/sponsor
    🌎FOLLOW ME EVERYWHERE ➡ jh.live/twitter ↔ jh.live/linkedin ↔ jh.live/discord ↔ jh.live/instagram ↔ jh.live/tiktok
    💥 SEND ME MALWARE ➡ jh.live/malware
    🔥TH-cam ALGORITHM ➡ Like, Comment, & Subscribe!

ความคิดเห็น • 73

  • @Tib3rius
    @Tib3rius หลายเดือนก่อน +67

    Appreciate the shout out John! This was a really interesting privesc. :D

    • @ytg6663
      @ytg6663 หลายเดือนก่อน

      What interesting. He could just directly do ls -l . Cat /etc/passwd
      In real enterprise environment he tricks wont work

    • @davel202
      @davel202 หลายเดือนก่อน +3

      Oh hey! I think I remember seeing you do an interview with Spycast or someone in the vet community. I recognized the avatar

    • @ytg6663
      @ytg6663 หลายเดือนก่อน

      @@davel202 lol

    • @Tib3rius
      @Tib3rius หลายเดือนก่อน

      @@davel202 Sorry, haven't done an interview with Spycast or the vet community.

  • @TheMAZZTer
    @TheMAZZTer หลายเดือนก่อน +41

    Your first python3 web server is running as "user" which is why "user" needs access to /home/fry/.bash_history to successfully serve the file. There's no security exploit here. Hence why you needed to adjust the file permissions. I would expect users wouldn't run that server since it doesn't give them anything they don't already have.
    Edit: The second python3 server running as fry is better since you smuggle in a file fry has access to into /root/ using curl as root. But ultimately you could have done the same by using curl as a fancy cp.

  • @almog4373
    @almog4373 หลายเดือนก่อน +13

    You could also rewrite the /etc/shadow file, edit the uid of a user u have in /etc/passwd…

    • @aerozine2389
      @aerozine2389 หลายเดือนก่อน +2

      I just removed the hash of root then overwrote shadow; then just ran su :)

    • @AlejanroDelHierro
      @AlejanroDelHierro หลายเดือนก่อน +2

      @@aerozine2389 Mostly, only root is approved to write, even read a file.

  • @aalbatrossguy
    @aalbatrossguy หลายเดือนก่อน +5

    man, I love your videos :)
    keep up the good work :)

  • @liveting4579
    @liveting4579 หลายเดือนก่อน +1

    Hey John, is there anyway to reach out to you about setting up vulnerable servers?

  • @DHIRAL2908
    @DHIRAL2908 หลายเดือนก่อน +15

    6:00 Doesn't python server read the file and serve it? How can curl having the sudo perms make python be able to serve a forbidden file?🤔

    • @DHIRAL2908
      @DHIRAL2908 หลายเดือนก่อน +8

      6:35 ah should have watched ahead😂

    • @RandomGeometryDashStuff
      @RandomGeometryDashStuff หลายเดือนก่อน +4

      so he overcomplicated reading .bash_history 😅

  • @rogerioabreu3081
    @rogerioabreu3081 หลายเดือนก่อน +3

    Great work, John!

  • @ChillstreamCentral
    @ChillstreamCentral หลายเดือนก่อน +3

    wait a min. i didn't get that, when we access that file via curl its requesting python server for that file and python don't have perms to read that file, how the hell curl suid perms allowed that?

    • @user-mk3zz8zn9b
      @user-mk3zz8zn9b 26 วันที่ผ่านมา

      its not requesting python server, curl can do that on its owm , since it had root perms. we dont need pythonserver, at all after the fry shell

  • @ToyeTuning
    @ToyeTuning หลายเดือนก่อน +1

    Always great videos. Thanks John!
    Edit: I often make the same mistake when doing links 😂.

  • @Adkali
    @Adkali หลายเดือนก่อน

    Nice!
    Thanks for sharing John!

  • @gabrielex
    @gabrielex หลายเดือนก่อน

    That was neat, the only downside is that this way if the authorized_keys file does exist you'll be overwriting it, so the original user wouldn't be able to access anymore using their key.
    Also root ssh access could have been disabled for safety reasons.

  • @algorithmblessedboy4831
    @algorithmblessedboy4831 หลายเดือนก่อน +4

    3:10 lmao I am watching at 23 pm and i got flashbanged

  • @mihaiciocan59
    @mihaiciocan59 หลายเดือนก่อน

    Hi. Just a quick question. If you had access to write, is there a possibility to overwrite the/etc/shadow file with a new hashed password that you actually know for the root account?

    • @_JohnHammond
      @_JohnHammond  หลายเดือนก่อน

      Yes! That is an even better technique, so it all stays local and you don't have to rely on SSH. If you remove the hash entirely, you can su to root without even needing a password 😎

    • @mihaiciocan59
      @mihaiciocan59 หลายเดือนก่อน

      @@_JohnHammond Exactly, thanks for the answer 😉

  • @Whothefuckareyoutojudge
    @Whothefuckareyoutojudge หลายเดือนก่อน +1

    If you fixed up the perms, then this wouldn't work, because the HTTP server would need to run as fry or root to read any of fry's files.
    Could've just "cat /home/fry/.bash_history" at this point instead to save time.

  • @Trilipop
    @Trilipop หลายเดือนก่อน +1

    great stuff! really clever

  • @an3ssh
    @an3ssh หลายเดือนก่อน

    please put the nahamcon ctf hosted somewhere.....

  • @NANa-nz2pz
    @NANa-nz2pz หลายเดือนก่อน +2

    John, what do you think of Tcm security training?

  • @luis-rv8jj
    @luis-rv8jj หลายเดือนก่อน

    how to access one system to another system

  • @xCheddarB0b42x
    @xCheddarB0b42x หลายเดือนก่อน +1

    Great stuff. I now have more CTF problems than I have time. LMAO 😅

  • @nickg.7275
    @nickg.7275 หลายเดือนก่อน

    Nice idea. Thx.

  • @gregorh5658
    @gregorh5658 หลายเดือนก่อน

    Awesome !!

  • @RuggMatt
    @RuggMatt หลายเดือนก่อน +3

    Someone once time me the order of the params for ln is the same as mv and cp and i have never forgotten it since.
    mv
    cp
    ln -s

    • @paultapping9510
      @paultapping9510 หลายเดือนก่อน

      ln -s will overwrite the old file with a blank new one. I discovered this trying to move my .bashrc into .config and symlink it into ~. That was a fun hour 😂

  • @definitelyno
    @definitelyno หลายเดือนก่อน

    The first curl example does not make any sense. The web server that reads the symlink will do it as the same user as is running curl and the web server. Curl simply does nothing in that case, just that the permissions were set incorrectly.

  • @sluuny
    @sluuny หลายเดือนก่อน +1

    Love your videos !! Thx !!
    Is this Kali on bare metal or in a VM ?

    • @user-mk3zz8zn9b
      @user-mk3zz8zn9b 26 วันที่ผ่านมา +1

      vm

    • @sluuny
      @sluuny 26 วันที่ผ่านมา

      @@user-mk3zz8zn9b thx bro

  • @hacker4fun
    @hacker4fun หลายเดือนก่อน

    john never disappoints !!

  • @lltheblankll3024
    @lltheblankll3024 หลายเดือนก่อน +1

    nice!

  • @tametov
    @tametov หลายเดือนก่อน

    Cool 😊

  • @petermoras6893
    @petermoras6893 หลายเดือนก่อน

    Privilege escalation, in MY sudo? It's more likely than you think.

  • @amnahidhasan
    @amnahidhasan หลายเดือนก่อน

    You are amazing

  • @thespecialchannel
    @thespecialchannel หลายเดือนก่อน

    if he's already running commants using fry and using sudo then where the heck is the privilege escalation

  • @ahmedazizabbassi
    @ahmedazizabbassi หลายเดือนก่อน

    Thanks a lot for this valuable and enjoyable content 🥰

  • @wrathofainz
    @wrathofainz หลายเดือนก่อน +1

    Glad I'm not the only one who consistently fucks up the ln command.
    I do the same with mklink on Windows -_- oh the pain

    • @beardlyinteresting
      @beardlyinteresting หลายเดือนก่อน

      Commands I've used a million times but always need to look up:
      ln
      tar
      find

  • @AUBCodeII
    @AUBCodeII หลายเดือนก่อน

    Hey, John, let's get OSEE.

  • @ramprasadmuppana5002
    @ramprasadmuppana5002 หลายเดือนก่อน

    I want to learn Exploit development, any suggestions mates..

    • @Jarling-so4oi
      @Jarling-so4oi หลายเดือนก่อน +1

      Buffer overflows, Azeria Labs and Liveoverflow's Bin series

    • @ramprasadmuppana5002
      @ramprasadmuppana5002 หลายเดือนก่อน

      @@Jarling-so4oi mate, any prerequisite

  • @JustenCase
    @JustenCase หลายเดือนก่อน +1

    You can just become root with only needing sudo..... sudo passwd -d root && su and now ur root. Way faster..

  • @nightwalker83
    @nightwalker83 หลายเดือนก่อน

    I can't see the subsibe button 😂

  • @yajusgakhar6969
    @yajusgakhar6969 หลายเดือนก่อน

    Not me doing a symbolic link CTF just before watching this video 😂

  • @rigsshiver823
    @rigsshiver823 หลายเดือนก่อน

    6:13 pepePains the password

  • @false_positive
    @false_positive หลายเดือนก่อน

    conclusion - no ssh no problem :D

  • @Apple_Beshy
    @Apple_Beshy หลายเดือนก่อน

    ❤❤❤

  • @temolantern9091
    @temolantern9091 หลายเดือนก่อน

    mmm hamham-yumyum-tumtum

  • @bertosudu9506
    @bertosudu9506 หลายเดือนก่อน

    👍👍👍👍👍👍👍👍👍👍👍👍

  • @meanjellybean8963
    @meanjellybean8963 หลายเดือนก่อน

    Second

  • @stylo__boy
    @stylo__boy หลายเดือนก่อน +2

    First 🥇

  • @proveryourpoint_8554
    @proveryourpoint_8554 หลายเดือนก่อน +1

    for some reason I hate when you say "tac" instead of "dash"

    • @Quick.history27
      @Quick.history27 หลายเดือนก่อน +1

      Really?!? I love it!

  • @abdullahgunduz2656
    @abdullahgunduz2656 หลายเดือนก่อน

    Brother, why are there no Turkish subtitles? Do you have a problem with Turks?

    • @RadicalInteger
      @RadicalInteger หลายเดือนก่อน

      there's also no Persian, probably unintended

    • @hawks5196
      @hawks5196 หลายเดือนก่อน +2

      Ask TH-cam, they are auto generated

    • @MI7DJT
      @MI7DJT หลายเดือนก่อน

      Why race-baiting? That's VERY low IQ.

  • @paradoxlord
    @paradoxlord หลายเดือนก่อน

    very good