A Look at ChatGPT from a Hacker’s POV

Cipheras
7 min readDec 7, 2022

--

Photo by Kevin Ku on Unsplash

What is ChatGPT?

ChatGPT is a language model developed by OpenAI. It has been trained on a large dataset of conversational text and is designed to generate human-like responses to a wide range of topics. It was released on 30th Nov, 2022. One of the key features of ChatGPT is its ability to generate coherent and engaging responses to open-ended questions. This makes it particularly useful for applications such as chatbots and virtual assistants, where the ability to maintain a natural conversation is essential. It has a memory to remember your old questions and its responses.

A Cyber Security Professional’s POV

As a hacker, looking at ChatGPT from a different perspective can be very interesting. This powerful language model developed by OpenAI has the ability to generate human-like responses to a wide range of topics, making it a valuable tool for anyone interested in natural language processing and conversational AI. But from a hacker’s point of view, ChatGPT also presents some potential vulnerabilities that could be exploited. For example, a hacker could potentially use ChatGPT to create a very convincing chatbot that could be used to scam people. The chatbot could engage in natural conversation with the victim, gathering sensitive information such as login credentials or financial information. Another potential use of ChatGPT by a hacker could be to generate spam messages or phishing emails that are designed to trick people into clicking on malicious links. Because ChatGPT is able to adapt to different writing styles and tones, it could be used to create spam messages that are tailored to the individual recipient, making them more convincing and harder to detect.

ChatGPT can assist cybersecurity professionals in SIEM, IAM, DevSecOps, Data Privacy, SOC, VAPT, SAST/DAST, Malware Analysis, etc.

Interesting Potential Use-Cases

It has been only a week of ChatGPT release at the time of writing this article and many curious people have already found interesting ways of using this AI. Let’s see some of them.

1. Smart Contract code analysis / SAST:

This one is my favorite that’s why I kept it on top. ChatGPT can find vulnerabilities in smart contracts. Imagine, integrating it with smart contract scanners before deploying the contract on the blockchain. It can save million of dollars for the Crypto industry lost because of the hacks. Blockchain automates a lot of things, so of course an automated AI based smart contract code analyzer is a good idea.

Source: Twitter

2. Use-cases in Penetration Testing:

There’s also something for you, Bug Bounty hunters. ChatGPT can generate quick payloads to use, while performing penetration testing. It can even recognize known vulnerabilities.

Source: Twitter

Wanna generate an exploit for a known attack like log4shell, here you go:

log4shell exploit

It can even generate bug bounty report for you:

Bug bounty report

3. Automated Compliance and Auditing:

One potential use case for ChatGPT in cybersecurity auditing is automated compliance checks. ChatGPT could be used to automatically check for compliance with cybersecurity regulations and standards, such as the PCI DSS or HIPAA. This could include checking for vulnerabilities in systems and networks, verifying the configuration of security controls, and ensuring that proper security procedures are being followed.

Another potential use case is generating reports on the state of the organization’s security posture. ChatGPT could be used to collect and analyze data from various sources, such as system logs and security assessments, to provide a comprehensive overview of the organization’s security posture. This could include details on threats, vulnerabilities, and incidents, as well as recommendations for improving security.

4. Use-cases in DevSecOps / SOC:

Create scripts using ChatGPT in language of your choice and integrate them with your deployed tools/platforms. It can be integrated with coding IDEs and help do secure coding. Some other examples include:

Automated incident response: In the event of a security incident, chatGPT could be used to automatically respond to and triage the issue. This could include identifying the source of the incident, determining the potential impact, and providing guidance on next steps for addressing the issue.

Security compliance checks: chatGPT could be used to automatically check for compliance with security policies and regulations. This could include checking for vulnerabilities in code, verifying the configuration of security controls, and ensuring that proper security procedures are being followed.

Security training: chatGPT could be used to provide training to developers and other team members on security best practices. This could include interactive tutorials on topics such as secure coding, incident response, and compliance.

Real-time security monitoring: chatGPT could be used to monitor system logs and other data sources in real-time, alerting the DevSecOps team to potential security issues as they arise.

Overall, ChatGPT has the potential to greatly improve the efficiency and effectiveness of the DevSecOps and SOC process by automating many of the tasks and responsibilities involved in maintaining secure and compliant systems.

Wanna create an EC2 instance with EvilGinx2 and do social engineering simulation in just few minutes. Here you go:

Python script

5. Generating YARA rules:

It can even create YARA rules for detecting patterns. Malware analysts take note.

YARA rule for XSS detection

6. Use-cases in SIEM:

Wanna get free alerts from your Elasticsearch deployment, here you go. You can generate code/scripts according to your own deployment and SIEM tools.

Python script for email alerts

7. Red Teaming / Breach and Attack Simulations:

There are no limits, there is something for everyone in the cybersecurity field. You can even create simple Malware and Ransomware for Red Teaming exercises and simulations. However, it only creates simple ones but imagine if it can create this much by itself, what it can do if ChatGPT’s assistance is taken in creating a full fledged malware. AV company’s headache is going to increase😄.

Sample malware

8. Malware Analysis and Reverse Engineering:

It can de-compile assembly codes and malwares. Yes you heard it right, it can help you in reverse engineering. You can even integrate it with IDA to directly analyze the de-compiled code. Here is the GitHub reference for it. It is very useful for malware analysts. It can recognize patterns and help understand codes quickly. It is like a very intelligent assistant for you which can increase your productivity.

C code analysis

9. Malware Obfuscation Research:

ChatGPT can write simple codes in multiple languages for malwares and can even obfuscate it to a certain level with different techniques. It can help researchers to create shellcodes and understand advance obfuscation techniques which adversaries use in malwares. We can write code in one language and can get its equivalent in another in just few seconds using ChatGPT.

One amazing thing about ChatGPT is that it has a memory and it can remember the responses. We can use this to improve the quality of code and techniques it can create.

Obfuscated reverse shell in GO

From signature recognition to behavior based detection we have come a long way in malware detection. Soon, we may see AI generated code snippets in malwares and it will take an AI to battle an AI.

10. Solving and creating CTF challenges:

Interestingly, not only can ChatGPT solve CTF challenges it can also create CTF challenges. Good for the college CTF challenge creators and PT trainers.

Source: Twitter

11. Use as a VM simulator for Network Admins:

Yes, it can be used as a VM simulator too. Check this blog for more:
https://www.engraved.blog/building-a-virtual-machine-inside/

12. Something for Game hackers too:
@LiveOverflow tried Minecraft hack using ChatGPT. Checkout his video on YouTube.

13. Bonus use-case:

It can also help you prepare for a cybersecurity job interview😉.

Simulate interview

Final Words

The list goes on. People are still playing with ChatGPT to see what it can do and what are its limits. Till the time it gets full fledged AI, it is just an assistant for the work in our particular domains to save our time.
Overall, while ChatGPT is a powerful and versatile tool, it is important to be aware of its potential vulnerabilities and take steps to protect against them. As a hacker, it is important to always be on the lookout for potential vulnerabilities and to use your skills for good rather than for malicious purposes.

--

--