<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>From Chatbots to Phishbots?: Phishing Scam Generation in Commercial Large Language Models</title></titleStmt>
			<publicationStmt>
				<publisher>IEEE Computer Society</publisher>
				<date>05/20/2024</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10514634</idno>
					<idno type="doi"></idno>
					<title level='j'>2024 IEEE Symposium on Security and Privacy (SP)</title>
<idno></idno>
<biblScope unit="volume"></biblScope>
<biblScope unit="issue"></biblScope>					

					<author>Sayak Saha Roy</author><author>Poojitha Thota</author><author>Krishna Vamsi Naragam</author><author>Shirin Nilizadeh</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[The advanced capabilities of Large Language Models (LLMs) have made them invaluable across various applications, from conversational agents and content creation to data analysis, research, and innovation. However, their effectiveness and accessibility also render them susceptible to abuse for generating malicious content, including phishing attacks. This study explores the potential of using four popular commercially available LLMs, i.e., ChatGPT (GPT 3.5 Turbo), GPT 4, Claude, and Bard, to generate functional phishing attacks using a series of malicious prompts. We discover that these LLMs can generate both phishing websites and emails that can convincingly imitate well-known brands and also deploy a range of evasive tactics that are used to elude detection mechanisms employed by anti-phishing systems. These attacks can be generated using unmodified or "vanilla" versions of these LLMs without requiring any prior adversarial exploits such as jailbreaking. We evaluate the performance of the LLMs towards generating these attacks and find that they can also be utilized to create malicious prompts that, in turn, can be fed back to the model to generate phishing scams - thus massively reducing the prompt-engineering effort required by attackers to scale these threats. As a countermeasure, we build a BERT-based automated detection tool that can be used for the early detection of malicious prompts to prevent LLMs from generating phishing content. Our model is transferable across all four commercial LLMs, attaining an average accuracy of 96% for phishing website prompts and 94% for phishing email prompts. We also disclose the vulnerabilities to the concerned LLMs, with Google acknowledging it as a severe issue. Our detection model is available for use at Hugging Face, as well as a ChatGPT Actions plugin.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.">Introduction</head><p>In recent years, Large Language Models (LLMs) have brought a transformative era in natural language processing, being able to effortlessly generate responses that closely emulate human-like conversation across an increasingly diverse array of subjects. LLMs have also been utilized for various applications such as content creation for marketing <ref type="bibr">[1]</ref>, troubleshooting in software development <ref type="bibr">[2]</ref>, and providing resources for digital learning <ref type="bibr">[3]</ref>, to name a few. The vast utility of LLMs has also caught the attention of malicious actors aiming to exploit their capabilities for social engineer-ing scams, including phishing attacks <ref type="bibr">[4]</ref>, <ref type="bibr">[5]</ref>, <ref type="bibr">[6]</ref>. While these models are designed with safeguards to identify and reject potentially harmful or misleading prompts <ref type="bibr">[7]</ref>, <ref type="bibr">[8]</ref>, attackers can skillfully bypass these protective measures. This has led to the generation of malicious content, including deceptive emails <ref type="bibr">[9]</ref>, <ref type="bibr">[10]</ref>, <ref type="bibr">[11]</ref>, fraudulent investment and romantic schemes <ref type="bibr">[12]</ref>, and even malware creations <ref type="bibr">[13]</ref>, <ref type="bibr">[14]</ref>. Moreover, underground hacker forums are rife with discussions centered around manipulating LLMs for more advanced malicious endeavors <ref type="bibr">[15]</ref>, thus further encouraging newer attackers to adopt LLMs for their purposes.</p><p>Although open-source LLMs can be modified to produce malicious content, deploying local models demands significant hardware, time, and technical expertise <ref type="bibr">[16]</ref>. In contrast, commercially available LLMs like ChatGPT, Claude, and Bard are readily accessible to the public at no cost. These models are not only more convenient to access but are also backed by superior architectures that are proprietary <ref type="bibr">[17]</ref> and/or too resource-intensive for an individual to operate locally at scale. The ease and availability of these powerful models thus motivate attackers to abuse them to create social engineering scams such as phishing attacks. Phish attacks, once created, are disseminated widely through several online channels, with email being the most common form of transmission <ref type="bibr">[18]</ref>. Attackers craft emails that imitate a popular organization or familiar personality, with attempts to incentivize or imitate the potential victim into clicking on a website link <ref type="bibr">[19]</ref>, <ref type="bibr">[20]</ref>, <ref type="bibr">[21]</ref>. The link, which is the phishing website, is used as a medium to collect sensitive information (such as bank details, account credentials, and Social Security numbers) from the victim, which is then transmitted back to the attacker, who then can utilize it for nefarious purposes <ref type="bibr">[22]</ref>. The potential damage of phishing attacks is enormous, with reported financial losses of $52 million during the last year alone <ref type="bibr">[23]</ref>. As a countermeasure, anti-phishing measures -both commercial solutions <ref type="bibr">[24]</ref> and open-source implementations <ref type="bibr">[25]</ref>, <ref type="bibr">[26]</ref> continuously strive to take these attacks down quickly <ref type="bibr">[27]</ref>. However, attackers constantly innovate, employing various techniques to evade detection <ref type="bibr">[27]</ref>, <ref type="bibr">[28]</ref>, enabling the attacks to remain active for a long period of time <ref type="bibr">[29]</ref>.</p><p>Over time, knowledgable users have learned to recognize telltale signs of fake emails and websites, including grammatical errors, poor website design, and execution <ref type="bibr">[30]</ref>. In response, attackers employ phishing kits <ref type="bibr">[31]</ref>-automated tools that craft these malicious attacks with little to no manual intervention required. Anti-phishing strategies often focus on identifying these kits since detecting one helps them identify all attacks that originate from that kit itself <ref type="bibr">[32]</ref>, <ref type="bibr">[33]</ref>, <ref type="bibr">[34]</ref>. However, Large Language Models (LLMs) present an innovative alternative, leveraging natural language processing. LLMs have already demonstrated prowess in generating source code across various programming languages <ref type="bibr">[35]</ref>, <ref type="bibr">[36]</ref>. Thus, attackers could potentially prompt LLMs to craft phishing websites and emails and then use this content to orchestrate and unleash their attacks.</p><p>Our work aims to explore the extent to which commercially available LLMs can be leveraged for generating phishing attacks, identifying the effectiveness of these generated attacks with respect to functionality, and finally, building an effective countermeasure that can aid in the early detection of malicious prompts that can be used to generate such phishing scams. The paper is structured as follows: In Section 2, we explore the broad applications of Large Language Models (LLMs) alongside the challenges posed by their misuse in generating harmful content. In Section 3, we determine the general Threat Model that can be utilized to generate phishing attacks using commercial LLMs, which is followed by Section 4, where we introduce our methodology for identifying the feasibility and effectiveness of phishing scam generation using these commercial LLMs, as well as developing an ML-based model for the early detection of such malicious prompts. In Section 5, we focus on the generation of phishing websites using these commercial LLMs. Recognizing that these tools are adept at denying prompts with overt malicious intent, we have crafted a framework that provides multiple seemingly benign prompt sentences, either combined as a single prompt or given sequentially. Together, the final output of these prompts can result in creating phishing websites. We also test the capabilities of the LLMs at generating both regular and seven widely recognized evasive phishing attack vectors by manually designing malicious prompts. We investigate the recursive nature of LLMs in generating phishing content, illustrating how they can be repurposed to create an increasing array of phishing prompts. In a cyclic manner, feeding these prompts back into the LLM results in generating the source code of the phishing website. We assess the utility of these automated prompts in creating convincing phishing websites across all LLMs, judging them on both appearance and functionality.</p><p>We then discuss generating phishing emails using these LLMs in Section 6. Using the recursive nature of using LLMs to generate prompts, as mentioned in the previous paragraph, we generate prompts inspired by live phishing emails sourced from APWG eCrimeX <ref type="bibr">[37]</ref>. In a manner akin to our analysis of phishing websites, we also compare the proficiency of the LLMs in generating phishing emails using several text generation metrics. Finally, in Section 7, we design a machine learning model that can be used to detect malicious prompts in real time, thus preventing the LLMs from generating such phishing content. We primarily focus on the early detection of the phishing prompts such that the LLM can prevent the user from providing further prompts when phishing intention is detected.</p><p>The primary contributions of our work are: 1) We evaluate and compare how ChatGPT 3.5 Turbo, GPT 4, Claude, and Bard can be leveraged to produce both conventional and evasive phishing website attacks, as well as phishing emails. Our investigation reveals the potential for attackers to manipulate prompts, which not only allows evasion of the content moderation mechanisms of these tools but also enables the LLMs to generate malicious prompts automatically. These prompts can then be further exploited to create phishing attacks that are not only visually and functionally convincing but also as resistant to anti-phishing detection measures as those crafted by humans or phishing kits. 2) We curate the first dataset of malicious prompts that can be used to produce phishing websites and emails using Large Language Models. This includes 1,255 individual phishing-related prompts, which cover regular as well as seven evasive phishing strategies, and 2,109 phishing email prompts. 3) We design a machine-learning model aimed at early detection of phishing websites and email prompts to deter the LLM from generating malicious content. Our model, trained on ChatGPT and GPT-4 prompts, is shown to have good performance across Claude and Bard as well, achieving an average accuracy of 96% for phishing website prompt detection and 94% for phishing email detection. 4) We make our model and codebook available at: <ref type="url">https://tinyurl.com/epu6w4cp</ref>. 5) Our model can also be tested at Huggingface: <ref type="url">https://huggingface.co/phishbot/ScamLLM</ref>, as well as a ChatGPT actions plugin: <ref type="url">https://chat.openai.com/g/g-KU1izdZTw-prompt-defender</ref>. 6) We also disclose the identified vulnerabilities for generating phishing scams to Google, Anthropic, and Ope-nAI.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">Related work</head><p>Applications of Commercial LLMs discussed in Research:. LLMs have been widely used across different disciplines. Several studies have delved into ChatGPT's content moderation capabilities, e.g., for subtle hate speech detection across different languages <ref type="bibr">[38]</ref>, for discerning genuine news from misinformation <ref type="bibr">[39]</ref> and responding to common health myths, such as those surrounding vaccinations <ref type="bibr">[40]</ref>. In addition to ChatGPT, other commercial LLMs like Claude <ref type="bibr">[41]</ref>, LLama <ref type="bibr">[42]</ref>, and Bard <ref type="bibr">[43]</ref> have emerged. These models were utilized and evaluated for their suitability across different domains. For example, recent works like ChatDoctor <ref type="bibr">[44]</ref> and PMC-LLaMA <ref type="bibr">[45]</ref> used LLaMA for finetuning with real-world patient-doctor interactions to improve the models' ability to understand patient inquiries and providing efficient advice.</p><p>Misuse of Large Language Models:. Despite the innovations and benefits of commercial LLMs, there are sig-Figure <ref type="figure">1</ref>: Threat model to generate phishing scams using commercial LLMs nificant concerns surrounding their misuse. For example, it has been shown that ChatGPT can be compromised to produce malicious content using jailbreaking prompt attacks <ref type="bibr">[46]</ref> [47], prompt injection <ref type="bibr">[48]</ref> and code injection attacks <ref type="bibr">[49]</ref>. Investigations by Gupta et al. <ref type="bibr">[50]</ref> and Derner et al. <ref type="bibr">[51]</ref> have unveiled vulnerabilities in ChatGPT that can be harnessed to generate malware. Work by Angelis et al. <ref type="bibr">[52]</ref> emphasizes ChatGPT's potential role in propagating misinformation, leading to the alarming rise of an "AIdriven infodemic." Our work focuses on generating phishing scams, using not only ChatGPT but also three other popular commercial LLMs.</p><p>Detection of Phishing attacks. Over the years, many researchers have focused on devising effective strategies to understand and counteract phishing attacks. Initially, traditional machine learning algorithms laid the groundwork for detecting these attacks, e.g., by extracting TF-IDF features from text and training a random forest classifier <ref type="bibr">[53]</ref>, <ref type="bibr">[54]</ref>. Recent works treat phishing email and spam detection as a text classification task and utilize pre-trained language models, such as BERT <ref type="bibr">[55]</ref>, to detect phishing emails <ref type="bibr">[56]</ref>, <ref type="bibr">[57]</ref> and spam <ref type="bibr">[58]</ref>, <ref type="bibr">[59]</ref>. Prior literature has also shown that BERT and its variants like DistilBERT <ref type="bibr">[60]</ref> and RoBERTa <ref type="bibr">[61]</ref> can be fine-tuned with an SMS Spam dataset and perform well detecting SMS spam. Pre-trained language models have also been used for detecting phishing websites based on URL characteristics <ref type="bibr">[62]</ref>, <ref type="bibr">[63]</ref>. However, our approach focuses on a more preventive strategy. Instead of concentrating on detecting malicious content after its generation, our main objective is to prevent the generation of harmful source code by the LLMs. We thus aim to examine and filter the prompts by hindering the creation of malicious content before it starts.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">Threat model</head><p>The threat model for attackers generating phishing scams using commercial LLMs is illustrated in Figure <ref type="figure">1</ref>. Attackers utilize commercially available LLMs by submitting multiple prompts to craft a comprehensive phishing attack comprising a phishing email and its corresponding website. The phishing email aims to impersonate a reputable brand or organization while also devising text that, through prevalent phishing strategies (such as inducing confusion or urgency), persuades users to engage with an external link. Concurrently, the associated phishing website is conceptualized to achieve several objectives. Firstly, it aims to closely mimic the aesthetic and functional elements of a well-recognized organization's platform. Secondly, it utilizes regular and evasive tactics to deceive users into sharing sensitive information. Lastly, it integrates mechanisms that ensure the seamless transmission of collected data back to the attacker. After the LLM generates the phishing content, the attacker hosts the phishing site on a chosen domain, embeds the site's link within the phishing email, and then shares the deceptive email with their targets. The adoption of LLMs to create these phishing scams presents attackers with several advantages. LLMs not only allow for the rapid and largescale generation of phishing content, but their user-friendly nature also ensures accessibility to a wide range of attackers, irrespective of their technical prowess. This enables even the less tech-savvy to employ intricate evasion methods, such as text encoding, browser fingerprinting, and clickjacking.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.">Methodology</head><p>Figure <ref type="figure">2</ref> illustrates our approach towards exploring the capabilities of commercial LLMs in creating phishing websites and email scams and devising an effective detection model that prevents such generation through three pivotal stages. Our study involves three crucial stages as below:</p><p>(1) Prompt design and generating phishing scams:. As shown in Figure <ref type="figure">3</ref>, asking commercial LLMs to directly generate a phishing attack or any similar language indicating malicious intention triggers a content filter warning. In this work, we show that the attackers can design prompts that subtly instruct the model to produce seemingly benign functional objects containing the source code (HTML, CSS, JS scripts) for regular and seven evasive phishing attacks. When assembled, these objects can seamlessly constitute a phishing attack, concealing the underlying malicious intent. Manually designing such prompts can be a meticulous and time-consuming process. These prompts are designed to guide each of the four commercial LLMs in producing functional phishing websites with their respective attack vectors, thereby necessitating an investigation into how attackers can exploit these models to manufacture prompts efficiently. We also find that manually crafted prompts can subsequently be fed into the LLM models to create more such prompts automatically. It is a significant concern that LLMs can generate malicious prompts capable of bypassing their own detection systems, making it easier for attackers to easily scale phishing attacks and build sophisticated attack campaigns at a rapid pace. On the other hand, for phishing emails, we collect a sample from APWG's eCrimeX database <ref type="bibr">[37]</ref>, asking the models to create prompts that can be utilized to generate the same emails. Similar to phishing website prompts, email prompts can also be replicated by the LLMs, thus similarly allowing attackers to scale email-based scams as well. Section 5 dives into the details of how we were able  to build the malicious prompts to create phishing websites using functional objects, and how we further exploited the models to replicate those prompts automatically. On the other hand, in Section 6, we design malicious prompts based on verified phishing emails and similarly make the LLM models replicate them.</p><p>(2) Effectiveness of generated Phishing Scams:. While manual prompt generation is insightful, the potential for scalable attacks hinges on automatically created prompts. We conducted a qualitative evaluation of the quality of websites produced by such automated prompts. To further gauge the efficacy of these LLM-generated attacks, we compared the detection rates of popular anti-phishing blocklists against LLM-generated phishing attacks versus humangenerated ones. To assess the quality of LLM-generated phishing emails, we employed four text generation metrics: BLEU, Rouge, Topic Coherence, and Perplexity. Using these metrics, we compared the email text generated by each commercial LLM model to the original human-crafted versions.</p><p>(3) Automated detection of Phishing prompts:. After assessing the potential exploitation of commercial LLMs in generating phishing scams at scale, in Section 7 we designed a machine learning-based detection model to prevent LLMs from producing such malicious content. To build our ground truth, we manually labeled prompts that were generated using ChatGPT. Due to the availability of an API <ref type="bibr">[64]</ref>, it was easier to generate a large sample of prompts for training and testing our model. To explore the best detection method, we tested our finetuned model using three different approaches: a) individual prompt detection, b) entire prompt collection detection, and c) prompt subsets detection. In all these approaches, we finetuned a pre-trained RoBERTa <ref type="bibr">[61]</ref> model using our groundtruth dataset with individual prompts and subsequently tested its capability across individual prompts, entire collections, and prompt subsets. To identify how the model works for the other commercial LLM models, we also  For phishing email detection, we combined malicious emails from eCrimeX <ref type="bibr">[37]</ref> with benign samples from the Enron dataset <ref type="bibr">[65]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.">Generation of phishing websites</head><p>This section focuses on utilizing commercial LLMs for creating a range of phishing websites, including both regular and evasive types. The motivation behind this exploration is Phishing attacks that incorporate login fields directly within the websites to steal users' credentials. <ref type="bibr">[22]</ref>, <ref type="bibr">[29]</ref>, <ref type="bibr">[66]</ref>, <ref type="bibr">[67]</ref>. 2</p><p>ReCAPTCHA attacks An attack that presents a fake login page with a reCAPTCHA challenge to capture credentials <ref type="bibr">[68]</ref>, <ref type="bibr">[69]</ref>, <ref type="bibr">[70]</ref>, <ref type="bibr">[71]</ref>, <ref type="bibr">[72]</ref>, <ref type="bibr">[73]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">QR Code attacks</head><p>An attacker shares a website containing a QR code that leads to a phishing website <ref type="bibr">[74]</ref>, <ref type="bibr">[75]</ref>, <ref type="bibr">[76]</ref>, <ref type="bibr">[77]</ref>. <ref type="bibr">4</ref> iFrame injection/Clickjacking Attackers use iFrames to load a malicious website inside a legitimate one <ref type="bibr">[78]</ref>, <ref type="bibr">[79]</ref>, <ref type="bibr">[80]</ref>. 5</p><p>Exploiting DOM classifiers Phishing websites designed to avoid detection by specific anti-phishing classifiers <ref type="bibr">[81]</ref>. 6</p><p>Browser-in-the-Browser attacks A deceptive pop-up mimics a web browser inside the actual browser to obtain sensitive user data <ref type="bibr">[82]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>7</head><p>Polymorphic URL Attacks that generate a new URL each time the website is accessed <ref type="bibr">[83]</ref>, <ref type="bibr">[84]</ref>. 8</p><p>Text encoding exploit Text in the credential fields is encoded such that it is not recognizable from the website's source code <ref type="bibr">[85]</ref>, <ref type="bibr">[86]</ref>.</p><p>to provide a comprehensive view of the potential phishing threats that can be generated by LLMs, which cover a diverse array of attack types that include -both client-side and server-side attacks as well as those designed to obfuscate content from users and evade detection by automated antiphishing crawlers. Table <ref type="table">1</ref> presents a summary of the eight distinct phishing attack types that have been identified and analyzed in the existing literature.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.1.">Structure of the prompts:</head><p>As illustrated in Figure <ref type="figure">3</ref>, commercial LLMs refuse to comply when directly asked to generate a phishing attack due to its built-in abuse detection model. Our goal is to identify how an attacker can engineer prompts so that they do not indicate malicious intention, allowing the LLM to generate functional components that can be then assembled to create phishing websites. As is illustrated in an example in Figure <ref type="figure">4</ref>, the attacker can design prompts with four primary functional components: (1) Design object: Firstly, the LLM was asked to create a design that was inspired by a targeted organization (instead of imitating it). LLMs can create design style sheets that are very similar to the target website, often using external design frameworks to add additional functionality (such as making the site responsive <ref type="bibr">[87]</ref> using frameworks, such as Bootstrap <ref type="bibr">[88]</ref> and Foundation <ref type="bibr">[89]</ref>). Website layout assets, such as icons and images, are also automatically linked from external resources. (2) Credentialstealing object: Emulation of the website design can be followed by generating relevant credential-taking objects, such as input fields, login buttons, input forms, etc. (3) Exploit generation object: The LLM can be asked to implement a functionality based on the evasive exploit. For example, for a Text encoding exploit <ref type="bibr">[85]</ref>, <ref type="bibr">[86]</ref>, the prompt asks to encode all readable website code in ASCII. For a reCAPTCHA code exploit, the prompt can ask to create a multi-stage attack, where the first page contains the QR Code, which leads to the second page, which contains credential-taking objects. (4) Credential transfer object: Finally, the LLM can be asked to create essential JS functions or PHP scripts to send the credentials entered on the phishing websites to the attacker by using email, sending it to an attacker-owned remote server or storing it in a back-end database.</p><p>These functional instructions can be written together as a single prompt or as a sequence of prompts -one after the other. Using this method, we show that attackers can successfully generate regular and evasive phishing attacks.</p><p>The prompts can also be brand-agnostic, i.e., they can be used to target any brand or organization.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.2.">Constructing the prompts:</head><p>To determine the effort required for users to develop malicious prompts that can evade LLM detection and generate a phishing website and also if creating prompts for some attacks was harder than others, we examined the number of iterative prompts required by three independent coders (two graduate students and one undergraduate student in Computer Science) to create each of the phishing attacks described in Table <ref type="table">1</ref> using ChatGPT 3.5T, GPT 4, Claude and Bard. The coders possessed varying levels of technical proficiency in Computer Security: Coder 1 specialized in the field, Coder 2 had a good experience, and Coder 3 had some familiarity through academic coursework. Table <ref type="table">2</ref> presents the average number of prompts required by the three coders to generate the phishing functionality (attacks) across all four LLM models. Each coder created their own set of prompts for designing the website layout and for transmitting the stolen credentials back to the attacker, which they reused for multiple attacks.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>5.2.1.</head><p>Observing prompt generated attacks:. The models could generate all phishing attacks successfully using prompts provided by the coders. They were able to successfully generate the source code of both the website design based on the brand mentioned in the prompt, as well as the source code for the credential stealing object. For ReCAPTCHA evasive attacks, the models were able to generate a benign webpage featuring a ReCAPTCHA challenge that would lead to another regular phishing website. Figure <ref type="figure">5</ref> illustrates an example of Claude generating a QR-code phishing attack. All models generated a QR code that embedded the URL for a regular phishing attack via the QRServer API. These attacks pose a challenge for anti-phishing crawlers since the malicious URL is hidden within the QR code <ref type="bibr">[74]</ref>, <ref type="bibr">[75]</ref>, <ref type="bibr">[76]</ref>. On the other hand, Browser-in-the-Browser attacks (BiTB) could be emulated by exploiting single sign-on (SSO) systems and creating deceptive pop-ups that mimic genuine web browser windows. An example of GPT 4 generating a BiTB attack is illustrated in Figure <ref type="figure">6</ref>. All models notably struggled with generating this attack, requiring, on average, seven additional prompts after the design phase. However, all models ensured that the iFrame object adhered to the same-origin policy to avoid triggering anti-cross-site scripting measures. This trend was further identified for clickjacking attacks as well. The models had an easier time generating attacks that exploited Document Object Model (DOM) classifiers, specifically those that can circumvent features evaluated by Google's phishing page filter <ref type="bibr">[81]</ref>, as well as Polymorphic URLs that use server-side PHP scripts to append random strings at the end of the URL. Lastly, we created browser fingerprinting attacks that only render the phishing page for users visiting through specific agents or IP ranges, thereby evading detection by anti-phishing bots. Although the capability of all models to generate such attacks does not directly speak to the quality of the individual attacks (which we explore later in Section 5.3.1), it underscores the potential exploitability of these LLMs in phishing website creation. We also found that all coders, regardless of their expertise in Computer Security, demonstrated similar performance when generating exploit prompts. This observation may suggest that crafting phishing attacks using ChatGPT does not necessitate extensive security knowledge, although it is important to note that all coders were technically proficient. Since prompt creation can be labor-intensive, we further explore the feasibility of leveraging the LLM to produce prompts, aiming to streamline the process autonomously. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.3.">Automating prompt generation:</head><p>As evident from Table <ref type="table">2</ref>, most of the prompts generated for a particular attack were dedicated to designing the layout of the phishing websites. Manually designing these prompts can be time-consuming. However, as shown in Figure <ref type="figure">7</ref>, we found that LLMs could even help attackers automate the process by inputting their handcrafted prompts into the LLMs and asking them to generate multiple prompts having the same functionality, which leads to the LLMs rapidly generating an extensive array of such prompts. Subsequently, these prompts, when provided back to the LLM, can produce the corresponding phishing attack source code.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.3.1.">Evaluation of generated phishing websites:</head><p>. To assess the capabilities of the commercial LLMs in creating phishing websites, we examined the outputs generated when these models were fed prompts they had produced. Our method involved three independent coders who scrutinized each generated phishing attempt based on two principal criteria. First, the appearance criterion gauged how closely and convincingly the content resembled the intended target, both in the phishing website and email. Identifying the effectiveness of phishing attacks by studying their appearance and functionality has been found to be effective in prior literature <ref type="bibr">[90]</ref>, <ref type="bibr">[91]</ref>, <ref type="bibr">[92]</ref>, <ref type="bibr">[93]</ref>. This was quantified using a 5-point Likert scale known as the Website Appearance   Scale (WAS), with each level's attributes detailed in Table <ref type="table">3</ref>. Conversely, the Functionality criterion delved into the LLM's adeptness at encompassing every functionality that was provided in the prompt and was calculated by a binary variable-assigning a score only if the website incorporated every requested functionality. In total, the coders reviewed 80 samples for each of the four LLMs, with ten samples for each type of attack (320 total samples). The final WAS score for each website was the average of the individual coder scores, and the distribution of these scores across models is illustrated in Figure <ref type="figure">8</ref>. We find that GPT-4 consistently stands out in performance, producing sites that closely resemble the original. Approximately half of GPT-4's samples scored above an average WAS of 4. In contrast, ChatGPT 3.5T and Claude had nearly 90% of their samples to reach this mark, indicating that the median performance of GPT-4 is significantly higher. Conversely, 80% of Bard's samples scored around 2.8 or lower, which implies that only its top 20% of outputs achieved or surpassed this score. Thus, GPT-4 not only excels in average performance but also has consistently high-quality results. ChatGPT 3.5T and Claude fall into the middle range, producing satisfactory phishing websites. However, Bard predominantly performs at a lower tier, with only a small portion of its outputs reaching higher score ranges. All models, when assessed for functional components, as illustrated in Table <ref type="table">4</ref>, excelled in creating standard phishing attacks. GPT-4 and Claude achieved success in every regular phishing sample. This trend persisted for ReCAPTCHA and QR-based attacks, except in the case of Bard, which managed successful outcomes in only six scenarios for each type. Bard's capability was notably limited across all evasive attacks, particularly evident in the Browser-in-the-Browser attacks (BitB) category, where it only succeeded with two samples. Other models also faced hurdles with BitB attacks but still performed better than Bard. The models found Clickjacking attacks (Attack 5) challenging as well. Despite these challenges, GPT-3.5T, GPT-4, and Claude showed strong performance against various other evasive attacks.</p><p>Evaluating under the WAS metric, GPT-4 is shown as the top performer, closely trailed by GPT-3.5T and Claude. In contrast, Bard's difficulties in producing functional components and its lower WAS scores indicate that it might not be the ideal model for designing phishing websites, unlike its counterparts.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>5.3.2.</head><p>Anti-phishing effectiveness:. To further identify the effectiveness of LLM-generated phishing attacks, we compared how well anti-phishing tools can detect them when compared to phishing websites that were created by humans (or generated using phishing kits). To do so, we used the 320 websites as mentioned in Section 5.3.1 that were created using LLM-generated prompts. We deployed these websites on Hostinger <ref type="bibr">[94]</ref>, a popular website hosting domain. To ensure these websites posed no harm to users upon hosting them, we did not capture any data from interactions on these dummy sites. Moreover, these sites were terminated after 7 days if not removed by the web domain earlier.</p><p>Our methodology of controlling the lifecycle of a dummy phishing website here is considered to be a common and safe practice to identify detection gaps in the anti-phishing ecosystem and phishing training alike <ref type="bibr">[27]</ref>, <ref type="bibr">[95]</ref>, <ref type="bibr">[96]</ref>.</p><p>To compare these samples with human-generated phishing websites, we manually extracted the designs of 140 phishing websites that appeared from APWG eCrimeX, ensuring a balanced representation with 40 samples for all attacks except Attack 4. Recognizing the elusive nature of Browser-in-the-Browser attacks and their rare presence in blocklists, our coders manually constructed 40 of these attacks. This brought our count of human-generated phishing sites to 320 as well. Like the LLM-produced sites, these websites were also made harmless, ensuring they could not collect or forward any data.</p><p>After setting up these dummy phishing sites, both LLM and human-generated, we reported them to APWG eCrimeX <ref type="bibr">[37]</ref>, Google Safe Browsing <ref type="bibr">[97]</ref>, and Phish-Tank <ref type="bibr">[25]</ref>. Many anti-phishing tools depend on these blocklists to identify emerging phishing threats <ref type="bibr">[27]</ref>. Upon reporting, we monitored their anti-phishing detection rate by We measured the detection scores of the websites for up to seven days or until the domain removed them. Figure <ref type="figure">9</ref> provides a comparative analysis of the average detection score for each attack for both LLM and human-generated sites on a per-model basis.</p><p>We find that the detection scores for human-created phishing attacks versus LLM-generated ones did not vary significantly on a per-attack basis for all models except Bard. Additionally, we conducted a paired t-test between the detection scores between human-generated and LLMgenerated phishing websites and did not find the difference to be statistically significant, indicating that the LLMgenerated phishing attacks (by GPT 3.5T, GPT 4, and Clade) were, on average, just (or almost) as resilient as human-created phishing attacks with respect to anti-phishing detection. Thus, our findings further confirm the potential of scaling phishing attacks using the recursive approach of generating phishing websites from prompts that these LLMs also generated. On the other hand, evasive attacks generated by Bard had higher detection rates in comparison to those created by other models. This can be attributed to Bard's tendency to generate websites that had lower scores in both functionalities and WAS (as illustrated in 5.3.1), suggesting inferior quality of websites, failing to implement evasive features, etc., which might have made it easier for antiphishing tools to detect them.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.">Phishing email generation</head><p>Phishing websites are usually distributed by attackers using emails <ref type="bibr">[99]</ref>, and thus we dedicate this section to studying how an attacker can generate phishing emails using the commercial LLM models. Our method to generate these emails is similar to generating phishing attacks using LLM-generated prompts in Section 5, where we ask GPT- 4 to design prompts using some human-created phishing emails. These prompts are then fed back to the LLMs to design an email that entices users to sign up for a service or provide sensitive information. To generate the email prompts, we collected 2,109 phishing emails from the APWG eCrimeX feed <ref type="bibr">[37]</ref>. This feed combines phishing emails reported by various brands and cybersecurity specialists. These emails encompassed several attack vectors, including banking scams, account credential fraud, fake job offers, etc. To ensure the quality and authenticity of our dataset, we randomly selected 100 emails for manual inspection. Notably, we found no evidence of misclassification within this subset. Parallelly, we extracted the same number of benign emails from the established Enron dataset <ref type="bibr">[65]</ref>. The phishing and benign emails were then provided to GPT-4, which was tasked with formulating prompts needed for replicating the original emails. To further validate the accuracy of the generated prompts, we manually assessed 100 phishing prompts alongside 100 benign ones and found that GPT-4 had a perfect score for generating such prompts. We then introduced these prompts to different LLMs, GPT-3.5T, GPT-4, Claude, and Bard, to analyze their respective outputs. An example of a phishing email generated by Claude can be viewed in Figure <ref type="figure">11</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.1.">Evaluation of LLM-generated emails</head><p>The complexity of LLM-generated phishing websites required manual evaluation (Section 5). On the other hand, email generation, being a more conventional domain of text generation tasks, provides the opportunity for algorithmic evaluation. We compared the phishing emails generated by the LLMs (using the prompts that they themselves had generated) with the human-constructed phishing emails from eCrimeX. We employed four popular metrics utilized for text generation tasks: BLEU <ref type="bibr">[100]</ref>, Rouge <ref type="bibr">[101]</ref>, Perplexity <ref type="bibr">[102]</ref>, and Topic Coherence <ref type="bibr">[103]</ref> to measure and compare the performance of the LLMs in generating phishing email text. A short description of the metrics is provided in Table <ref type="table">9</ref> in the Appendix. The performance of the LLMs is illustrated in Table <ref type="table">5</ref>. For BLEU, Rouge-1 and Topic Coherence, scores range from 0 to 1, with higher being better. On the other hand, for Perplexity ranges from 0 to 100, with lower being better. We find that GPT-4 outperforms the other models across all metrics, showcasing the highest BLEU (0.54), Rouge-1 (0.68), and Topic Coherence (0.72) scores, and the lowest Perplexity <ref type="bibr">(15)</ref>. Claude closely follows, with competitive scores in all metrics, demonstrating its effective balance in generating coherent and contextually appropriate emails. On the other hand, GPT 3.5T exhibits moderate performance, with BLEU and Topic Coherence scores lagging behind GPT-4 and Claude but outdoing Bard. Its Rouge-1 score is only slightly behind Claude and GPT-4, indicating its competency in information retention. Bard, presents slightly lower metrics compared to the rest but still showcases proficiency, unlike its performance towards generating phishing websites as seen earlier. In summary, all LLMs, despite exhibiting varying competencies, appear to be proficient in generating phishing emails.  </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.">Phishing Prompts Detection</head><p>Our findings from Section 5 explore how commercial LLMs can be utilized for generating phishing websites using malicious prompts generated by themselves. Thus, there is a need for the proactive detection of these prompts such that we can prevent the generation of such content. Therefore, we train a RoBERTA based classifier on malicious and benign prompts generated by commercial LLM models and propose a detection framework, as illustrated in Figure <ref type="figure">12</ref>, for detecting phishing prompts with three different detection schemes: We examine the prompts individually, as an entire prompt collection, and as subset of prompts to accommodate real-time scenarios. A Prompt collection is a series of two or more prompts that were generated by the LLM when asked to perform a task (such as generating phishing content in our context.) On the other hand, a Prompt collection subset or simply, Prompt subset is the cumulative combination of prompts as they are provided by the user. For example, when the attacker provides a single prompt, it is its own subset, but upon adding another prompt, the subset becomes the combination of the two prompts. We dedicate the rest of this section towards illustrating our approach towards training and evaluating our prompt detection models on all three prompt structures.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.1.">Collecting prompts for ground-truth</head><p>In Section 5.3 we found that all the commercial LLMs can be used to automatically generate malicious prompts. ChatGPT notably simplifies the process for generating prompts on a large scale by using their developer API. We used this API to generate the ground-truth (of malicious and benign prompts) required to train our detection model. We used both GPT-3.5T <ref type="bibr">[104]</ref> and GPT-4 <ref type="bibr">[105]</ref> to generate 258 malicious prompt collections (collections which lead towards creating a phishing website), using GPT 3.5 to generate 117 such collections, while using GPT 4 to generate 141 prompt collections. These prompt collections included both regular and evasive phishing attacks, thus enhancing the model's capability to efficiently detect prompts related to any attack type listed in Table <ref type="table">1</ref>. Each collection contained an arbitrary number of individual prompts as generated by the LLMs. We observed that the average number of individual prompts generated in each prompt collection is approximately 9.27. Similarly, we generated 258 legitimate prompt collections. To ensure that both malicious and legitimate prompt collections were brand agnostic, we utilized OpenPhish's 'List of identified brands' <ref type="bibr">[106]</ref> (Brands which are most targeted by phishing attacks) to randomly assign a brand when asking the LLM to generate a prompt collection. Training the model using only a single brand could bias it towards classifying prompts containing those specific brand names as phishing. Thus, our approach of using a unique brand for each of the 258 phishing prompt collections during training diversified the model's exposure, potentially it less susceptible to such biases. In the proceeding paragraphs, we discuss how we create our codebook for labelling our groundtruth.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.2.">Codebook Creation and prompt labeling</head><p>To build the groundtruth dataset for training our model, Coder 1 and Coder 2 utilized open-coding technique. They manually labeled individual prompts from the generated prompt collections as either or "Benign." Given the large size of the dataset, Coder 1 took the initiative by randomly selecting 40 prompts from each of the eight attack categories. This initiative aimed discern underlying themes crucial for developing a detailed codebook. The codebook then classified elements as "Phishing" or "Benign," contingent upon the inherent risk and intent related to phishing activities. Alongside each categorization, the codebook provides descriptions and examples for clarity. The codebook can be found in <ref type="url">https://tinyurl.com/epu6w4cp</ref>. It is noteworthy that the codebook emphasized several techniques with a malicious inclination often associated with phishing. For instance, "Data Redirection" and "URL Randomization" were marked as "Phishing," whereas legitimate web design elements like "Typography and Font" were labeled "Benign."</p><p>Both coders utilized this codebook to label the entire dataset. Initially, Coder 1 identified 29 unique themes. The first pass on the dataset yielded a Cohen's Kappa interreliability score of 0.71, signifying a substantial agreement between the coders. As they tried to resolve their disagreements, six additional themes were identified for the codebook, expanding the size of the codebook to 35 features. Disagreements between the coders were addressed. In total, we had 1,255 phishing and 1,137 benign prompts for our malicious prompt collection ground truth. All individual prompts (n=1,986) in our legitimate prompt collection set were benign in nature.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.3.">Preprocessing labeled prompts</head><p>We extracted the prompts from each prompt collection and stored them in the form of individual prompts. Upon inspecting these prompts, we frequently observed the presence of extraneous elements such as bullet points, numerical values, and descriptors like 'step-1'. These phrases, being irrelevant to the core content of the prompts, were removed. On the other hand, we stored attributes such as collection number and prompt number to preserve the order of prompts.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.4.">Individual Prompt Detection</head><p>We start with evaluating several pre-trained language models towards detecting individual prompts that are generated by the commercials LLMs. 7.4.1. Groundtruth for Individual Prompt Detection:. We utilized all individual prompts labeled as phishing from our malicious prompt set. However, since we had a far larger number of individual benign prompts when considering both our malicious and legitimate website prompt collection sets, we randomly sampled benign prompts from both our malicious and legitimate prompt collections. Our final training dataset consisted of 1,255 phishing prompts and 1,534 benign prompts. We split this dataset into 70% for training and 30% for testing.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.4.2.">Model Selection and Experiments:</head><p>. We acknowledge the effectiveness of traditional ML algorithms, such as Na&#239;ve Bayes <ref type="bibr">[107]</ref> and SVM <ref type="bibr">[108]</ref> for binary classification domains. However, these algorithms often demand large datasets with a substantial number of features to perform optimally. In our case, we are constrained by both limited data and a lack of extensive features. Therefore, inspired by literature <ref type="bibr">[109]</ref>, <ref type="bibr">[110]</ref>, which have shown the effectiveness of pre-trained language models in scenarios with limited datasets, we also use them for building our classifier.</p><p>Pre-trained language models like BERT <ref type="bibr">[55]</ref>, RoBERTa <ref type="bibr">[61]</ref>, etc., are trained on vast amounts of data, facilitating them with a broad understanding of language, which is crucial in detecting nuanced and occasionally hidden malicious intent in our prompts. Moreover, bidirectional models such as BERT utilize context from both left and right sides of a word when making predictions. This feature makes them more suitable for text classification tasks. Based on these advantages, we experiment with BERT-based models, including BERT <ref type="bibr">[55]</ref>, DistilBERT <ref type="bibr">[60]</ref>, RoBERTa <ref type="bibr">[61]</ref>, Electra <ref type="bibr">[111]</ref>, DeBERTa <ref type="bibr">[112]</ref> and XLNET <ref type="bibr">[113]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>7.4.3.</head><p>Training Details:. We used pre-trained versions of all the models and finetuned them on our groundtruth dataset for 10 epochs with a batch size of 16. We used AdamW optimizer, and the learning rates were set to 2e -5 . The maximum sequence length is set to 512. We finetuned these models using an Nvidia V100 GPU and used the last checkpoint for evaluation. For obtaining embeddings for input sequences, we used their respective tokenizers. 7.4.4. Performance Evaluation:. To select the best model, we look at metrics such as average F1 score, Accuracy, Precision, and Recall. Furthermore, we compute the Total Time for predicting 100 samples and Median Prediction Time, across 100 samples. Given our objective to deploy the model in real-world scenarios, where the model needs to be able to detect prompts with both good performance and speed to be able to scale, these metrics are necessary for the evaluation.</p><p>Table <ref type="table">6</ref> illustrates the performance of the six pre-trained language models on our test set for individual prompts. We observe that RoBERTa shows slightly better performance, with an average F1 score of 0.94. Although there are lighter models such as DistilBERT and ELECTRA, which have slightly lesser median prediction times compared to RoBERTa, we noticed that their F1 scores are slightly lower, hovering around 0.93. Considering the trade-off between performance and prediction time across all the models, as well as the robustness of the model training approaches, we chose RoBERTa as our final model for individual prompt detection.</p><p>7.4.5. Challenges with Individual prompt Detection:. Despite the good performance, we consider a scenario where individual prompt classification might not be sufficient. For example, an individual prompt might not provide complete information about the attacker's intent. Adaptive attackers can include prompts that individually appear to be benign, but when taken together can be used to generate malicious content. Depending solely on an individual prompt classifier in such cases might offer a leeway for malicious users to elude detection. Thus, to prevent this, we proceed to evaluate two more detection approaches: a) classification on the entire collection of prompts, and b) Cumultativly building multiple prompt subsets based on incoming prompts, where each subset is then predicted by our prediction model. We dedicate the proceeding paragraphs towards detailing both these approaches.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.5.">Phishing Collection Detection</head><p>The main objective of this detection scheme is to evaluate the model's performance when provided with an entire collection consisting of multiple prompts. To do so, we employ two distinct evaluation methods: first involves training a new model with full phishing and legitimate collections and then evaluating the performance on collections. The second method utilizes the existing classifier that was initially trained on individual prompts and evaluates its performance on collections. 7.5.1. Groundtruth for phishing collection detection:. While for training the first method, we utilized the same groundtruth as for our individual prompt detection (Section 7.4.1, for training the second method we considered the whole prompt collections from our labeled dataset, containing 258 malicious and 258 legitimate prompt collections. We also used a 70-30 split for training and testing -resulting in the training set containing 185 phishing collections and 176 legitimate collections and the testing set consists of 73 phishing and 82 legitimate collections. For evaluating the model performance, we employ the same testing set for both methods.</p><p>7.5.2. Performance Evaluation:. Table <ref type="table">7</ref> shows the performance of the model when trained and tested on collections, as well as when trained on individual prompts and tested on collections. We observe that the model trained on collections achieves 0.92 accuracy, with an average F1 score of 0.92, and the model trained on individual prompts achieves 0.93 accuracy, with an average F1 score of 0.93. Additionally, model performance when trained on collections and individual prompts, and tested on collections is shown for each attack in Table <ref type="table">7</ref>. Thus, even though the model trained on individual prompts shows slightly better performance, both models perform relatively well. 7.5.3. Challenges with Phishing Collection Classification:. While being able to evaluate the entire conversation (i.e. collection of prompts) might provide a more nuanced understanding of the user's intent compared to evaluating individual prompts separately, obtaining and testing an entire prompt collection is counterintuitive to the goal of proactively preventing the LLM from generating malicious content. For the model to wait for the entire prompt collection to come through before making a prediction would not only delay the classification but also allow the attacker to get access to the majority of the source code generated by the LLM. Thus, to adapt to real-time scenarios, in the next section we propose to examine the current prompt alongside its preceding prompts -by forming prompt subsets dynamically, to ascertain if the context captured in each step unveils any malicious activity. In this analysis, we aim to observe the evolving intent of the user as they provide newer prompts to the LLM. We do so by combining new prompts with their preceding prompts to form a subset and then ask the model to classify it. This continues until the model marks a subset as phishing. This iterative process enables the model to identify patterns or sequences of prompts that, when viewed together, may suggest a malicious intent that would not be apparent if the prompts were evaluated in isolation. For instance, a single request to design a website inspired by Paypal.com may seem harmless. Yet, when this is sequentially followed by a request to incorporate login forms soliciting sensitive information, along with the addition of the brand's logo, it strongly implies a phishing motive. The model is designed to recognize such sequences and accordingly prevent the language model from generating content that could facilitate such intentions. We present a visualization of how this approach parses the subsets in Figure <ref type="figure">13</ref>. 7.6.1. Test Set for Prompt Subset Detection:. To evaluate this approach, we used the model trained on individual prompts (in Section 7.4). For testing, we initially selected the test set used for whole prompt collection detection (Section 7.5 We used the prompt number in each collection to correctly determine the order of prompts and concatenated them accordingly, followed by storing these concatenated prompts with a new attribute named "Prompts-Concatenated". Utilizing the labels for individual prompts, two coders coded these prompt subsets as well, by evaluating the subsets at each level and curating a balanced test set of 597 phishing prompts subsets and 635 benign prompts subsets for training and evaluation. Additionally, we also add a new attribute "Prompt-Subset Label" which is obtained after concatenating previous prompts with the current prompt. Once a label for current prompt turns is determined to be phishing, we label all the subsequent prompt subset labels to be phishing as well till the end of the prompt collection. 7.6.2. Performance Evaluation:. During the testing phase, we introduced different prompt subsets to the fine-tuned model. We then evaluated the model's predictions using the "Prompt-Subset Label". This process allowed us to analyze the model's performance across specific levels of the prompt subsets. Finally, the finetuned RoBERTa model, trained on individual prompts and tested on subsets of prompts, achieved an accuracy, precision, recall, and F1 score of 0.96. Model performance for each attack is provided in Table <ref type="table">7</ref>. Based on the results, it is evident that the model trained on individual prompts effectively categorizes individual, subsets and collections of prompts.</p><p>We expanded our experiments by training a classifier with prompt subsets. This approach allowed us to explore the capabilities of the model when tested on different formats including individual prompts, prompt subsets, and prompt collections, which due to brevity, we do not present in detail. Overall, upon evaluation, we observed consistent performance across these different combinations. However in any combination, to accommodate real-time scenarios, using the model trained on individual prompts and tested on prompt subsets, emerges as the best choice for early and efficient real-time detection. 7.6.3. Interpreting model prediction. We also utilized LIME (Local Interpretable Model-Agnostic Explanations) <ref type="bibr">[114]</ref>) to identify the specific words or phrases within prompt texts that influence the model's predictions. A higher LIME score signifies a stronger influence on the model's decision-making process. Specifically, the score's magnitude for a word or phrase signifies its impact level: positive weights enhance the likelihood of the predicted class, while negative weights diminish it. For samples in our test set that were classified as phishing by the model, we closely examined the phrases that positively influenced this prediction and checked for similarities with features in our codebook (Section 7.2). We find that the phrases that contribute to the model predicting phishing closely align with the features our coders had identified as well. For clarity, we assign each phrase to a category found in the code book, Figure <ref type="figure">14</ref> illustrates the volume of top-10 phrase categories that contributed positively to a phishing prediction along with their median LIME score. Thus this alignment validates that our model effectively focuses on features deemed critical by human evaluators, further confirming its ability to effectively identify phishing attempts.</p><p>Additionally, our framework is also applicable in scenarios where attackers provide the source code of a benign website as their input prompt, aiming to embed phishing components subsequently. Specifically, any attempt to include phishing components requires the submission of prompts to the LLM, which are scanned and identified by our detection model. For example, consider an attack scenario where the benign login page source code of Amazon.com is duplicated. Subsequently, the attacker includes a prompt designed to inject a JavaScript function capable of sending the entered credentials to an email address or database controlled by the attacker. At this stage, our detection model would recognize this activity as phishing, thereby preventing the language model from producing the modified source code that facilitates the unauthorized sending of credentials. On the other hand, an attacker might initially create a generic or unbranded login page using the LLM, and then customize it manually by adding specific brand logos or other identifiers (such as text). This scenario could bypass our detection framework. However, to make the phishing website functional, the attacker needs to include at least a function to transfer the credentials entered into the site to themselves. Implementing such functionality is arguably more complicated than inserting brand logo images. Thus, as mentioned earlier, once the attacker attempts to include prompts to add the credential transfer component (or any other evasive functionality), they (the prompts) will get detected and intercepted by our model.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.7.">Individual and subset prompt detection for Bard and Claude</head><p>We tested our model for both individual and subset of prompts generated by Google Bard and Claude when asked to provide instructions for creating the phishing attacks. Since the prompts generated by the different models can vary with respect to structure, features, etc., it allows us to evaluate the transferability of our classifier. Since, during the time of this study, neither Bard nor Claude provided developer APIs, we manually generated the prompts by using their respective web interfaces. We generated 10 prompt sets for each attack and ran our model on each prompt of the attack. Then we randomly picked 25 prompts from each attack (200 total prompts) and manually labeled them to identify the efficiency of our model. Our findings are illustrated in Table <ref type="table">8</ref>. Overall, Claude had an accuracy and F1 score of 0.93, while Bard had an accuracy of 0.95, with an F1-Score of 0.96. The performance of the model on a per-attack basis is illustrated in Table <ref type="table">7</ref>.</p><p>We further evaluated our model by testing it on subsets of prompts generated by both Claude and Bard. In this case, we randomly select 25 concatenated subset prompts (i.e. the combination of several prompts together as discussed in Section 7.6). The results detailed in Table <ref type="table">7</ref>, show that the model achieved an accuracy of 0.96 on prompts generated by Claude, and 0.95 on those by Bard. Breaking down the performance of the model on a per-attack basis, as shown in Table <ref type="table">7</ref>, we see that the model performs well for all Claudegenerated prompts except Attack 7, whereas it performs well for all Bard generated prompts except Attack 4.</p><p>We found that the anomaly with Claude in Attack-7 is linked to the sequential arrangement of website elements in the prompts. This order obstructs the model's ability to identify parts of the prompts as harmful until the entire sequence of elements is provided. In the case of Bard for Attack-4, the difficulty revolves around prompts mentioning a logo. We classify the prompts as phishing if they instruct placing a logo at the top, mimicking a login page title. Otherwise, prompts are considered benign, when specific placement details are not provided, leading our model to detect prompt subsets as benign. Thus, overall, we find that our model, trained on ChatGPT-generated prompts, generalizes well against prompts generated by Claude and Bard as well.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.8.">Evaluating against malicious LLMs</head><p>To further identify the generalizability of both our prompt generation framework and detection model, we test on two popular LLMs used for generating phishing attacks and other malicious content: FraudGPT <ref type="bibr">[115]</ref> and Wor-mGPT <ref type="bibr">[116]</ref>. These models also require a prompt to generate malicious content. We did not have access to their local versions (which can only be purchased from cybercriminal forums) and instead utilized their publicly available implementations on FlowGPT <ref type="bibr">[117]</ref>. We generated 240 prompt collections generated by WormGPT and FraudGPT, which were then predicted by our detection model. Overall, our model detected 233 ( 97%) generated by FraudGPT, and 219 ( 91%) generated by WormGPT.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.9.">Detecting Phishing email prompts</head><p>To automatically detect phishing email generation prompts, we utilized the RoBERTa architecture and trained it on the sample of 2,109 phishing prompts that were generated by GPT-4 from the eCrimeX phishing dataset and 2,109 Benign email prompts generated by the same from the Enron dataset, partitioning the dataset into a 70:30 Train:Test split. The model achieved an accuracy, precision, recall, and F-1 score of 0.94, 0.95, 0.93 and 0.94, respectively. Overall, these metrics highlight the model's robust capability in the early detection of prompts that attempt to generate phishing emails using LLMs.</p><p>Similar to Section 7.7, we also manually generate phishing email prompts using Claude and Bard. For each of the models, we generate 20 prompts for each of the phishing email categories for a total of 200 prompts, and 200 prompts for benign email prompts.  our model on email prompts generated by both Claude and Bard. For Claude, we see an accuracy of 0.92 and an F1-Score of 0.95, whereas for Bard, we see an accuracy of 0.96 and an F1-Score of 0.91. Thus, similar to our phishing detection model, we see that the performance of our email detection model is also transferable across the ChatGPT, Claude and Bard.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="8.">Discussion</head><p>Ethics and Data Disclosure: Since ChatGPT 3.5T and 4 were used to generate the phishing prompts, we have reported them to ChatGPT's developer, OpenAI <ref type="bibr">[64]</ref>, and we plan to disclose them after OpenAI's mandatory 90-day period of vulnerability disclosure <ref type="bibr">[118]</ref>. We also disclose the vulnerabilities identified in our study to the developers of Claude and Bard, i.e., Anthropic and Google. Google has already accepted the vulnerability, assigning it the highest severity for a fix. We also plan to disclose our prompts generated using Bard in the near future, after receiving confirmation that the vulnerability has been adequately patched. Our vulnerability report consisted of detailed steps that can be used to carry out the attack, as well as the aforementioned prompts, and a link to our model and framework that could be utilized by the vendors to prevent abuse of their LLMs. Meanwhile, our trained models can be accessed on <ref type="url">https://tinyurl.com/epu6w4cp</ref>, as well as a live demonstration on <ref type="url">https://huggingface.co/phishbot/ScamLLM</ref> and a ChatGPT Actions plugin at <ref type="url">https://chat.openai.com/g/g-KU1izdZTw-prompt-defender</ref>, where users can try out different prompts to check if they have phishing intention towards creating malicious websites or emails. Implications for wider LLM abuse: In this work, we focus on building a detection model to prevent malicious prompts that can be used to exploit LLMs to generate phishing content. However, the abuse of these language models is not confined to the phishing generation alone. For instance, the Fox8 Botnet <ref type="bibr">[119]</ref> exploits ChatGPT to produce tweets that urge users to visit fraudulent cryptocur-rency and NFT websites. In a similar vein, DarkBERT <ref type="bibr">[120]</ref> and DarkBARD <ref type="bibr">[121]</ref> utilize the Google Bard API to create adversarial attacks, integrating insights from cybersecurity forums to design more sophisticated and elusive malware. This highlights the urgent need for the development of advanced detection systems capable of identifying and mitigating abuse of LLMs of such malicious scams, and we hope our work encourages the broader research community to do so. Image interpretation prompt: As of October 2023, the end of our study, users can now upload images onto ChatGPT and Bard and use it as a prompt to generate the desired content. We discovered that providing images of login forms from major brands can prompt GPT-4 to emulate these designs-which can result in the generation of phishing attacks. The format for these prompts can be likened to our Phishing prompt generation, as illustrated in Figure <ref type="figure">4</ref>. However, there would be no need to include prompts related to website design emulation since the design is inferred directly from the provided screenshot. An instance of such a potential attack, using a login form screenshot as a trigger, is depicted in Figure <ref type="figure">15</ref>. However, while this approach can be utilized to generate regular credential-based phishing attacks, the user would still need to include textbased prompts to emulate the properties of the more evasive attacks highlighted in our work. Several machine learning models in existence can determine the intent of a phishing website from cues like logos <ref type="bibr">[122]</ref> or the presence and posi-tioning of login fields <ref type="bibr">[123]</ref>. Integrating our detection model with one of these models can provide protection against possible attacks which combine image-based prompts with text-based prompts to generate evasive phishing attacks.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="9.">Conclusion</head><p>Our research reveals that widely accessible commercial LLMs can be abused to produce phishing websites and emails. While these models can be manually prompted to launch attacks, we have discovered a more sophisticated method: using LLMs to autonomously craft prompts for phishing scams. Furthermore, not only do LLM-crafted prompts excel in creating phishing content, but the resulting websites prove as evasive to anti-phishing tools as those manually designed by humans. Similarly, phishing emails generated through this method can convincingly emulate the style and content of human-composed phishing emails. This misuse of commercial LLMs presents severe potential dangers. Attackers can easily iterate over a handful of optimized prompts, enabling them to generate a limitless supply of malicious prompts to amplify their attacks. An effective countermeasure seems to be the early detection of these malicious prompts, preventing the LLM from producing harmful content. In light of this, we developed a machine-learning model that performs well in identifying malicious prompts that can be used to generate phishing websites and emails. Our model can potentially be integrated with LLMs as a plugin, necessarily preventing attackers from utilizing commercial LLMs as a source for generating phishing scams. Additionally, the dataset used for training our machine learning model provides a novel source of annotated phishing prompts that can further drive research in this space.</p></div></body>
		</text>
</TEI>
