C/C++ Programming for Hackers: Part 1 (Introduction)

Part 1 (Introduction)

C/C++ Programming for Hackers: Part 1 (Introduction)

Hello my fellow hackers! Since i am new here, i'd first like to introduce myself: i am Phoenix750, a young passionated hacker who likes to share everything he knows with other people of my kind. I have been reading null byte for quite some time now, but only could register today. I truely love how this community respects newcomers, But even after reading a lot of tutorials on here, i never came accross a good programming tutorial (except the scripting tutorials, but scripting isn't programming. I'll talk about that later). There are forum questions about it, but not really a decent series of tutorials. So i decided to write them to help the newcomers! So, with my introduction out of the way, let's get started!

What You Will Need Before We Begin

  1. A Linux operating system. i am going to use Ubuntu in these series. you can use any other Linux distro or even Windows if you know how to setup the GNU/GCC compiler for that operating system. but i still recommend Ubuntu because GCC comes preinstalled on it. I will only talk about the install instructions for Ubuntu (thoughh they should be the same for Kali aswell).
  1. The GNU/GCC compiler. this is the compiler that we will use to build our programs. if you do not know what a compiler is, a compiler is simply said a program that turns our programming code (C, C++, Java...) into machine code (1's and 0's). to Check if you have GCC installed, just type the following in a terminal:

gcc --help

this should produce an output like this:

If you have a "command not found" error, then you must type this in your terminal, and it should begin installing.

apt-get update && apt-get install gcc -y

  1. A text editor. this can be any text editor, but i will use the default one in Ubuntu.

Why Programming Is Important for Hackers to Know.

Programming is an important skill that every self respecting hacker should master. here are some good examples of why it is important:

  • Building your own malware. When you program your own malware, there is no signature for it registered, thus making it pretty much impossible for AV software to detect.
  • Knowing how programs work will help you exploit them. though most exploit development is done in the assembly language in debuggers, knowing how a program works will help you exploit it faster.
  • Hacking tools are mostly open source. most hacking tools are open source, which means everyone can access the source code of said program. when you know how to program in the language the program is written, you can edit it and make it even better!
  • Making your own exploits. Though i recommend ruby & the Metasploit Framework for this purpose, ruby is still quite slow compared to C or C++. if you need your exploit to be fast, you can write it in C/C++.

i chose to make a series about C/C++ because C++ is a powerful language and is used in a lot of programs, like games. C is less powerfull but is still quite a low-level language, which means it interacts closely with the CPU. embedded devices are usually programmed in C aswell, from traffic lights to your microwave, will most likely run on some kind of software that is written in C.

What Will We Be Doing in This Series?

first of all, we must master the basics of C/C++. once that is done, we can do some more exciting stuff. here is what i have planned:

  • Make a virus.
  • reprogram some hacking tools written in C/C++.
  • write some other cool software.

that is it for now, folks! in the next tutorial, we will finally go coding and build our first program in C!

-Phoenix750

17 Comments

Cool post. I look forward for the next chapter in the series.

Welcome to Null Byte Phoenix,
First, A good and agreeable start!
Second, Looking forward to it.

hi i am new to this so i dont know c or c++ coding

Nice tutorial. looking for the next part :)

the next part is already posted here.

-Phoenix750

Cool! Thanks Phoenix!

i am learning C for 2 month and i am still learning so i want to ask what exploits can be made by C/C++ ..

pretty much anything you can think of, if you are creative enough.

-Phoenix750

so think like this, in C/C++ you can create new pointer which give you access to the Ram memory, so first thing can can exploit is memory of others running software

I am also your age and i was wondering: where did you start when you were learning hacking and programming. And where did you take the courses.

I didn't take any courses. I learnt everything from reading articles around the internet.

That is for software related hacking atleast. My best skill, which is my hardware hacking, is something my father taught me.

-Phoenix750

Nice start mate .. keep it up !

How old are you, phoenix750?(hope the ques. isn't much personal)..I am 16 and in highschool studying science; I have c++ as my secondary subject in school and we have just been pass some fundamental and I saw your post and couldn't be more happy about it. I am already familiar with some newbie hacking, so i'm really looking forward to writing some malicious codes myself. :P

me 2 Eshaan. in our lessons we study abt c++ but only basic programs. I want to become a expert in computer security and in cryptography. this site has helped me a lot too. ;p

THE FIRST VIRUS THAT WE WILL CREATE, WHEN LAUNCHED JUST CURIOUS WHAT WILL IT DO

How can i make a dictionary file with all characters ,numbers ,etc for bruteforce break method?

Share Your Thoughts

  • Hot
  • Latest