The Future Of Hacking: OpenAI’s GPT-4 Code Interpreter

Dexter Ng (Chief Technology Officer · Privacy Ninja)

HITBSecConf2023 - Phuket · Day 2 · CommSec Track

Overview

In this compelling talk at HITB Phuket, Dexter Ng, Chief Technology Officer of Privacy Ninja, illuminated the transformative impact of OpenAI's GPT-4 Code Interpreter on the cybersecurity landscape. Ng’s presentation, titled "The Future Of Hacking," meticulously explored how this advanced artificial intelligence tool is rapidly reshaping both offensive and defensive security strategies. The talk underscored the critical need for security professionals to understand and leverage AI, not only to enhance their own capabilities but also to anticipate and counter the evolving tactics of malicious actors.

Watch on YouTube

Visual summary for The Future Of Hacking: OpenAI’s GPT-4 Code Interpreter by Dexter Ng
Visual summary for The Future Of Hacking: OpenAI’s GPT-4 Code Interpreter by Dexter Ng

Key moments

  1. 0:00 Speaker intro & AI's role in cybersecurity
  2. 4:30 Microsoft Security Copilot for incident response
  3. 9:20 AI for generating WAF rules and bridging knowledge gaps
  4. 12:50 Dark side: AI-generated phishing emails and social engineering
  5. 22:00 AI as data scientist: AWS log and data analysis
  6. 32:00 Smart contract vulnerability auditing using ChatGPT
  7. 36:59 Q&A: Addressing AI hallucinations and debugging scripts

The Future Of Hacking: OpenAI’s GPT-4 Code Interpreter

Speakers: Dexter Ng, Chief Technology Officer, Privacy Ninja

Conference: HITB Phuket

YouTube: https://www.youtube.com/watch?v=eghXRr0SQd8

Overview

In this compelling talk at HITB Phuket, Dexter Ng, Chief Technology Officer of Privacy Ninja, illuminated the transformative impact of OpenAI's GPT-4 Code Interpreter on the cybersecurity landscape. Ng’s presentation, titled "The Future Of Hacking," meticulously explored how this advanced artificial intelligence tool is rapidly reshaping both offensive and defensive security strategies. The talk underscored the critical need for security professionals to understand and leverage AI, not only to enhance their own capabilities but also to anticipate and counter the evolving tactics of malicious actors.

Ng emphasized that AI, once considered a fleeting trend, has solidified its position as an indispensable technology. Citing ChatGPT's unprecedented growth to 1 million users in just five days, he highlighted AI's pervasive integration across various sectors, including Microsoft's Microsoft 365 Copilot and Microsoft Security Copilot. The core message revolved around AI's dual-use nature: its potential to bridge knowledge gaps, automate complex tasks, and improve communication for security teams, while simultaneously empowering adversaries with sophisticated tools for social engineering, malware generation, and automated attacks.

This article delves into Ng's insights, providing a comprehensive analysis of the Code Interpreter's functionalities, its practical applications in penetration testing and incident response, and the profound implications for defensive strategies. It aims to equip readers with a deeper understanding of how AI is fundamentally altering the cybersecurity paradigm, necessitating a proactive and adaptive approach from all stakeholders.

Background

▶ Watch: Speaker intro & AI's role in cybersecurity (0:00)

The rapid evolution of Large Language Models (LLMs) like OpenAI's ChatGPT has marked a significant paradigm shift in human-computer interaction and problem-solving. Initially launched as a text-based conversational AI, ChatGPT's capabilities expanded dramatically with the introduction of the Code Interpreter feature. This enhancement allows users to upload, execute, and analyze code snippets and various file types—including Excel spreadsheets, smart contracts, and even raw log data—directly within the AI environment. This pivotal development transformed ChatGPT from a mere text generator into a powerful analytical and execution engine, making it particularly relevant for technical fields like cybersecurity.

Dexter Ng highlighted that the notion of AI being a "fad" is unequivocally outdated. The sheer speed of adoption, with ChatGPT reaching 1 million users in just five days, serves as undeniable proof of its immediate utility and enduring presence. This rapid integration is further exemplified by major industry players like Microsoft, which has deeply invested in OpenAI and embedded AI capabilities across its product suite. Tools such as Microsoft 365 Copilot and Microsoft Security Copilot demonstrate this commitment, offering AI-driven assistance for everything from document creation to threat intelligence analysis, streamlining workflows for security analysts and enabling them to extract actionable insights from vast datasets.

The emergence of the Code Interpreter specifically addresses long-standing challenges in cybersecurity, particularly the pervasive knowledge gap among security professionals and the persistent communication breakdown between technical experts and non-technical management. Ng underscored that not all pentesters or bug bounty hunters possess expertise in every programming language, forensic technique, or SOC operation. AI offers a powerful solution by providing on-demand explanations, step-by-step guides, and code generation capabilities, effectively democratizing access to specialized knowledge. Furthermore, its ability to translate complex technical findings into layman's terms or executive summaries directly tackles the communication barrier, enabling clearer reporting and more informed decision-making for organizational leadership.

Key Findings

▶ Watch: AI for generating WAF rules and bridging knowledge gaps (9:20)

Dexter Ng's presentation unveiled several key findings regarding the multifaceted impact of OpenAI's GPT-4 Code Interpreter on cybersecurity. The overarching theme is the tool's dual-use nature, empowering both security professionals and malicious actors with unprecedented capabilities.

Firstly, AI significantly bridges knowledge gaps within cybersecurity teams. Ng demonstrated how the Code Interpreter can serve as an on-demand expert, providing step-by-step guides for unfamiliar domains like bug bounty hunting or digital forensics, and explaining complex concepts such as reflected XSS with code examples. This functionality ensures that team members, regardless of their specialization, can quickly acquire necessary information, leading to a more unified and knowledgeable workforce.

Secondly, the Code Interpreter drastically improves communication between technical and non-technical stakeholders. Ng highlighted the common struggle of security analysts explaining intricate vulnerabilities or incident responses to CEOs. The AI's ability to generate simplified, layman's explanations, executive summaries, and even visual flowcharts for incident activity (e.g., ransomware attacks) directly addresses this challenge, fostering better understanding and faster decision-making.

Thirdly, AI automates and enhances various offensive security tasks. Ng showcased its utility in generating sophisticated social engineering content, such as highly convincing phishing emails, which dramatically increase conversion rates for attackers. He also illustrated how it can generate malware code, attack payloads (e.g., WAF bypasses), reverse shells, and even detailed penetration testing methodologies for specific targets, accelerating the development of offensive tools and strategies.

Fourthly, the tool offers powerful capabilities for defensive analysis and automation. Ng demonstrated its ability to analyze vast AWS logs in minutes, identifying suspicious activities and IP addresses that would traditionally take hours or days of manual effort. It can also generate Web Application Firewall (WAF) rules for platforms like Azure WAF and Cloudflare, detect SQL injection patterns, and even perform rudimentary smart contract audits by breaking down complex code and flagging potential vulnerabilities.

Finally, Ng underscored the evolving threat landscape where bad actors are leveraging AI to scale their operations. The ease with which the Code Interpreter can generate highly effective phishing emails, craft advanced malware (as seen with "Python stealer" improvements), and bypass initial safety measures through "jailbreaks" presents a significant and growing risk. This necessitates that defenders not only understand these capabilities but also integrate AI into their own defensive strategies to keep pace. The talk concluded that while AI offers immense benefits, it also demands continuous vigilance and adaptation from the cybersecurity community.

Technical Deep Dive

▶ Watch: Dark side: AI-generated phishing emails and social engineering (12:50)

The GPT-4 Code Interpreter serves as a versatile toolkit for both offensive and defensive cybersecurity operations, demonstrating its profound impact across various technical domains. Dexter Ng provided numerous practical examples illustrating its capabilities.

Offensive Applications

For penetration testers and bug bounty hunters, the Code Interpreter can significantly streamline and enhance attack methodologies:

  • Social Engineering and Phishing: Ng demonstrated how a simple prompt like "create example fishing email for me to showcase to a cyber security conference for educational demo" yields a highly convincing phishing email template. The AI can generate urgent narratives (e.g., "unusual transactions," "temporarily frozen account"), include customizable elements like recipient names, merchant details, and even suggest adding emojis to increase click-through rates. Crucially, it advises on making links malicious, highlighting its potential for misuse by attackers. Ng noted the significant increase in conversion rates for phishing campaigns due to AI's ability to correct "broken English" and craft compelling narratives.
  • Malware and Payload Generation: Early versions of ChatGPT, before stringent safety measures, could generate "advanced malware" directly. While OpenAI has implemented restrictions, Ng explained that "jailbreaks" (e.g., framing requests as virtual world scenarios or teaching exercises) can still circumvent these controls, allowing the generation of malicious code. He cited the "Python stealer" phenomenon, where existing malware scripts were uploaded to the Code Interpreter, which then "improved" them, making them more advanced and potent.
  • Custom Scripting and Automation: For tools like Nuclei, widely used for vulnerability scanning and automation, the Code Interpreter can generate custom templates and automation scripts. Users can upload existing scripts or describe desired functionalities, and the AI will refine or create new ones, significantly accelerating the development of specialized scanning capabilities.
  • Reverse Shells: Ng showed that the AI can generate functional Python scripts for reverse shells, offering multiple recommendations based on specific requirements. This capability rapidly provides attackers with essential post-exploitation tools.
  • WAF Bypass and Custom Payloads: The Code Interpreter can assist in writing custom payloads to bypass firewalls. By providing details about the firewall type and version, users can receive more tailored and effective bypass techniques, demonstrating its utility in evading defensive measures.
  • Burp Suite Extensions: For advanced users, the AI can help in writing Burp Suite extensions, enabling the creation of highly customized tools for web application penetration testing, integrating specific payloads and logic.
  • SQL Injection Debugging: Ng illustrated how to paste SQL code into the Code Interpreter for debugging. Beyond fixing errors, it can add line comments in layman's terms, making complex SQL injection vulnerabilities understandable for non-technical stakeholders during presentations or reports.
  • Subdomain Enumeration: The AI can generate a step-by-step guide for subdomain enumeration, recommending tools and commands. For instance, it can suggest using BuildWith to identify technologies and then leverage Shodan for potential vulnerabilities, or list online tools for gathering subdomains, aiding in reconnaissance phases.
  • Penetration Testing Methodologies: For new bug bounty hunters or pentesters, the Code Interpreter can create a detailed "cheat sheet methodology" for a full penetration test, outlining steps from scope definition to information gathering (with recommended tools) and exploitation techniques (e.g., misconfigurations, API testing).

Defensive and Analytical Applications

The Code Interpreter is equally powerful for defensive operations, enhancing analysis, knowledge transfer, and communication:

  • Bridging Knowledge Gaps: Ng emphasized its role in educating security professionals on unfamiliar topics. A pentester unfamiliar with SOC operations or forensics can ask for a "step-by-step guide" or explanations of complex terms. For bug bounty newcomers, it can outline "how to proceed" with their first hunt.
  • WAF Rule Generation: The AI can generate Web Application Firewall (WAF) rules for platforms like Azure WAF or Cloudflare. Users can specify conditions, such as detecting SQL injection, and the AI will produce the necessary rule sets, significantly speeding up defensive control implementation.
  • Code Comprehension and Security Concerns: When encountering unfamiliar code (e.g., a login function written in Ruby), users can paste it into the Code Interpreter. It will explain each line, identify the programming language, and—critically—point out "potential security concerns," saving analysts considerable time in code review.
  • AWS Log Analysis: A significant demonstration involved uploading a raw AWS log file. The Code Interpreter instantly analyzes it, breaking down user actions, login distributions, and actions from specific IP addresses. Users can then ask it to "find me the most suspicious thing in this AWS log," and the AI will provide immediate insights, compressing hours of manual analysis into minutes.
  • Data Cleaning and Manipulation: For security professionals dealing with large datasets, such as password lists or fuzzing payloads, the Code Interpreter can act as a "personal data scientist." It can merge disparate password files (like the RockYou list with new data breaches), "enhance" password lists for brute-forcing, and "remove duplicates," then provide a clean, consolidated file for download. This is invaluable for preparing data for various security tests.
  • Smart Contract Auditing: A highly advanced application is smart contract auditing. Ng showed uploading a .sol (Solidity) file. The AI immediately breaks down the contract, explaining each function (e.g., balance, allowance, transfer), permissions, and total supply. It can detect "evil codes" injected by outsourced programmers, serving as a cost-effective and immediate checker for code updates in Web3.0 projects. It then generates both a "technical summary" for developers and an "executive summary" in layman's terms for the CEO, simplifying complex audit findings.
  • Enhanced Communication: The AI excels at "dumbing down" technical explanations. Ng suggested prompts like "explain it to me as if you are speaking to a child" to simplify concepts like regression analysis or the implications of a specific vulnerability for non-technical audiences. This functionality is crucial for client presentations, internal training, and executive briefings.

Practical Considerations

Ng highlighted that while powerful, the Code Interpreter is not infallible. It can suffer from "hallucinations" or generate errors. However, he provided a crucial workaround: copy-ppasting the error messages back into ChatGPT. The AI will then attempt to debug and fix its own code, often through several iterations, demonstrating its self-correction capabilities. He also advised against pasting entire large codebases at once, suggesting breaking them into sections for more accurate bug fixes.

In essence, the Code Interpreter empowers both sides of the cybersecurity coin, demanding that practitioners on both offense and defense master its use to stay ahead in an increasingly AI-driven threat landscape.

Demo / Proof of Concept

▶ Watch: Smart contract vulnerability auditing using ChatGPT (32:00)

Dexter Ng's presentation served as a comprehensive demonstration of the GPT-4 Code Interpreter's capabilities through a series of practical, screenshot-based examples. While not a live, interactive demo, each segment effectively illustrated how specific prompts and file uploads yield powerful cybersecurity insights and tools.

One of the most striking demonstrations involved phishing email generation. Ng showed a prompt asking the AI to "create example fishing email for me to showcase to a cyber credit conference for educational demo." The resulting output, presented on screen, was a highly convincing email template, complete with urgent language about "unusual transactions," a call to "validate transaction" via a malicious link, and customizable fields for names and merchant details. This segment clearly demonstrated the AI's ability to craft sophisticated social engineering campaigns with minimal input.

Another key proof of concept involved WAF rule creation. Ng demonstrated how the Code Interpreter could generate specific rules for platforms like Azure WAF to detect SQL injection, highlighting its utility in automating defensive measures. Similarly, for code comprehension, he showed an example of pasting a Ruby login function, where the AI not only explained each line of code but also identified potential security concerns within it, acting as an instant code auditor.

The power of data analysis was vividly illustrated with the AWS log file upload. Ng displayed how a complex log file, once uploaded, was immediately analyzed by the AI, breaking down user actions, login patterns, and suspicious IP addresses. The subsequent prompt, "find me the most suspicious thing in this AWS log," showcased the AI's ability to extract actionable intelligence from vast datasets in moments.

Furthermore, Ng demonstrated the Code Interpreter's data manipulation prowess by showing the upload of a password list (RockYou.txt). He then explained how prompts could be used to merge this list with new data breaches, remove duplicates, and enhance it for brute-forcing, illustrating its value for preparing offensive security resources.

Perhaps one of the most advanced demonstrations was smart contract auditing. Ng presented the process of uploading a .sol (Solidity) file. The AI's output meticulously broke down the contract's functions, identified permissions, and even advised on potential vulnerabilities, culminating in both a technical and an executive summary. This highlighted the Code Interpreter's capacity to perform complex, specialized audits without requiring deep human expertise in Solidity.

Throughout these examples, Ng effectively conveyed that the Code Interpreter is not merely a theoretical tool but a practical, hands-on assistant for a wide array of cybersecurity tasks, from crafting attacks to streamlining complex analytical processes and generating accessible reports.

Defensive Implications

▶ Watch: Q&A: Addressing AI hallucinations and debugging scripts (36:59)

The advent of OpenAI's GPT-4 Code Interpreter presents a double-edged sword for cybersecurity defenders, introducing both heightened threats and powerful new defensive capabilities. Organizations and security professionals must proactively adapt to this evolving landscape.

Increased Threat Landscape:

  • Sophisticated Social Engineering: The most immediate and pervasive threat is the proliferation of highly convincing phishing and spear-phishing campaigns. As Ng demonstrated, AI can generate grammatically flawless, contextually relevant, and emotionally manipulative emails, significantly increasing the success rate of these attacks. Defenders must invest more heavily in security awareness training that focuses on critical thinking and identifying subtle cues, rather than just grammatical errors.
  • AI-Enhanced Malware: The "Python stealer" example illustrates how existing malware can be refined and made more potent by AI. This suggests a future where malware development is accelerated, and its complexity increases, potentially bypassing traditional signature-based detection. Defenders need to pivot towards more advanced behavioral analytics, endpoint detection and response (EDR), and threat intelligence that tracks AI-driven attack patterns.
  • Automated Reconnaissance and Exploitation: AI can automate information gathering (e.g., subdomain enumeration) and even suggest exploitation paths. This means attackers can conduct reconnaissance and develop custom payloads faster and with less human effort. Organizations must strengthen their vulnerability management programs, conduct continuous security testing, and implement robust patch management to reduce the attack surface.

Empowering Defenders:

  • Bridging Knowledge Gaps and Training: The Code Interpreter can serve as an invaluable internal training tool. New hires or specialists crossing domains can quickly learn about SOC operations, digital forensics, bug bounty methodologies, or unfamiliar programming languages (e.g., Ruby) by asking the AI for explanations and step-by-step guides. This fosters a more agile and knowledgeable security team.
  • Accelerated Analysis and Incident Response: Ng's demonstration of AWS log analysis is a game-changer. What once took hours or days of manual correlation can now be done in minutes, allowing security analysts to rapidly identify suspicious activities, IP addresses, and user behaviors during an incident. This significantly reduces mean time to detect (MTTD) and mean time to respond (MTTR).
  • Automated Security Control Development: The ability to generate WAF rules for platforms like Azure WAF and Cloudflare, or to suggest SQL injection detection patterns, enables faster deployment of defensive controls. This automation can free up security engineers to focus on more complex architectural challenges.
  • Enhanced Code Review and Auditing: For development teams, the AI can act as an initial layer of static application security testing (SAST) by explaining unfamiliar code and flagging potential security concerns. Its application in smart contract auditing is particularly significant for Web3.0 projects, offering a faster and more accessible way to identify vulnerabilities in critical blockchain code.
  • Improved Communication and Reporting: One of the most critical defensive implications is the AI's ability to translate complex technical findings into layman's terms and executive summaries. This facilitates better communication with C-suite executives and non-technical stakeholders, ensuring that security risks are understood and acted upon, leading to more informed decision-making and better resource allocation for security initiatives.
  • Data Management for Threat Intelligence: The AI's capability to clean, merge, and enhance large datasets (e.g., password lists, fuzzing payloads) can be used by defenders to improve their own threat intelligence feeds and develop more robust testing scenarios.

In summary, while AI amplifies existing threats, it also provides defenders with powerful tools to combat them. The key for defensive security is to integrate AI strategically into daily operations, leverage its analytical and communicative strengths, and maintain constant vigilance against AI-driven adversarial advancements, always remembering the need for human oversight and validation of AI-generated outputs.

Key Takeaways

  • AI is a Dual-Use Cybersecurity Tool: OpenAI's GPT-4 Code Interpreter significantly enhances capabilities for both offensive (e.g., sophisticated phishing, malware generation, automated reconnaissance) and defensive (e.g., log analysis, WAF rule creation, smart contract auditing) cybersecurity operations.
  • Bridges Knowledge Gaps and Improves Communication: The Code Interpreter is invaluable for rapid skill acquisition, offering step-by-step guides and explanations for unfamiliar domains. Crucially, it translates complex technical findings into layman's terms and executive summaries, drastically improving communication between technical teams and non-technical stakeholders.
  • Accelerates Threat Development: Malicious actors can leverage AI for faster and more effective social engineering, advanced malware generation (e.g., Python stealer improvements), and automated payload creation, necessitating heightened defensive vigilance.
  • Empowers Defenders with Automation and Analysis: Defenders can utilize AI to analyze vast datasets like AWS logs in minutes, automate the creation of security controls (e.g., WAF rules), perform initial code reviews, and streamline incident response, thereby reducing MTTD and MTTR.
  • Revolutionizes Smart Contract Auditing: The Code Interpreter can break down and analyze smart contract code (e.g., .sol files), identify vulnerabilities, and generate comprehensive audit reports, offering a cost-effective and rapid solution for Web3.0 security.
  • Human Oversight Remains Critical: Despite its power, AI is prone to "hallucinations" and errors. Continuous human testing, validation, and iterative debugging (by feeding errors back into the AI) are essential to ensure the accuracy and reliability of AI-generated code and insights.

About the Speaker(s)

Dexter Ng is the Chief Technology Officer at Antix and Privacy Ninja, a cybersecurity company based in Singapore. His expertise spans a broad range of security domains, including data protection officer (DPO) outsourcing and penetration testing, with his company having conducted over 450 engagements in Singapore alone. Ng is also highly experienced in OSINT (Open Source Intelligence) and forensic investigations, having assisted government organizations in Asia with cases ranging from riot masterminds in Thailand and Hong Kong to ransomware attacks and data breaches in Singapore. Beyond his security roles, he possesses a strong background in web, mobile app, and blockchain development, giving him a comprehensive understanding of both offensive and defensive security challenges across various technological stacks.

Reviews

Dr. Zero (Offensive Security Researcher) — WEAK

A surface-level tour of ChatGPT prompts dressed up as 'the future of hacking.' No original research, no novel techniques, no depth beyond 'look what happens when I paste this into the box.' This is a 2022 blog post stretched into a conference slot.

Heather Calloway (CISO) — WEAK

A surface-level tour of ChatGPT prompts that any security practitioner could discover in an afternoon. No novel insight, no threat modeling rigor, no program-level guidance. Not worth leadership time.

→ Top-rated talks at HITBSecConf2023 - Phuket

All talks from HITBSecConf2023 - Phuket