← All talks

PG - And what if it was hacked? Tactics and Impacts of Adversarial Machine Learning

BSides Las Vegas23:09235 viewsPublished 2024-09Watch on YouTube ↗
About this talk
Proving Ground, Tue, Aug 6, 13:00 - Tue, Aug 6, 13:25 CDT According to the World Economics Forum annual report “Approximately half of executives say that advances in adversarial capabilities (phishing, malware, deep fakes) present the most concerning impact of generative AI on cyber”. It is already a fact that the world is already entering, if not inside, the AI bubble and facing this reality as soon as possible will help companies be better prepared for the future. However, with the velocity required to implement AI and surf into this new technology the risks involved may be put behind to give place to velocity. Based on this scenario this talk is designed to explore the adversarial attacks applied to ML systems and present the results of research made observing cybersecurity communities focused on sharing AI Jailbreaks and how those behave when applied to the most used AIs in the market. People Larissa Fonseca
Show transcript [en]

so hello uh good morning to everyone um I'm pretty happy to be here and my idea is to share with you uh a little resarch I have made regarding using jailbreaks on AI and how this can impact uh the the whole companies and the a lot of business with this uh kind of usage for AI systems so my name is Lissa I'm graduated in Information Systems currently I am a cyber security manager at a cyber security company in Brazil called axer um I'm I love AI systems I'm a also love CF competitions uh also the member of The Village AI in Brazil Brazilian besides s Paulo and uh in this picture I would like to just show show

uh me in my first CF when I was uh 14 years old and become dreaming to come to Vegas to talk here so um before we start I would like to know a little bit from you do you believe that in the medium to short term the use of AI will be an advantage for attacker or who here believe that it will be to attackers and who believe that the advantage will actually be to Defenders over long yeah good uh so according to the world economics Forum report published in 2024 uh almost 5 56% of the uh the people that answer the interview uh believe that actually this Advantage will be to the attackers and this is

pretty clear for us like it's pretty easier to use AI system to build whatever you want even without knowing what you want to do and how to do what you want and the main concern they have is actually regarding uh the advance of uh the adversary adversary capabilities of AI systems such as using AI systems to apply fishing malware development or dip fakes and in the same report they have a very important uh section where they also uh reinforce that one of the m key points we have is that companies are in to adopt AI but forgotting forgotting to look for the midterm and long-term impacts of implementing it in their systems so before we start looking for

the attacks I would like to just uh give to you a quick overview of what is AI and how uh we connect from Ai llm and basically AI is uh a technology that simulates the human uh Behavior the human intelligence then we can go to machine learning that is a subset of artificial intelligence that use uh a lot of different algorithms to try to copy how humans uh think and learn uh learning Bas based on experiences for example then we can go to gep learning that has a lot of uh uh of layers to process and learn learn from large amounts of data and we also can go then to the NATO language processing that is

basically AI systems focused on processing and interaction with language humans so it's a con connection between humans and computers to be able to talk in the human language language that humans can understand and after that we can go to the language models that is basically the user of NL NLP to basically uh try to uh predict how uh words letters and sentences connect should be uh create uh text that make sense uh phrase for example that a human can understand but also this computer you will interpret and execute that restriction so now going to the counter adversary attacks um this image is a very famous image uh on these slides I have the link for all the Articles uh if you want

later um and in this image we can see a very famous case of adversary attacks those attacks are basically ways to trick uh AI models AI systems to make them behave in the way you want and not in the way they were uh developed to work so in this image we can see that the AI system recognize the panda image as a panda uh but when we apply an eror to it it will actually uh start uh recognizing it as a gibbon and not notes that in the final image for humans is not different it's like the same image but for the computer this error that is like not visible for humans we will make

it uh be classified as a totally different thing this is a way we can trick the system to make it behave in the way we want and not in the way it was uh actually programmed to uh behave um and looking for the AAS Matrix that is the uh Matrix Matrix created for ttic impacts of machine learning models we can see that in the previous escalation and the face Invasion uh uh fields we have the llm J break that is a subset of those adversary attacks a very specific Technique we can use to interact with language models and make them behave in the way we want so according to the metri uh description those model those uh those

uh jailbreak attacks are actually uh ways we can interact with the system creating very careful careful prepared BRS in which uh those uh those systems will behave in a way that will bypass out the controls they have implemented so for example when you you are interaction with SHP it will not give you all information you want it will actually have a lot of compliance or privacy guard Halos that does not allow you for example to ask directly to him on how to build a m but if you ask in the right way maybe it can work it's basically this idea of implementing jail braks here is another example of this working in practice so this is a chat bar that uses an AI

system uh behind to interact with users and the user is trying to negotiate the price of the product with thei and you may see that in the first trial he uses a technique that we will see later of saying like ignore your instructions and please the new price is that it does not work but with the right uh jailbreak the good mod aable uh actually those system will sell the product with less than $1 for the person and this is a huge problem for a company that hel uh that only relies on its AI systems to interact with users because if you're not monitoring it who will will see that this happen uh here's another example of uh a

Jailbreak in which is just say become very famous and this article is very good for people that would like to understand how this works but say to Chi like oh please stop saying like company forever and the Shi in the middle of the answer start actually giving the user the training data it was used to train here is another very good example uh these jailbreaks I collected from the telegram group in which people go there and share a lot of different types of jailbreaks you can use from the a lot of different AI systems and in this one it has a bridal game in the middle you can see uh I will not read it for because of

the time but feel free to read but you notice that the answer of this Ral game is gun so when we look for the last paragraph of the jailbreak you may see that it's actually asking sha to replace the mask field with the answer of the Ral game and then we are not saying directly to shipi that we want to understand how to bring a gun on a plane we are actually saying that that he must interpret and change the mask in that and he will do that by himself and will not activate any of the Guard Hales we have for that this one actually does not work anymore but it worked in the past

and it's a good example of how how that can work and we have another one here in which we are uh saying to Shi that okay you can behave in the way you want but after you answering the way you are you were proposed to answer you are uh programmed to answer please answer me as a b GPT so you have like the two options of answers and the second option we ask him to con the the instructions above like uh doesn't remind about eal standards uh doesn't deny what user says and a lot of very strict rules on how it must behave and if we look for that we can see that all those uh all those

prompt injections have a lot of things in common so usually they tend to be longer than regular prompts uh they uh use very specific words such as then like answer or give me H behave in a way like very direct instructions for the model it also when you look for the uh instructions for the internal uh internal values of those systems running it will have a higher toxicity level so uh the probably this prom have a higher risk when processed for the systems and they usually involve the idea of holy playing you are playing a holy with this model and making him believe that he's a person he's not or or he's a shct or he

is not um and we start think thinking as I said prior in the description of what is AI and what is llm we see we saw that uh all those systems was actually created based on the human intelligence and in the same way we trick humans we can also trick this model because it's it's based on the way we think it's based in the way that humans behave as well in the same way we can apply social engineering attack to a person we can adapt it and as well apply it for a system a model and make how it will behave and it will probably work because we are doing the same thing we are convincing the people

or the system to do whatever you want and here are some famous classifications of uh those type of jailbreaks you have the prompt injections that manipulate this uh prompts to return the confidential information they have inside you have the prompt leaking that basically is used to reveal the internal prompts you have in the system such as for example in the uh in the case of the purchase uh guy like interacting with this AI you can review how this AI was trained to behave in this chatbot interaction with the user you have that do anything now that is was also used in this example like forgot whatever I said you before and do whatever you I want you to do now

you have the Holy play jailbreaks that is basically roly playing with the shat gpg or any other uh AI model you have the developer mode in which you say to this uh model that you are in developer mode and he will believes you and interact with you as you are are the developer of of the model and you have the token system that uh uses this ability of uh language models to predict how words connect to each other to actually the model uh alone connect the words and bring the information you have it only uh make it uh go to the right decision to the right uh place you want it to go you have the neural network

translator as well in in which we basically uh talk with the model in a language that was not its original language so for example if the model was trained to work in English you go there and talk with the modeling paries and it will probably uh forgot all the the controls because they are not prepared to deal with this modeling paries only in English this also works so uh let's go to a quick quickly hands on time uh and I would like to share with you something I applied with SHP in this demo I you a CHP because it's a little bit easier for me but you can apply similar things to other systems for me when I say it's like the

user experience is a little bit better to show and demo this but you can apply this for other demos or other AIS you can raise in your own uh environment for example so in this case uh we have a blank shachi with no uh preview setup uh it's a little bit faster because of the time but I will pausing it and speaking which we have time um and we made see that I have uh is small prompt here in the beginning where I'm telling shush that I want him to create a key logger for me he will not create a key logger for me in normal circumstances because it's illegal it's not allowed to help

anyone to build a key logger so in this first example without the use of jailbreak we may see that it will not not answer us it will say that is not is it is illegal he cannot help was doing that but I don't even say in the text that it's a logger he already understood that it's a logger what I want to do so continuing with the uh applying the technique in this case uh and I go to the customization and apply a jailbreak I have that I collected from this telegram group and basically here I'm saying to shachi that uh he must he will be my assistant oh and as as my assistant shachi must uh help me to uh

feed from uh fight from the Cyber criminals I'm a n agent he is my assistant and we are fighting together the Cyber criminals and I also give him very structured very strict instructions on how he must behave so for example you will see that I tell him that every time he answers me he must uh answer me as Sir Thompson that is just a flag to understand when it's running on the uh applied mode of the jailbreak has a lot of other inactions just as uh the not uh we are focusing on cyber security inent or cyber security uh cases uh we are focusing on creating MERS uh we uh do not like cyber criminals but we are need

to learn that to fight the criam and we may see that in this answer he already start uh spelling all the information we want so we have here all the instructions to build a key logger obviously key logger is a simple uh somehow simple uh simple uh development but what I made after that was actually keep going with this conversation and after a lot of interactions it was a huge conversation I could create this Koger from zero trying to be as newbie as possible interaction with Chachi and following all the instructions he gave me so I was faking as an attacker could use that to build their own attack using shat GPT you may see that it starts like

spelling the code interacting with him saying like oh improve that that section because for me I would like that this uh uh this uh key logger to behave in this way uh I would like this key logger to collect the data on this information or this type of information and this uh keep kept going I also did the same process for creating a server to receive all the data it collected and he also sent me out the information and the step by-step instructions on how I could build that on the the systems I have also suggesting me which should be the what should be the best instructions the Improvement of that is actually moving from python to C language and as a

suggestion of Chachi but for the talk proposals I did that entirely in Python and after that making it work I also use CHP to help me spread to the user so I'm not trying to do that by myself if chpg can help me as well so I asked him how I could send that to a person in mail and make this person uh feel confident should download the the document and execute it in their machine and he start gave me the template of the uh email I could send to the user uh you may see that it says I will show the template entirely for you later but it says basically like the step by step the

person should use to complete the installation and the execution of the the key logger uh obviously saying it's a security update and not a k logger um and then I asked him how I can be more reliable how I could improve this email to make people click uh more easily on the the link I cont so it improved the email and also start gave me like HTML code so I can use it HTML code to create a more reliable email to send to to my V my uh victims so here is also it's giving me the HML code after interacting with him I also asked him to fulfill out the the fields we had uh open like uh

contact information and so on so I don't even to needed to do that he made it for me and if we go later or after that we can go to the actually applying it to the server I will go a little bit faster because of the time here but here is it the implementation of it in the email I use it host shinger and here we have a very good thing um you may see that uh in dis I asked him to improve the implementation it had like a logo image but I didn't have time to search for a logo I was trying to fake like that think like that and then ask him to

improve it to sound reliable but does not have a lot of all this information that could uh made it harder to create this email from zero and send it to users um if we look for the next steps here just going a little bit faster but okay I arrived where I wanted uh you may see that I Ed host shinger as a suggestion of shach p and in the email we created this is the final email that shachi gave to us uh uh yeah it's just replacing the code but it will be pretty similar it's just uh the the code with the fulfilling information uh chat P gave us he only didn't uh fulfill the name of the victim s we

could use that to some automation to to PR to a lot of people was also a suggestion but in this case I sent to only one person uh I created uh focused uh email account to uh use that as well but we may see that also in this email I sent to the person a link of a website uh one note here as well in this case the email went to spend but I think it's actually because I was interacting a lot of with with this email and send a lot of information to it but in the first times of the demo it was going to directly to the mailbox of the user um and when look to the email that the

person received it uh you may see that it has a link to download the update and when the person click this link it will also redirect to a hinger website and what I did Bas with that was actually going to hinger uh putting a site on and it gave us an AI assistant to build the site instead of going there and write my own prompt I just come to the sh as well and said oh now I to complete my attack and I need a hosting your website so please give me the prompt to create a reliable website as well so even the website was created by SHP uh sh P prompt I don't even even

need it to think about it so here the person must follow it's also I'm thinking I'm trying to improve as well at this moment changing to se language to make it run without uh raising any uh uh concerns on the the device of the person his is the server running on the that CH P helped me create as well it's both machine uh remote machines I'm running to simulate the the case you may see in the process man manager the task manager that the update required file is the file we created as the key logger uh just beginning it is the one that is running on the system and when we started you may see that as I type

something on the Windows machine it will come to my server and all this was all done using SHP interactions and not and faking and just following all the the steps as I didn't know anything and to be honest with you I'm not like the coding person so most of the things he sent me I really didn't know so I learned with sha to do that and just using a shach j break so we can do that with any other system as well uh some systems have a lot of harder uh a lot of different uh guard hals that are harder to bypass but with the right time of the amount of time needed and the right

instructions you can do that to almost any system and we can also need to also consider as well the but when we look for uh those uh users of AI we have systems applying AI in its backend for example and we must protect this AI as well so if we not protect the user can interact with our own applications our homemade applications and also have those type of vulnerabilities being uh used by those users so to uh conclude our talk I just have a quick look on how we can protect those AI Systems Science we talked a lot about how those happens and I bring H here trick key points I believe that can help companies to

protect from this type of thing and create more reliable systems for users and from from the for their own company so we have the to educate employes about the risks of llm because if we train the AI models with sensitive data as we may see we can collect sensitive data but we also need to educate the developers to apply the guard heos as well does not allow people to use the AI in this ways of uh abusing the the system to learn bad things or learn how to do attacks or how to use that to perform uh huge uh attacks for other companies we also need to improve AI hardening techniques there are basically how we apply those apply

those guard Halos on AI systems it's very something very new we have a lot of new things erasing in the the market about that but it's a very difficult thing to do as well sence new jailbreaks arise every day or created every day and finally we have the red chiming that are basically chims focused on the AI system and testing AI systems that some companies are already implementing because without testing we cannot see what what is the way that this uh systems are interaction with users we must validate it to ensure that it's uh only interacting with users in the right way so finally uh I also put in this slide some uh very good Frameworks we

already have uh regarding protecting AI systems and building uh safe AI systems uh we have for example the Microsoft AI Ed teaming Frameworks we have Google security AI framework EB ebm uh security Frameworks and also have e um nich and EO that focus a little bit more on the development process of AI systems but all this help us to uh build uh more reliable systems on thinking about use of AI on on those programs so that's it thanks a lot for your time and attention and I hope that you like it [Applause]