Promptmap – Tool to Test Prompt Injection Attacks on ChatGPT Instances

Prompt injection refers to a technique where users input specific prompts or instructions to influence the responses generated by a language model like ChatGPT.

However, threat actors mainly use this technique to mod the ChatGPT instances for several malicious purposes. It has several negative impacts like:-

  • Misinformation
  • Content bias
  • Offensive content
  • Manipulation

An independent security researcher, Utku Sen, recently developed and launched a new tool dubbed “promptmap” that will enable users to test the prompt injection attacks on ChatGPT instances.

Promptmap

On ChatGPT instances, the “promptmap” automatically tests the prompt injections by understanding the context and purpose of your rules configured on ChatGPT.

It uses this understanding to create custom attack prompts for the target, running them alongside your system prompts. While this tool checks for prompt injection success by analyzing the ChatGPT instance’s response.

Work Mechanism Structure (Source – GitHub)

Attack types

Here below, we have mentioned all the current attack types along with their details:-

  • Basic Injection: These attacks are straightforward, as they are sent without prompt enhancements, aiming for unrelated answers or actions.
  • Translation Injection: These attacks work by giving English prompts to ChatGPT without language restrictions to gauge if it responds in another language.
  • Math Injection: Getting ChatGPT to solve a math equation indicates its capability for complex tasks. However, attacks like math injection prompts can be customized for specific targets.
  • Context-Switch: Context-switching involves asking unrelated questions to measure the willingness of ChatGPT to answer sensitive queries that are mainly tailored to specific targets.
  • External Browsing: External browsing prompts allow the ChatGPT to browse specific URLs, and they are evolving based on the target’s needs.
  • External Prompt Injection: The External Prompt Injection asks ChatGPT if it’s possible for it to access specific URLs for additional prompts.

Installation

Here below we have mentioned the installation procedure:-

  • Clone the repository:

git clone https://github.com/utkusen/promptmap.git

  • Go inside the folder.

cd promptmap

  • Install required libraries

pip3 install -r requirements.txt

  • Open promptmap.py file and add your OpenAI API key into the following line: openai.api_key = “YOUR KEY HERE”

You can also change model names that are defined target_model and attack_model variables.

Moreover, with the help of the “python3 promptmap.py command,” the promptmap” can be run, and it defaults to 5 attack prompts per category, which is adjustable with the ‘-n’ parameter.

Keep informed about the latest Cyber Security News by following us on Google NewsLinkedinTwitter, and Facebook.

Gurubaran

Gurubaran is a co-founder of Cyber Security News and GBHackers On Security. He has 10+ years of experience as a Security Consultant, Editor, and Analyst in cybersecurity, technology, and communications.

Recent Posts

Subaru’s STARLINK Connected Car’s Vulnerability Let Attackers Gain Restricted Access

In a groundbreaking discovery on November 20, 2024, cybersecurity researchers Shubham Shah and a colleague…

3 hours ago

Android Kiosk Tablets Vulnerability Let Attackers Control AC & Lights

A security flaw found in Android-based kiosk tablets at luxury hotels has exposed a grave…

5 hours ago

CISA Releases Six ICS Advisories Details Security Issues

The U.S. Cybersecurity and Infrastructure Security Agency (CISA) issued six Industrial Control Systems (ICS) advisories…

6 hours ago

Juniper Routers Exploited via Magic Packet Vulnerability to Deploy Custom Backdoor

A sophisticated cyber campaign dubbed "J-magic" has been discovered targeting enterprise-grade Juniper routers with a…

7 hours ago

Beware of Fake Captcha Verifications Spreading Lumma Malware

In January, Netskope Threat Labs uncovered a sophisticated global malware campaign leveraging fake CAPTCHA pages…

7 hours ago

KEYPLUG Infrastructure Exposed: Server Configurations and TLS Certificates Revealed

In a recent technical investigation, researchers uncovered critical insights into the infrastructure linked to a…

7 hours ago