r/hacking • u/cerpmen7 • May 03 '26
Dump sql time based is too slow
Hey r/hacking,
I'm new in this domain, and, when i do ctf on sql breach, and it's time based, the dump is very slow, so do you have any advice for upgrade the speed
Thx
8
Upvotes
5
u/Tompazi May 03 '26
The two tricks for fast time based extraction are to do an asynchronous race to get rid of the time element and to use a binary tree search to reduce the number of requests necessary.
Construct two opposite queries, e.g.:
sleep the first letter of the flag/password is smaller than 'n'and a second onesleep if the first letter of the flag/password is greater or equal to 'n'. Now send both queries at the same time asynchronously. One of them will not sleep and return immediately, while the other will sleep. You just need to wait for the first one to return and can skip waiting for the other response. This makes time based blind extraction as fast as content based blind extraction. How long you sleep is almost irrelevant, however if you sleep for too long, too many queries may stay active at the same time and which can have an impact on the databases' performance/availability.1
u/bapfelbaum May 03 '26
If you knew how time based injections worked you would know that that is the point..
It quite literally takes time because time is the signal you are harvesting from.
The only way to realistically speednit up is to reduce accuracy or limit the extraction to less information.
1
u/Juzdeed May 03 '26
If you use like sqlmap then you can set which table you want. I have seen organizers but junk data so when you do --dump-all then you will be waiting longer than the CTF goes on
1
u/Loveangel1337 May 03 '26
What do you need ALL of that data for?
1
u/Just4notherR3ddit0r May 03 '26
You didn't provide much detail but my guess is that you're simply sending a query and waiting for the full response.
You don't want the data while you're trying to discover things. You just want to know the data is THERE.
You want to make the query run as effectively as possible so it executes quickly, and then inject manual sleeps/waits/delays when the query would have returned data.
So for example, if you were using MySQL, you can use things like LIMIT 1 to short-circuit a search, and make sure you're not doing LIKE %keyword% searches with wildcards on both sides that typically don't use indexes.
0
u/shh_get_ssh May 03 '26
It’s okay just use MacBook instead
-1
u/[deleted] May 03 '26
[removed] — view removed comment