For far to long, I have known about buffer overflows, insecure coding, SQL injections and much more, without actually getting a real grip on things. So, three days ago, I started to play around with the wargames at http://www.overthewire.org/wargames/. I figured that the wargames was listed by difficulty, so I started with with Vortex.
I solved level 0, 1 and 2. Level 0 was quite easy, even thoug I don’t usually program in C. Level 1 was the trickiest of them, since it’s pretty easy to understand what’s going on, but very hard to make the program behave as you want it to (hint: http://www.pixelbeat.org/programming/stdio_buffering/). Level 2 was rather easy, if you think a bit outside the box.
But level 3 is where things escalated quickly(TM)! Level 2 was about creating a “special” tar file. In level 3, you have to craft your own shellcode, which for me seem to be a very steep learning curve! So I figured I’d try one of the other wargames, maybe I could learn something useful and then return to Vortex 3.
I went on to try my luck on the Semtex wargame. Level 0 was easily solved. Level 1 took some time, and a bit of paper and pencil, but was a rather fun level. Level 2 annoyed the hell out of me, since I know exactly what to do, but can’t get it to work. (something along the lines of this I believe. )
Sooo, I decided to try yet another wargame. I figured that I would browse the different wargames to read a bit about them (what a great idea).
I found the bandit wargame – for the complete beginner. Basic linux commands and such. I figured that I’d try it. If I can’t beat a wargame with basic linux commands, I’m fscked!
I actually cheated a bit on level 8, using AWK to find a unique lineWhen somebody asked for help about this level, I re-read the manual page for uniq and found a solution, but other than that, it was a pretty fun wargame. I even forwarded the link to a couple of linux using friends, so they can learn a bit more about the commmand line.
Now, I’m going to try the Leviathan wargame, which I will write about later on.
Earlier today, I saw the above image shared on facebook, and I had to read the full text. After that, I decided to write this blogpost, explaining why the text is wrong. Here’s the main points of the text, and I will tell why each of them is false.
Claim: France & Denmark have banned it from the country…
Fact: Nope, most danish stores sell Red Bull. I don’t know if they sell it in France tho.
Claim: RED BULL was created to stimulate the brains in people who are subjected to great physical force and in stress coma and never to be consumed like an innocent drink or soda pop.
And: It was created by Dietrich Mateschitz, an industrialist of Austrian origin who discovered the drink by chance. It happened during a business trip to Hong Kong , when he was working at a factory that manufactured toothbrushes.
Fact: Actually, Dietrich Mateschitz and Chaleo Yoovidhya started a company together, called Red Bull GmbH. Chaleo Yoovidhya already owned other companies, like one in Thailand that manufactured a drink called Krating Daeng, which was introduced in Thailand the 1970′s. Daeng means red, and Krating is a bovien called a gaur. Dietrich was to adapt the taste of Krating Daeng to suit westeners, and he did.
Claim: FRANCE and DENMARK have just prohibited it as a cocktail of death, due to its vitamin components mixed with GLUCURONOLACTONE…
Fact: Actually, Red Bull used to be illegal in Denmark, but it had NOTHING to do with clucuronolactone. However, taurine and added vitamins in food products was illegal until 2009, which was the reason that Red Bull was illegal to sell.
Claim: … a highly-dangerous chemical, which was developed by the United States Department of Defense during the sixties to stimulate the moral of the troops based in VIETNAM, which acted like a hallucinogenic drug that calmed the stress of the war. But their effects in the organism were so devastating, that it was discontinued, because of the high index of cases of migraines, cerebral tumors and diseases of the liver that was evident in the soldiers who consumed it.
Fact: Glucuronolactone is naturally occurring in the human body, and there is no research that supports the theory that glucuronolactone is dangerous to humans. Apparently, when this myth started, it was rumored that The British Medical Journal had an article about how glucuronolactone caused brain tumors and damaged the liver. There was never published an article about that.
Claim: 1. It is dangerous to take it if you do not engage in physical exercise afterwards, since its energizing function accelerates the heart rate and can cause a sudden attack.
Fact: The only time to be worried about higher than usual heart rate, is when there is no cause for it or if the pulse is over 200 beats per minute. When you drink Red Bull, you consume caffeine, which raises your heart rate, but there is no need to exercise after consuming caffeine.
Claim: 2. You run the risk of undergoing a cerebral hemorrhage, because RED BULL contains components that dilute the blood so that the heart utilizes less energy to pump the blood, and thus be able to deliver physical force with less effort being exerted.
Fact: As far as the information online tells, there is no “components that dilute the blood”.
Claim: 3. It is prohibited to mix RED BULL with alcohol, because the mixture turns the drink into a ” Deadly Bomb ” that attacks the liver directly, causing the affected area never to regenerate anymore.
Fact: There is no evidence of that being true. Having said that, pretty much anything you mix with alcohol and drink, is a potential deadly bomb.
Claim: 4. One of the main components of RED BULL is the B12 vitamin, used in medicine to recover patients who are in a coma ; from here the hypertension and the state of excitement which is experienced after taking it, as if you were in a drunken state.
Fact: A can of Red Bull contains 4.5 MICROGRAMS, that is 0.0045 milligrams, vitamin B12. Quoting wikipedia: “Vitamin B12 has extremely low toxicity and even taking it in enormous doses appears not to be harmful to healthy individuals.”
Claim: 5. The regular consumption of RED BULL triggers off symptoms in the form of a series of irreversible nervous and neuronal diseases.
Fact: Partly true! Yes, what a shocker, something they told you is actually “true”… Daily intake of more than 300milligrams of caffeine, over a long period of time, MIGHT produce these kinds of symptoms, due to overstimulation of the nervous system.
FALSE CONCLUSION: It is a drink that should be prohibited in the entire world as when it is mixed with alcohol it creates a TIME BOMB for the human body, mainly between innocent adolescents and adults with little experience. Forward this mail to Everyone and Let them know about this..
My conclusion: If you want to drink red bull, do that, but keep in mind that the drink contains relatively high amounts of taurine and caffeine. There is no real proof on what extreme doses of taurine does to the body, but tests indicate that there might be a link between extreme taurine intake (2 grams/day) and the introduction of psoriasis. I could not find any reliable sources, telling me how much taurine is in a Red bull.
As for caffeine, well, too much caffeine is bad for you, no doubt about it. Caffeine could potentially kill you, but the estimated dose at which 50 percent of healthy people would die of caffeine poisoning, is 150 to 200 milligrams per kilogram of bodymass. Meaning that I would have to drink between 44 and 59 cans of Red Bull to die. Not likely at all!
Now, share THIS post, so people might get a bit more educated. And you will have to excuse me, while I go get myself a Red Bull!
Okay, you might know how to use conditionals in a list comprehension in Python, like so:
evens=[x for x in original_list if x%2==0]
odds=[x for x in original_list if x%2!=0]
This would create two lists, containing the even numbers and the odd numbers in
Now, using if/else is slightly different. Lets say you want to take a list of integers, and add 5 to all the even numbers, and add 4 to all the odd numbers. It’s actually pretty easy:
result=[x+5 if x%2==0 else x+4 for x in original_list]
this would be the output:
[5, 7, 7, 9, 9, 11, 11, 13, 13]
Another example is this (you figure out what it does):
''.join(['ha' if a else 'Mu' for a in range(4)] )+'!'