《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 Serial199 Chapters
Protagonist: The Whims of Gods
Book one now also on Amazon! After quitting her job as a therapist and grabbing some work at a dog shelter, Tess's life became pretty slow. A tad boring, even. It thus came as no small surprise when she was chosen by a god. Thrust into a new world where magic, monsters, and character levels are suddenly a reality, Tess will quickly find that just surviving can be a challenge. It doesn't help that dark forces are stirring, she's woefully underpowered, and that spiders keep trying to claw her face off. One thing's for certain, though: The possibilities are endless. Will she end up wrestling a dragon? Becoming an arch-mage? Opening a quaint, bookstore, coffee shop, and wine bar for elves? The choice is hers... As long as she can live long enough to make it. Protagonist is a fairly classic LitRPG novel with character levels, classes, stats, settlements, and other LitRPG elements. Unlike a lot of LitRPG stories, while the protagonist has some perks, she doesn't start off overpowered. You can expect to see her struggle as she advances. This novel also takes the opportunity to explore some less frequently seen builds, shying away from any min-maxing. Chapters are about ~2000-3000 words and are released at 8:00am ET every other day.
8 4864 - In Serial72 Chapters
Girl with the Golden Eyes
Cyril was the sole child of an international power couple Edward and Madin. Because of interfamily fighting, Cyril was horribly injured and had to remain in a coma because of the pain she felt when she was awake. Eventually, they found that she could connect with their family via technology that such as Full Dive Technology that captured the nerve signals. Years go by and her father had created a virtual game around her, but her body eventually failed and she chooses to end her life while she was still her. However, life deemed that she would get a second chance to live and she gets reincarnated in the world she and her parents created - 5,000 years later...Note: Please bear in mind that I am not a professional, or anyone with any higher learning. Simply someone who found a passion to write.
8 102 - In Serial15 Chapters
The Last Evil
Helena Rukh is the Last Evil, the Black Queen, the Leader of the Dark Pact… and half a dozen other equally silly titles. Or at least Rukh thinks they’re silly, but then, she’s never thought of herself as the villain, despite all the things she did back in the War. A war she lost. The treaty was signed. Her attempt to conquer all Reality aborted. Rukh’s retired now, to a hell-hole world called Sansara, a place where it rains ash and chaos-rents mar the sky, though the liquor is surprisingly good. But an old enemy is on her way to end that retirement, to drag Rukh back into everything she left behind. Trouble is brewing and the self-styled good guys are at a loss. Set a thief to catch a thief and all that....
8 190 - In Serial4 Chapters
Fall for you..... KristSingto
Singto meets Krist after many years of searching through Mew and Gulf. Where will this meet lead them to ?Hii, a new KristSingto's story. This publish is slightly based on my imagination of a fanfiction I read in Wattpad call Fall for you....Read at your own risk.I don't own any characters. Credits to the original fanfiction and authors.Please don't forget to vote and share.... And check out my other works....Love you all.Characters :Singto PrachayaKrist PerawatMew SuppasitGulf KanawutAs supporting onesNew ThitiphoomOff JumpolSaint Zee PrukNeenGun Atthaphan
8 199 - In Serial9 Chapters
Bloodlust {A GhostMyers Fanfiction}
Hello! Welcome to the description box!I'm basing this book off of some DBD parodies I've watched in the past and others "Michael x Ghostface" books.I'm rewriting this book, so Ghostface will be able to speak both Japanese and English. And also, for the sake of the readers, here is how I'm going to do the Japanese speaking now (since I don't want to translate).Underlined Italic: JapaneseNormal: EnglishHope this helps!Book cover says "Yeah we gay, keep moving"None of the art belongs to me! They belong to their respectful owners!
8 175 - In Serial10 Chapters
Three Wishes [TinCan]
Everyone is born with three wishes.Everyone usually wastes theirs as a baby/kid, with wishes like "I want to be fed, I want a toy, I want mommy" and things like that. You are special and are the only human on Earth with one wish left, what is it?Can is a simple person even as a kid and he still has one wish left.Based on prompt from ig:@writing.prompt.s
8 80

