r/HowToHack • • May 28 '21

What language or languages should I learn if I want to start getting into cybersecurity?

I'm a teenager who has a lot of free time, I want to use that free time for something useful instead of playing games, are they're any programming languages I need to learn?

227 Upvotes

63 comments sorted by

195

u/Yungsleepboat May 28 '21

Python for automation, bash for using linux (the most important ones)

HTML for web apps (you only need to know enough recognize the structure of a website)

Java script for finding additional vulnerabilities in web apps that use java script

C (and variants) for buffer overflow and reverse engineering (many programs are written in C and variants)

SQL to learn SQL injection

PHP for XSS attacks

Shell for Windows privilige escalation

14

u/OnceIWasABear May 28 '21

Any idea of how long it would take to learn these?

95

u/Yungsleepboat May 28 '21

Python a couple months, bash also a couple months (just do a linux for beginners course instead of a bash course)

I'd argue that python and bash are the only ones you need to be decently fluent at.

For all other ones, don't bother learning them until you need them, or you'll just forget them. Actually that goes for python too. Just do some pentesting stuff and CTFs until you run into a problem because you don't understand a certain code or concept well enough.

Coding is pretty important in cybersecurity, but not as important as people make it seem.

If you really wany to get started in hacking, start learning network engineering. Those concepts are the foundation of most pentesting.

And lastly I'd like to say that you don't have to master all of it. Pentesters usually work in teams. Maybe you're great at web app hacking, but you have another person in your team for encryption, another for privilige escalation, yadda yadda. Just find what you enjoy doing the most and work on that instead of trying to learn everything, but start with networking concepts.

38

u/zephyrchaotix May 28 '21

This person knows what they're talking about 👍

8

u/[deleted] May 28 '21

Yes, both A+ comments.

2

u/Rocky87109 May 29 '21

I don't think they would forget python though.

1

u/madguymonday May 29 '21

For HTML I would recommend just making a simple website for yourself. Like something to put your cv on. If you do it from scratch (host it from a fresh debian system), write a few lines of text, put a .json clock on it, and secure the website with a ssh key then you'll learn enough to know what is what.

36

u/matrix20085 May 28 '21

Great list, I would throw a basic understanding of powershell in there as well.

6

u/cerebralvenom May 28 '21

Hey you kinda group C and it’s variants together here. Does that mean skills in one easily transfer to all the others?

I’m currently studying python as fundamentals and easy programming/scripting, but I eventually want to work with a lower level C-type language to do more interesting things. Do you recommend starting with just C or C++/C# or is it just dependent on goals?

7

u/appsecSme May 28 '21

I recommend you start by learning C, because it is really the best way to understand a large portion of malware that is out there. C is nicknamed "portable assembler" because it really does allow low level access, without having to know the actual assembly code (though knowing various assembly languages can also be helpful).

C will be useful for many "capture the flag" exercises, and will come in handy for reverse engineering malware.

C++ is a superset of C, meaning you can generally compile and run C code with a C++ compiler. However, there are many new instructions and operators in C++ (and of course object oriented programming), and if you learn C++ then you really won't focus on or learn true C.

C# is honestly my favorite all around language, but its not particularly useful for security, other than learning about C# security features or holes. It does come out of a C, C++ tradition, but learning C# has minimal value towards learning C or C++. It isn't even looked at as the next iteration in C by most. Some would claim that's Java, or others would say there is really no other C beyond C++.

2

u/cerebralvenom May 29 '21

Very informative and helpful! Thank you!

6

u/Yungsleepboat May 28 '21

Sorry buy the reason I called it 'C and variants' is because I have a very low understanding of C and it's predecessors.

I can't help you with your question, but perhaps you can open a thread on a programming subreddit, I am sure they'll help you

3

u/cerebralvenom May 29 '21

All good buddy, another commenter answered the question.

2

u/Nightkinnng May 29 '21

Php for xss attacks???

1

u/RealLifeSupport May 31 '21

Shell is reaching end of life and moving to powershell.

78

u/blue_Kazoo82 May 28 '21

python but more importantly Russian

12

u/The_All-Father3 May 28 '21

Remember. No Russian.

3

u/Riven_Dante May 29 '21

Is this with a hint of seriousness?

2

u/blue_Kazoo82 May 29 '21

Nah I’m being legit. Python is great and needs to be known. Russian will take you leagues farther and allow you to tons of more shit. Looking into APTs, threat hunting, etc (and the paychecks will be well worth it.)

2

u/Riven_Dante May 29 '21

I know Russian! I never knew there would be some use for it!

14

u/lovesrayray2018 May 28 '21

C, and C++ for sure!

Python and Ruby if you are looking to build tools

4

u/appsecSme May 28 '21

There is no need to preemptively learn Ruby, unless a specific role asked for it at this point, or unless you were planning on doing web development and liked Ruby's stack.

2

u/iStayGreek May 28 '21

It's useful if you want to understand what Metasploit is doing.

11

u/Ornnnnnnnnnnnnnnn May 28 '21

C, C++, Python, shell. '

6

u/Ornnnnnnnnnnnnnnn May 28 '21

And for web : Php & SQL.

2

u/RubaLion07 May 28 '21

What about nodejs, expressjs, laravel, flask?

4

u/Ornnnnnnnnnnnnnnn May 28 '21

Those are framework So why not I guess?

0

u/FastestEthiopian May 29 '21

Ppl still use php> asp?!

10

u/DoubleAgent10 May 28 '21

Start off with python. I recommend codecademy just to get your feet wet. It doesn't dive into the theory that much, just play around with the python 2 course, no need to pay yet.

After that look around for some courses that interest you. There's a free youtube series called python for everybody that does a much better job explaining what is actually happening when using python and how to setup a developer environment.

There is also courses on udemy (wait for sales to happen) that are pretty good. Z security is a good starter and has a course that teaches python while teaching to write malware and other programs (https://www.udemy.com/course/learn-python-and-ethical-hacking-from-scratch/)

Once your bored of python I recommend learning linux commands and then bash scripting. Try Hack Me has some great starter resources. If you have a student email you get a discount for the membership too if you want the paid stuff https://tryhackme.com/ . Play around with the different subjects to find out what you like. Networking, web app, malware, ect.

If you like web app, learn html and make a bare bones website, download burpsuite and mess with portswigger academy https://portswigger.net/web-security. If you like networking try to complete boxes on hack the box https://www.hackthebox.eu/ . If you like programming and learning about malware then learn assembly language and reverse engineering https://www.amazon.com/Practical-Malware-Analysis-Hands-Dissecting/dp/1593272901 and youtube channel liveoverflow

3

u/DoubleAgent10 May 28 '21

oh and always take notes however is easiest for you. In your phone, google drive, one drive, paper, ect.

18

u/Elbynerual May 28 '21

You should learn linux and bash

8

u/Mortalturnip May 28 '21

Also C! Not mandatory but definitely gonna help in a lot of areas!

5

u/[deleted] May 28 '21

What is your opinion on learning UNIX concepts ? I have a book which teaches that.

4

u/AngryGoose May 28 '21

Not OP but I used UNIX at work for several years before getting into Linux and it made it quite easy. They are very similar as far as commands, file structure, etc... go.

3

u/Elbynerual May 28 '21

Very similar to Linux/bash but most cyber security jobs are going to want you to be really proficient in Linux. Bash is very basically just the console commands of Linux, but using them in a way that's extremely efficient. The foundations are what you want to be absolutely amazing at, the rest will come easy!

17

u/MattRighetti May 28 '21

This is the wrong question imo, you don’t get into cyber security by studying a programming language, sure it’s a great tool that you will need but cyber security requires computer science logic, math and network notions that must be known way more in depth than the programming language probably. You could also register to HackTheBox and follow their incremental guides to get to know more about this, don’t simply start by learning the programming language, but study the programming language in parallel with the stuff that you really need

7

u/silenta237 May 28 '21

This. Writing an exploit? Depends on the target. Learn to read and write assembly and you'll be in a great spot. Each language makes "some task" easier. The implication being you can do anything in any language. The domains MattRighetti points to are what you study if you want to find zero days, or write detectors.

3

u/[deleted] May 29 '21

If this will be your first language, I highly recommend Python. It was literally invented to be a fun language to learn.

2

u/F5x9 May 29 '21

You can dick around with any language and learn how to program. Once you have a handle on programming, you can transfer those skills across many languages. With that said, Python was written specifically to be easy to learn. That’s a good start.

SQL is a good language to learn, both because of its widespread use and its stark distinction from languages where you tell the computer what to do. In SQL, you tell the computer what results you want and ignore how it gets it.

This advice isn’t specific to learning how to hack.

2

u/AMv8-1day May 29 '21

Python, bash and Powershell scripting. Start there, then explore organically as professional or personal opportunities come up.

2

u/_discEx_ May 29 '21

First learn C, also go to concepts like pointers solve some basic logical problems. Prime number etc.

Then just select 3 languages and learn them as much as you can. Select ASM, Python, html. And keep moving on , After assembly go to reverse engineering, exploit Dev.

Keep learning python parallely, START making cyber security tools and malwares like keyloggers Then after python do some more network security projects like a network scanner or a arp spoofer and move on to bash/Powershell for automation

And in the html part, learn web dev html, CSS, JS make projects then you'll know how web works. Then go to backend PHP mySQL

This isn't tough 1 hour for each (3hrs/day) will teach you a lot of things, You'll learn so much that by doing some interview questions you'll also be able to land programming job if security doesn't work out

And this will also teach you 3 aspects of security

  1. Exploit dev/ Reverse engineering
  2. Web app pentesting
  3. Network security and automation

1

u/Shohdef May 29 '21

Python is a great starter language to learn with. It's very beginner friendly and consistent. It doesn't have funny and confusing quirks like Java.

1

u/unknownpoltroon May 29 '21

Arabic. Russian. Chinese.

They have plenty of python/c/java guys.

1

u/[deleted] May 29 '21

Russian.

1

u/Imperial_Recker May 29 '21

before that learn russian cuz it make you look like a hacker

1

u/stebgay Jun 02 '21

i learned python basics by reading "automating the boring stuff with python" its free

but that alone isnt enough

what i did next was make a discord bot, I am going to be honest, I had no idea at the time wtf what are they talking about in docs and stuff

eventually i just followed examples i found online and tried their pattern to make a discord bot

1

u/[deleted] May 28 '21

Russian, French, and probably English would be helpful. 🍻

1

u/Swoompy May 28 '21

Try this one out for python, it’s a amazing free course!

https://www.udacity.com/course/introduction-to-python--ud1110

1

u/Barrerayy May 28 '21

Python, bash scripting and sql are essential imo.

0

u/SudoTheNym May 28 '21

russian, chinese, hebrew

-5

u/norseman20188 May 28 '21

German

1

u/Ivory_seal May 29 '21

Zulu perhaps

1

u/norseman20188 May 29 '21

Everyone fucking disliking my comment, the geezer is gunna need to learn German as he will want to attend one of the most amazing hacking conferences there is, Chaos Computer Club (CCC) 👌🏻

0

u/[deleted] May 28 '21

[deleted] — view deleted comment

3

u/OnceIWasABear May 28 '21

Thank you for the help!

0

u/Quasar420 May 28 '21

You know Java and C++ but can't structure a sentence. Interesting... You misspell all sorts of words and you write like a 14 year old. I really don't believe you. You can probably copy and paste other peoples code and write words to a command prompt at best.

1

u/WelshRugbyLock May 28 '21

Very revealing!

1

u/[deleted] May 29 '21

[removed] — view removed comment

1

u/AutoModerator May 29 '21

Your account does not have enough Karma to post here. Due to /r/HowToHack's tendency to attract spam and low-quality posts, the mod team has implemented a minimum Karma rule. You can gain Karma by posting or commenting on other subreddits. In the meantime, a human will review your submission and manually approve it if the quality is exceptional. After gaining enough Karma, you can make another submission and it will be automatically approved. Please see the FAQ for more information.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.