There’s a Snake in My Boot Drive

Python is a high-level, object-oriented programming language with an easy-to-learn syntax that can benefit programmers of all skill levels. It is miles away from the complexities of managing computer memory, abstracting away these concepts, which are unnecessary anachronisms to the modern pragmatic programmer, and letting you get on with the important stuff.

The Python programming language is the top choice among cybersecurity professionals due to the vast number of powerful third-party libraries available. The ability to use these libraries to do the heavy lifting greatly reduces the time required to piece together scripts and develop applications. Python is also highly versatile: Security professionals can use it to write software for penetration testing, web development, applications or to simply throw a quick script together.

Sssscript Kiddies

It is well-known that the difference between being a script kiddie and a legitimate, card-carrying hacker is the ability to write your own code and tooling to perform better security assessments. Making the leap from blindly using shrink-wrapped code to creating and working with bespoke tooling can seem a bit daunting to newbie ethical hackers. Luckily, one area of security where Python has found a particularly strong (and slithery) grip is in the penetration testing industry.

Python has been used to create all kinds of well-known tools that would be instantly familiar to any hardened member of the security community. These include everything from simple scripts to full-blown exploit frameworks.

Let’s Get Modular

Due to Python’s widespread uptake, a penetration tester who has gained access to an endpoint will likely find Python installed, meaning that the programming language can be used to create code that manages networking. This is important if you are performing a penetration test because, upon gaining access to a target machine, you will be greeted with the grim reality that the hacking tools you know and love are nowhere to be found. This means that you occasionally need to make your own. Python has a particularly useful module called socket, which gives hackers all the tools they need to set up and execute basic network tasks.

Another very powerful module well worth your time and research is Scapy. This adds protocol analyzer (packet sniffer) capabilities to your Python code and can be used to read traffic, perform Address Resolution Protocol (ARP) cache poisoning, set up man-in-the-middle (MitM) attacks and more.

But Python tooling isn’t just used by white hats; black-hat fraudsters used the language in the 2016 ransomware CryPy, which used the power of Python to innovate on the ransomware genre. It would be very unsurprising to see more and more threats being perpetrated with Python in the near future. Like traditional software development, the cybercrime industry is driven by quick time to value and the ability to stay agile and ahead of competitors. Python is designed with fast, efficient development in mind.

Add Python Programming Language to Your Skillset

Not only is Python the preferred language for penetration testers, it is also a language of choice for service professionals when configuring and integrating security tooling. For example, many application frameworks use Python, as do the application programming interface (API) examples provided on the IBM Security Intelligence GitHub.

Many incident response platforms come with Python modules, which provide a framework for writing action processors and API integrations. IBM product professional services integration engineers frequently build reusable Python modules for common customer integrations such as ServiceNow, Splunk and JIRA.

When you put it all together, you have a fast, efficient language with wide uptake, many cybersecurity applications and all the modules you need to get started fast. It’s easy to see why this is becoming a must-have skill for operating in the security industry, and why the Python programming language is a part of some of the most cutting-edge tooling out there.

More from Application Security

PixPirate: The Brazilian financial malware you can’t see

10 min read - Malicious software always aims to stay hidden, making itself invisible so the victims can’t detect it. The constantly mutating PixPirate malware has taken that strategy to a new extreme. PixPirate is a sophisticated financial remote access trojan (RAT) malware that heavily utilizes anti-research techniques. This malware’s infection vector is based on two malicious apps: a downloader and a droppee. Operating together, these two apps communicate with each other to execute the fraud. So far, IBM Trusteer researchers have observed this…

From federation to fabric: IAM’s evolution

15 min read - In the modern day, we’ve come to expect that our various applications can share our identity information with one another. Most of our core systems federate seamlessly and bi-directionally. This means that you can quite easily register and log in to a given service with the user account from another service or even invert that process (technically possible, not always advisable). But what is the next step in our evolution towards greater interoperability between our applications, services and systems?Identity and…

Audio-jacking: Using generative AI to distort live audio transactions

7 min read - The rise of generative AI, including text-to-image, text-to-speech and large language models (LLMs), has significantly changed our work and personal lives. While these advancements offer many benefits, they have also presented new challenges and risks. Specifically, there has been an increase in threat actors who attempt to exploit large language models to create phishing emails and use generative AI, like fake voices, to scam people. We recently published research showcasing how adversaries could hypnotize LLMs to serve nefarious purposes simply…

Topic updates

Get email updates and stay ahead of the latest threats to the security landscape, thought leadership and research.
Subscribe today