《Grand Simulation》Chapter 13 - Timing Attack
Advertisement
test = echo "Hello, World!"
“Test,” I whispered. A new window opened up.
Hello, World!
I was almost certain that it would work but still sighed in relief. Then I quickly modified the program, coming to the crux of the issue.
test = sudo echo "Hello, World!"
I took a deep breath. Crossed my fingers. Whispering with my eyes closed, “Test”. I opened a single eye and my lips unconsciously curled into a smile.
Password:
‘Hallelujah!’ I celebrated in my mind. There is a superuser!
“So it worked?” Arya asked out of nowhere. I beamed at her blankly for a moment. “You did your evil smirk again,” she clarified.
“Okay, first off, it is a normal smile. And second, yes. I got want I was looking for. As for whether I can use it or not, the jury is still out on that one,” I said.
“So, can you tell me now what the spell is?” she beamed back. She had grown peculiarly interested in programming. ‘Perhaps she wants to make a powerful resurrection spell or something?’
“Okay. In normal computing, there is a concept of a superuser, who can do stuff normal users cannot. Ummm, for example, think of a corporate building. You have your cleaners, workers, security, and so on. Many people with various roles and access to different rooms and tools. Then there is the owner or an administrator of the building. That one has access to all the rooms and all the stuff of the building. A superuser is something like the administrator. I mean, bad example but close enough. In Windows, the user is called an Administrator; on Unixes it is called a ‘root’ user,” I tried to explain.
“Ah, I understand. So, what has your spell got to do with an administrator?” she asked.
Advertisement
“Hmm, well you must know by now that these spells are nothing but programs, right? If I can get superuser rights, then -“
“Then you can access tools and do stuff that you normally couldn’t!” she cut me off and concluded.
“Well, yes,” I replied. ‘She is quick on the uptake.’
“So how do you become an admin?” she continued.
“That is the problem. You need a password,” I said with a bitter smile.
“And how will we get this password?” she prompted unabashed.
‘Brute force? Nah, I don’t have years to spare for it to complete. I don’t have handy dictionary either. Hmm, will it be susceptible to attacks though? Even our Earthly systems are so air-tight for the most part, this is an alien super system we are talking about. Maybe…’
“I’m gonna try something called as timing attack.” I paused, rearranging my thoughts. “It works by checking the time of a system’s response against different inputs. Imagine you entered a fully wrong password, like all characters incorrect. And the system denies entry after processing for a bit. Now, you enter a wrong password again, but half your characters are matching the real password. System will deny you entry again, but the time it takes to process your input will vary.”
“I don’t get it, why will the time be different? And how will it give us the password?” she asked.
“Hmm, perhaps an example will help? Assume the real password is ‘abcd’. And the system checks each letter of your input against the real one when verifying. Now, if you enter ‘wxyz’, the system matches ‘w’ as first input against ‘a’, which is incorrect, so it immediately denies request. Next, you put in ‘axyz’. It will check if letter of input ‘a’ with real pass ‘a’, give okay, move on to next letter ‘x’ and match against ‘b’. It denies again here but the time it took to deny was more that of before because it took more time to process the correct input at the start. Thus, you unravel each letter one by one until your ‘wxyz’ turns into ‘abcd’ and voila - you have the password!”
Advertisement
“Oh wow, that is some neat trick.” She reflected one it for a while. “Hey, my mana is back up, I’m gonna go cast heal. Best of luck with the password.” She went back to her grind. I went back to mine.
¤ ¤ ¤
I was pessimistic. Good thing I had nothing but time on my hands - at least until Arya leveled up. I decided to give some random words a try first, you never know.
Password: password
I added the password with a thought. The window just vanished. No ‘Hello, World!’. I noticed I was down 2 mana. ‘Come on, I’m not even doing anything!’ I wailed.
More determined than ever, I tried several more variations. No dice.
‘I can’t manually keep entering a password. A few more and I’ll forget what I entered previously. Nor would I be able to cover all the characters.’ With that thought, I decided to automate it.
test = while true; do echo "password" | sudo -S echo "password worked"; done;
I cast the spell. One mana point down. I didn’t see the window prompting for the password. Another second down, another mana point gone.
‘What is this? A background job? I see. Since the system is unable to determine how many resources this spell will consume, it is taking it in as it requires,’ I mused. ‘Alright, now that we have a loop, let us get our characters in! First, I need a loop going from 0 to 255 to cover all chars. And I need to stream the output into a file.’
test = i=0; while [ $i -le 255 ]; do; echo "$i" >> password_hack | sudo -S echo; done;
‘Now, instead of taking in numbers, let us feed it characters. Maybe the old printf trick?’
get_char i = printf "\x$(printf %x $i)"
‘Alright, this will take a decimal i and return the corresponding character. Next is… ah right, the “time” function.’
get_time = date +%s%N
‘Right, so this will give us time in nanoseconds. Now to put it all together…’
test = i=0; while [ $i -le 255 ]; do; echo "$(get_char $i) $(get_time)" >> password_hack | sudo -S echo; done; get_char i = printf "\x$(printf %x $i)" get_time = date +%s%N
I ran each function and made sure everything worked. By the time I was done, Arya was looking fixedly at me again. “You were gone for quite a while just now. How’s the password hacking going?” she queried. I was getting used to her being a curious cat by now, so I simply replied: “I’ve got the code down, I think. But I don’t have the mana required to run it to the end right now. Maybe later? Quite a shot in the dark though, I don’t expect much,” I sated her curiosity, “Are you done?” I queried in return. “Yep, I’m level 3 now!” she exclaimed. “Congratulations,” I smiled in return. “Should we wake the others now or do you wanna rest some?” “Nah, let’s get going,” she declared. And so, we woke the others and got going.
Advertisement
- In Serial11 Chapters
The Heroic Tales of Silas Horne
In the year 1858, the system came to the world. It brought with it beings from fantasy and mythology the likes of which the world had never seen before. In the American frontier, a place already known for being a dog eat dog world the system gave bandits the capacity for untold violence, not to mention monsters and system loving fanatics hell-bent on the murder of the innocent. But are they truly so innocent? No one knows what the system is or why it came, they do know one thing though. That the world post system isn't a place for a hero. Luckily for the world, U.S Marshall Silas Horne is no such man. ----- AN: This story is a litRPG inspired by "Randidly Ghosthound" and "The New World" but after reading many such stories and finding them to be a tad samey I decided to write this in a new setting, the Wild West. Also, my release schedule is chaotic, expect at least one 1000 word chapter each day but probably like two more will also be released.
8 73 - In Serial145 Chapters
Time to Fly
Time to Fly is a collection of poetry that I wrote about my own thoughts and feelings. I hope this will help you find comfort and make you not feel alone in this journey called life as we go through our struggles together. Includes mixture of poetry about mental health struggles, heartbreak, love, and healing. TW: mental illness, suicidal thoughts#1 sad poems - 6/11/22#1 poem - 6/25/22#1 feelings - 6/26/22#1 poem collection - 6/29/22#1 thoughts - 7/1/22#1 happy poems - 7/31/22
8 106 - In Serial124 Chapters
MAGE CHRONICLES: THE BEGINNING.
Mahina's life wasn't easy, but she loved it...sometimes, until deadly revelations lead her to another realm with her toddler in tow. Ancient vendettas, vindictive royals and hot supernatural mates and her life gets more interesting. Family, romance and action with a little drama for spice. Follow Mahina's story as she navigates the emotional rollercoaster life has shoved her into. I stand transfixed as the rest bow, some of the students even kneel, in my defence, I was still running my mind through everything that had happened. “Bow you, idiot,” comes from Nyx. I go to answer when the stupid voice from earlier, Garian I think comes from behind the guy once everyone is upright. “See your majesty, I told you she was insolent, a few days in purgatory and she’ll fall in line.” Purgatory? What the fuck! Suddenly Garian crumples to the ground clutching his neck veins bulging. “Now Garian, that is no way to speak to your future queen is it, apologize,” the immense man drawls studying me with a strange look in his eyes. A rush of joy fills me to see Chad like that, which is why I take an embarrassingly long minute to gather what he had said. “Queen? Who me?” I ask, turning around, everyone is watching me with a mixture of reverence and jealousy and a few pitiful looks here and there. “And you will be the king I suppose?” He nods his head slowly. “Fuck no, mister, no way, are you freaking serious?” I turn to look at my escorts who all avoid my eyes. Were they for real? Was this some prank? like, scare the newbie or some shit. That’s what I get for not trying to escape, let’s learn a little more about these guys she said, well see what you did now stupid inner voice.
8 210 - In Serial28 Chapters
Yandere!InquisitorMaster x reader
Basically just some headcanons/scenarios/oneshots of the squad if they were yandere for you :) Hope you enjoy reading! ¡This book is old so most of its content is cringey! Read at your own risk!I'm not writing for this anymore, sorry!
8 201 - In Serial26 Chapters
A Raven's Craving • Namgi [✔️]
in which a modern-day wizarding school has a powerful student attending× cursingnamgischoolupdated friday and tuesdayHIGHEST RANKINGS[#1 yoonjoon•10/1/20][#1 namgi•3/22/21][#3 hopekook•4/30/21][#53 btsrm•12/18/20}
8 188 - In Serial39 Chapters
Second Chance Of A Mate
Isn't meeting your mate suppose to be the best thing in the whole world? The spark you get when your hands touch? Where you would do anything for each other? Ever since Gabriella Monet Ray was a little she dreamed of being loved and cared for by her mate but that dream ended when her mate Alpha Caden of the Midnight Moon pack rejected her. Gabriella to heart broken to stay decided to run away. What happens when she meets Alpha Lucas of the Silver stone pack? Will she ever go back to her old pack? Or will she stay rouge?Can she get a second chance?Read Gabriella's and Caden's and Lucas's story to find out.
8 69

