Posts

Showing posts with the label Vladislav Zorov

Some of the best computers to be used for hacking

Image
Well, this is one of  Adrián Lamo ‘s computers: Beautiful, isn’t it? He obviously owns this machine (to “own” something means you can fix it when it breaks, and the above has obviously been fixed many times). Here’s one of my own boxes: Yes, I’m using “box” literally… and yes, we actually installed LEDs  inside the power supply  (hint: there are two circuits inside, high voltage and low voltage; one of them can kill you and burn your house down, while the other will only burn your house down (which may or may not kill you)). It’s eco-friendly, too (the cardboard is biodegradable and the components are from the trash). TL;DR: The best computer for a hacker is one that they own. P.S. Also read  Adrián Lamo's answer to How did Adrian Lamo learn to hack? Possibly the most important aspect of my early computer experience was finally having a computer system that was  mine . I could experiment with it. I could break it and have to fix it. I could mess up the sett

Fundamentally, What is programming?

Image
Fundamentally, it’s arranging patterns so that, when fed to a machine, certain desirable patterns come out. This is a  Jacquard loom : This is the device that inspired  Charles Babbage  to invent the computer. As you can see, it’s weaving a carpet. This is not a computer (there are certain important things that are missing, like internal state and the ability to also  change  the patterns on the paper), so this loom didn’t involve  computer  programming, but I think it’s still programming - just look at the tape; that’s  obviously  code, and I don’t think it’s unreasonable to call the person that wrote it a programmer. Guest Author Vladislav Zorov programming enthusiast. Lives in Bulgaria Love my answers? Donate to my gaming budget:  paypal.me/vladizorov

What is the most beautiful computer program?

Image
The null program (i.e. empty program): In many languages it’s a  quine  (a program that prints its own source code). Full test coverage by default. Has a  cyclomatic complexity  of 1, the smallest possible value. Runs in  O ( 1 ) O ( 1 ) . People think their first program is “hello world”, but actually the first valid program they have written is most likely the null program. Is very portable, not just across operating systems and compilers but also across programming languages. Is at the base of every other program ever written. Sometimes, it  is  the program being written ( The /bin/true Command ). It literally breaks the charts on all metrics that are “per line of code”. Everything else is downhill from there :) Guest Author Vladislav Zorov programming enthusiast. Lives in Bulgaria Love my answers? Donate to my gaming budget:  paypal.me/vladizorov

Some basic Python Optimizations

Image
WARNING! For CPython, if you want performance you should prefer algorithmic optimizations (i.e. find better algorithms for what you're doing) or, if that's not possible, rewrite parts of your code in Cython. You should generally aim for readability, and avoid micro-optimizations - except in cases where it's the same, like comprehension expressions: they are both more readable  and  faster (special-cased, emit less instructions than loops because there's no possibility of  break ,  continue  or  return  -  compile.c , Ctrl+F, "List and set comprehensions"). You should always profile your application before optimizing, and you should profile with real (or realistic) data and in an as complete state as possible - concentrate on optimizing stuff that  actually  matters, not stuff you  think  matters. You have been warned. On to the fun part. >>> from dis import dis >>> def fn ( a ): b = a >>> dis ( fn ) 2

Why is Python most popular to be used for hacking?

Image
Say, you’re writing a buffer overflow exploit, and you have figured out that you need 1337 bytes of padding. What are your options? Type them by hand. This will be annoying and error-prone (how sure are you that you hit the “A” key  exactly  1337 times? because one more or one less will ruin the exploit). Write a C program to generate them - with a loop and a counter. This will be less annoying and less error prone. Write a Python program to generate them. There it’s just  "A" * 1337 , done. But it gets even better! How did you find this vulnerability? Python is the plug-in language of the Immunity debugger. And how do you intend to deploy the exploit? Python has networking libraries. And HTML parsing libraries and what not. It’s a high-level, easy-to-use Swiss army knife. Guest Author Vladislav Zorov programming enthusiast. Lives in Bulgaria Love my answers? Donate to my gaming budget:  paypal.me/vladizorov

Sponsored Products