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

Does Follina Mean It’s Time to Abandon Microsoft Office?

As a freelance writer, I spend most of my day working in Microsoft Word. Then, I send drafts to clients and companies across the globe. So, news of the newly discovered Microsoft Office vulnerability made me concerned about the possibility of accidentally spreading malware to my clients. I take extra precautions to ensure that I’m not introducing risk to my clients. Still, using Microsoft Office was something I did many times a day without a second thought. I brought up…

3 Reasons Why Technology Integration Matters

As John Donne once wrote, “No man is an island entire of itself.” With digitalization bridging any distance, the same logic could be applied to tech. Threat actors have vast underground forums for sharing their intelligence, while security professionals remain tight-lipped in a lot of data breach cases. Much like the way a vaccine can help stop the spread of infectious diseases, sharing threat intelligence and defense strategies can help to establish a more secure future for everyone.  So what…

Why Your Success Depends on Your IAM Capability

It’s truly universal: if you require your workforce, customers, patients, citizens, constituents, students, teachers… anyone, to register before digitally accessing information or buying goods or services, you are enabling that interaction with identity and access management (IAM). Many IAM vendors talk about how IAM solutions can be an enabler for productivity, about the return on investment (ROI) that can be achieved after successfully rolling out an identity strategy. They all talk about reduction in friction, improving users' perception of the…

Controlling the Source: Abusing Source Code Management Systems

For full details on this research, see the X-Force Red whitepaper “Controlling the Source: Abusing Source Code Management Systems”. This material is also being presented at Black Hat USA 2022. Source Code Management (SCM) systems play a vital role within organizations and have been an afterthought in terms of defenses compared to other critical enterprise systems such as Active Directory. SCM systems are used in the majority of organizations to manage source code and integrate with other systems within the…