1.2 Why Cybersecurity Analysts and Penetration Testers Need Python
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
Already have an account? Sign In »
1 hour 12 minutes
Hello, one. Welcome to this ethical hacking tools with Python video In today's lesson, we're going to address the need for Python in cyber security.
So here's a brief overview of what we're gonna cover.
We're going to look into what it means to work in cyber security and the practical nature of many of the jobs in this field. Now, this same practical nature as well as the methodical aspect of many practices. Most often they're not calls for automation.
And what better way to do automation than python?
Okay, so let's consider the following scenario.
You work as a penetration tester for a large cyber security company. Your team has been assigned a number of targets toe assess their security.
Each one of your colleagues has been given precise instructions by the team leader in terms of what to do and what tools to use.
You are in charge of finding all open ports on each target, as well as fingerprinting the operating system.
How will you actually approach this?
um, you know, a couple of tools that might help you achieve your goals. You could use and map
with a different parameters set in as well as multiple runs of and map to cross. Check the validity of your results.
Now this would require you to manually right and run each of the commands.
There's nothing wrong with that, of course, but if you have to do the same thing for each target and then save all the output by copying and based in get the report filed,
this might become very boring and repetitive.
So how else could you tackle this problem in a more efficient way?
Now this is where a cold to automation makes really good sense.
What does that mean?
Well, in this particular scenario, automation means having the entire process were at least a very large part of it. Put on autopilot.
You'd have to define a clear objective of the automation process so that you would know exactly when and what scenario it can be. Applied
automation allows you to take your hands off the process itself, making it much more efficient, less prone to error if it's designed appropriately, of course, and the last time consuming,
which would allow you to focus on other aspects of the request, which actually would need hands on attention.
So getting back to the question. How can you automate this?
you could use the Python programming language, which is very easy to understand, rapid to develop in. It has a clean syntax, and it's quite straightforward
due to its open nature. There are thousands of libraries built in python that allow you tow
achieve your objective in just a few lines of code. In our particular case, by phone and map would be this library.
Okay, let's stop for a moment and do a quick knowledge check.
So what is a good tool to use for network and target scanning? Is it Ennis? Look up and map or derby?
Okay, so let's take them one by one.
Anna's look up is a two fork wearing Deanna's information, so that's actually not it.
Derby. If you're familiar with Ben, Testing Tools is a Web directory. Brute force, sir. So that's not the answer, either,
which makes B and map or only choice for the right answer. So, and map is, ah, a too that lets you do very customized scanning over the network
as well as on individual targets now
getting back toe our main thread.
So by phone and map
is a Python library that allows us to extend sheet and run multiple and map scans programmatically or by writing lines of code.
In this case, we would write a Python script to run each scan sequentially and save the output of each of these scans to file.
We could then use by phone for OS fingerprinting, or we could simply do a ping from within by phone to that host. And based on the response of the pink, we would determine the OS. Of course, all this would be done from a single script,
so when the script is completed, we would just run it
and all of the commands would be executed. So a simple python auto and map dot p y
to the target would achieve our goals in just one instruction instead of having multiple lines
in the terminal.
So I hope that by now you understand the power of automation and how knowing howto work with programming or scripting language is like Python
will make your cyber security assessments much more efficient and less time consuming.
All right, it's time for another quick knowledge check.
So how can you oughta make your cyber security assessments?
Is it a by typing the commands and multiple terminals. Be by typing the commands faster, or see by using a programming language such a spy phone.
Let's take them one by one, so typing the commands in multiple terminals
will probably much run the scans in parallel. But this is not automation, so a is a wrong answer.
Typing the commands faster is not automation, either, because you have to type. Each commend itself, so the is also wrong.
Which leads us to see writing
a script and by phone to run all the commands and then executing the script. This is automation, so see is the right one.
Okay, so what have we learned today? Well,
we learned that there's a lot of hands on working many several security practices. Good automation will make the entire process less prone to error. And ultimately, we learned that Python will help us put things on autopilot when it comes to our cyber security assessments.
Next we'll start looking into hot water mate information gathering,
and we'll take a quick glance at the typical penetration testing process. I am Christian, and I'm looking forward to seeing you in the next video