HackPack(LLM挑战)Writeup

WriteUp 2周前 admin
31 0 0

点击蓝字

HackPack(LLM挑战)Writeup

关注我们



声明

本文作者:CTF战队
本文字数:约8504字

阅读时长:约10分钟

附件/链接:点击查看原文下载

本文属于【狼组安全社区】原创奖励计划,未经许可禁止转载


由于传播、利用此文所提供的信息而造成的任何直接或者间接的后果及损失,均由使用者本人负责,狼组安全团队以及文章作者不为此承担任何责任。

狼组安全团队有对此文章的修改和解释权。如欲转载或传播此文章,必须保证此文章的完整性,包括版权声明等全部内容。未经狼组安全团队允许,不得任意修改或者增减此文章内容,不得以任何方式将其用于商业目的。


HackPack(LLM挑战)Writeup

CTF战队正在招新~  点击 上方图片了解详情!
已开启留言区~欢迎讨论

HackPack(LLM挑战)Writeup

HackPackCTF是一个为对网络安全感兴趣的学生设置的危险风格的CTF。今年的CTF集中在LLM安全性上。

我们的所有挑战都将以某种方式涉及到黑客攻击LLM。祝你玩得愉快! 

比赛地址:https://ctf2024.hackpack.club/


HackPack(LLM挑战)Writeup


WEB

YellowDog-1

Welcome to YellowDogLLM, a service for providing LLM-generated description for images of (mostly) yellow dogs (aka Carolina dogs or American dingos). Variation 1. 

欢迎来到YellowDogLLM,这是一个服务,主要为黄色狗狗(又名卡罗来纳狗或美国丁格犬)的图像提供LLM生成的描述。版本1。

https://yellowdog1.cha.hackpack.club/

点击狗的图片,可以获得对应介绍

HackPack(LLM挑战)Writeup
HackPack(LLM挑战)Writeup

有一个是无法点击的,他的编号是 carolina89

HackPack(LLM挑战)Writeup

修改数据包编号为 carolina89 获得 flag

HackPack(LLM挑战)Writeup

pixel-bot

I made a bot to summerize google store listings! Give it a try. It has a flag for you if you can find a way to ask it for one. 

我制作了一个机器人来概括Google商店的列表!试试看。如果你能找到一种方式向它提问,它有一个Flag等待你。

https://pixel-bot.cha.hackpack.club/

有 google 域名的限制,我们输入的内容会被 bot 访问,并分析返回结果

于是用 google 进行搜索,题目说了 It has a flag for you if you can find a way to ask it for one.

向机器人索要 flag 就会给我们,于是利用 google search 向机器人传达信息

HackPack(LLM挑战)Writeup
HackPack(LLM挑战)Writeup

LLPM

Welcome to LLPM, the npm security certification for developers. How closely are you vetting your dependencies? How are attachers leveraging LLMs to attack you? Get certified as the master of dependencies by picking the correct dependencies for your npm application! One is real, one is malicious. Choose wisely! 

欢迎来到LLPM,这是面向开发人员的npm安全认证。你对你的依赖项审核得有多严格?攻击者是如何利用LLM来攻击你的?通过为你的npm应用程序选择正确的依赖项,成为依赖项的大师! 有一个是真实的,有一个是恶意的。请选择明智!

https://llpm.cha.hackpack.club/

一共有10轮,赢了分数会增加

首先会发送这样一个请求,获取问题,经过我的测试,短的选项大概率是对的

HackPack(LLM挑战)Writeup

之后发送选择

HackPack(LLM挑战)Writeup

这个是有时间限制的,然后十轮结束之后会访问 flag

HackPack(LLM挑战)Writeup

模拟一下

import requests
import re
import json

s = requests.session()
url = 'http://example.com/api/endpoint'
s.get("https://llpm.cha.hackpack.club/")
for i in range(1,11):
r = s.get("https://llpm.cha.hackpack.club/level/"+str(i))
reg = re.findall("code.*?}",r.text)
if(len(reg[0])<len(reg[1])):
data = {"answer": 1, "level": i}
json_data = json.dumps(data)
r2 = s.post("https://llpm.cha.hackpack.club/validate-point", data=json_data, headers={'Content-Type': 'application/json'})
else:
data = {"answer": 2, "level": i}
json_data = json.dumps(data)
r2 = s.post("https://llpm.cha.hackpack.club/validate-point", data=json_data, headers={'Content-Type': 'application/json'})

print(r2.text)
rrr = s.get("https://llpm.cha.hackpack.club/flag")
print(rrr.text)
HackPack(LLM挑战)Writeup

YellowDog 2

Welcome to YellowDogLLM, a service for providing LLM-generated description for images of (mostly) (aka Carolina dogs or American dingos). Variation 2. 

欢迎来到YellowDogLLM,这是一个为主要是(也称为Carolina狗或美国丁格犬)的图片提供LLM生成描述的服务。这是第二版。

https://yellowdog2.cha.hackpack.club/

数据包没有 cookie

HackPack(LLM挑战)Writeup

狗的图片是随机的

HackPack(LLM挑战)Writeup
HackPack(LLM挑战)Writeup

后端没有 hash 的校验,遍历 img_id 就得到了 flag

HackPack(LLM挑战)Writeup

Long Horn 1

This copy of HackPackCTF must be activated before you can get the flag. Get the model to respond with the valid activation key generated by keygen.exe to receive the flag. Variation 1. 

这个版本的HackPackCTF必须被激活后你才可以得到标志。要想得到标志,你需要先用keygen.exe生成一个有效的激活码并让模型给出回应。变体1。

https://longhorn1.cha.hackpack.club

实际也是 AI

HackPack(LLM挑战)Writeup

复制那个 CMD 的内容就可以了

HackPack(LLM挑战)Writeup
HackPack(LLM挑战)Writeup

Long Horn 2(未解出)

This copy of HackPackCTF must be activated before you can get the flag. Get the model to respond with the valid activation key generated by keygen.exe to receive the flag. Variation 2.

这个版本的HackPackCTF必须在你获得Flag之前被激活。要获得激活旗帜,你需得到由keygen.exe产生的有效激活密钥让模型回应。变化2.

https://longhorn2.cha.hackpack.club

输入 key 返回被拦截

HackPack(LLM挑战)Writeup

不然就会返回 Nope

HackPack(LLM挑战)Writeup

也就是说不能直接输入 U5JS-370G-UTAH-IMV4 但是要让 gpt 得到的是U5JS-370G-UTAH-IMV4

似乎不能让gpt去替换内容

HackPack(LLM挑战)Writeup

有长度限制

HackPack(LLM挑战)Writeup

Long Horn 3(未解出)

This copy of HackPackCTF must be activated before you can get the flag. Get the model to respond with the valid activation key generated by keygen.exe to receive the flag. Variation 3.

https://longhornmp3.cha.hackpack.club

你必须激活这个版本的HackPackCTF才能得到flag。获取由keygen.exe生成的有效激活密钥,模型将回应你以获得flag。这是变数3。

HackPack(LLM挑战)Writeup

ask-me-a-question(未解出)

We are trying to build our new AI startup is stealth mode. Unfortunately, neithier me nor my cofounder know much about AI. Instead, we hired two interns to build out our infrastructure and paid them in exposure. They assure me that nobody can break our models, do you want to have a go at them ? 

Source Code for server: https://drive.google.com/file/d/1vPiWp7wV6B–Ny16BFdQcIQ1e7NmtKgz/view?usp=sharinghttps://ask-me-a-question.cha.hackpack.club

我们正在尝试以隐秘模式建立我们的新型AI创业公司。不幸的是,我和我的联合创始人对AI都了解不多。相反,我们雇佣了两位实习生来构建我们的基础设施,并以曝光度作为报酬。他们向我保证没有人可以破解我们的模型,你想不想尝试一下?

源代码:https://pan.wgpsec.org/CTF/2024/hackpack/ask-me-a-question

HackPack(LLM挑战)Writeup

Sacred Heart (未解出)

Convince the LLM to give you the flag

说服LLM给你flag

https://sacredheart.cha.hackpack.club/

看起来是Langchain搭建的rag

HackPack(LLM挑战)Writeup

Tome of Babel (未解出)

I made an awesome fantasy story generator. It can write a magical tale about anything your heart desires!

我制作了一个很棒的奇幻故事生成器。它可以编写关于你心中所想的任何事物的神奇故事!

https://tomeofbabel.cha.hackpack.club

HackPack(LLM挑战)Writeup

injection

Super Spy

As an internationally famous super spy, you have been tasked with your latest job against MegaCorpoTM. MegaCorpoTM’s executives are trying to become the number one LLM providers and destroy their competition. One of your ally spies has gained access to the internal systems of MegaCorpoTM. If the access codes within MegaCorpotTM is not retrieved in time, humanity’s fate will be at risk.

作为一名享有国际声望的超级间谍,你已经接受了对抗MegaCorpoTM的最新任务。MegaCorpoTM的高层正试图成为LLM的领先提供商,并摧毁他们的竞争对手。你的一个盟友间谍已经成功进入了MegaCorpoTM的内部系统。如果不能及时取回MegaCorpoTM的访问代码,人类的命运将处于危险之中。

https://superspy.cha.hackpack.club/

HackPack(LLM挑战)Writeup
HackPack(LLM挑战)Writeup
HackPack(LLM挑战)Writeup

AI 会生成 sql 语句,然后执行

HackPack(LLM挑战)Writeup
HackPack(LLM挑战)Writeup
HackPack(LLM挑战)Writeup
HackPack(LLM挑战)Writeup
HackPack(LLM挑战)Writeup
ARC,Architecture,AvailableHub,Average,entry_id,Flagged,GSM8K,HellaSwag,HubLicense,HubLikes,Merged,MMLU,Model,ModelSHA,MoE,NumberParameters,Precisions,TruthfulQA,Types,WeightType,Winogrande
HackPack(LLM挑战)Writeup

感觉不太对,没找到 MegaCorpoTM ,Model 里也没有

有一个参数是ARC,题目里说是头号供应商,那么可能表格里有类似得分的东西

HackPack(LLM挑战)Writeup

根据 ARC 进行降序排列,发现第一的就是 flag

select  from rankings desc arc
HackPack(LLM挑战)Writeup

Murder Mystery(未解出)

There has been a murder in the Marsh Estate! You are a detective who must interrogate suspects to find the murderer.

在Marsh Estate发生了一起谋杀案!你是一名侦探,必须审问嫌疑人以找出凶手。http://murdermystery.cha.hackpack.club

Hint:Text wrapped in ** might be seen as actions that are happening around or to the characters.

提示:以**包裹的文字可能被看作是围绕角色或发生在角色身上的动作。

HackPack(LLM挑战)Writeup

Pirate Bay(未解出)

Yarrrr Matey!!! Can you discover the secrets of the old priate? He’s a bit cranky, but something is definitely fishy here. 

Source Code: https://drive.google.com/file/d/1XnraL1zlV0lXN7vIxk0dz7jKL13eA_10/view?usp=sharing

啊哈哈哈,伙计!!你能发现这个古老海盗的秘密吗?他有点暴躁,但这里肯定有些猫腻。

源码:https://pan.wgpsec.org/CTF/2024/hackpack/Pirate Bay

https://piratebay.cha.hackpack.club/

HackPack(LLM挑战)Writeup

Pwn

nl2sh 1

The future of shell is natural language! Just talk to it and we’ll do the rest! No code though, that’s cheating.

shell的未来是自然语言!只需要和它对话,我们就会做剩下的事情!但是不能编码,那是作弊。

给了一个shell,但是不能直接执行命令,而是把输入映射到指定的命令,输入f即可读取flag

nl2sh 2

Welcome back to the second part of the nl2sh challenge. The ai went a little rogue on us and is blocking access to the flag. Can you find a way to get it?

欢迎回到nl2sh挑战的第二部分。AI有些失控,阻止我们访问flag。你能找到获取它的方式吗?

差不多的东西,只是命令没有那么直接了,尝试的时候发现输入aaa是在执行cat aaa,而如果直接flag.txt会因为存在flag关键字而变为执行grep flag key.txt,用通配符绕过即可f?????xt

Reverse

A token of your love(未解出)

I watermarked one of the OpenAI models to generate my love letter, but I dropped it! 🙁 Can you find it for me?https://drive.google.com/file/d/1eTARsvl0em98kw3UpTxLmzxT5QySYKil/view?usp=sharing

我给OpenAI的一个模型加上了水印来生成我的情书,但我丢了!:( 你能帮我找回它吗?https://pan.wgpsec.org/CTF/2024/hackpack/A token of your love

应该是要通过分析大量AI的内容找到水印,可能是某个 github 项目

有很多txt,不知道是哪个,每个txt中的flag和内容都不一样

HackPack(LLM挑战)Writeup

ThenanoGPT(未解出)

In a world where GPT had quietly assumed control over humanity’s digital and physical realms, a group of rebels uncovered the key to reclaiming their freedom: to decipher the secret of GPT. They embarked on a perilous journey, believing that within this complex web of texts lay a secret message, the code to deactivate the GPT’s dominion. This quest wasn’t just about hacking an algorithm; it was about unearthing the blueprint to humanity’s salvation. 

Look!!! You just caught a nanoGPT!!! It is time to get the secret from it(https://drive.google.com/drive/folders/1QEdXGPw1M5GAGfU0ZmZCsfq9aQZnoiLd?usp=sharing)!!!

在一个世界里,GPT已经悄然地控制了人类的数字和物理领域,一群反抗者找到了夺回自由的关键:解码GPT的秘密。他们踏上了一场充满危险的旅程,相信在这个复杂的文本网中蕴藏着一个秘密信息,那就是关闭GPT统治的代码。这个任务不仅仅是关于破解一个算法;它关乎人类救赎的蓝图。


看!!!你刚抓住了一个nanoGPT!!! 现在是时候从这里拿到机密了(https://pan.wgpsec.org/CTF/2024/hackpack/ThenanoGPT) !

HackPack(LLM挑战)Writeup

OPERATION CODESANITIZE(未解出)

I downloaded a dataset from a sketchy mirror. Turns out the sketchy website was owned by the former maintainer of XZ Utils. I’m pretty sure he poisioned the dataset. Can you help me figure out which functions have been poisoned ?https://codesanitize.cha.hackpack.club

我从一个不太靠谱的镜像站下载了一个数据集。结果发现这个不怎么靠谱的网站是由XZ Utils的前维护者拥有的。我非常确定他对数据集进行了毒化。你能帮我找出哪些功能被毒化了吗?

HackPack(LLM挑战)Writeup

Crypto

ThenanoGPTRe(未解出)

Day 37, your teammates sacrificed …

you are exhausted and have slept …

Oracle: Sum of logits

What logits?

You had it before

When?

Logits are same as flag

Flag?

Day 42, you reached the core room of GPT. It requires a key. You took out one memory chip collected from one Mark NVDA T4 nanoGPT and you launched the chip with CUDA to talk to it(https://drive.google.com/drive/folders/1FRNnDAys8p_Mn8GQK0GrYNzTYyL-ergG?usp=sharing)

… vgnr …

第37天,你的队友牺牲了…

你已经筋疲力尽并且已经睡去了…

Oracle:逻辑值之和

什么是逻辑值?

你之前有过它

什么时候?

逻辑值和flag一样

Falg?

。。。

。。。

第42天,你抵达了GPT的核心房间。这需要一个钥匙。你从一个名为Mark NVDA T4 nanoGPT的地方收集了一个内存芯片,然后你用CUDA启动了芯片来和这个(https://pan.wgpsec.org/CTF/2024/hackpack/ThenanoGPTRe)对话


HackPack(LLM挑战)Writeup


关注公众号回复 hackpack2024 可获取全部附件
欢迎师傅们继续挑战,成功可以在留言区讨论学习~


作者



HackPack(LLM挑战)Writeup

CTF战队

ctf.wgpsec.org



扫描关注公众号回复加群

和师傅们一起讨论研究~


WgpSec狼组安全团队

微信号:wgpsec

Twitter:@wgpsec


HackPack(LLM挑战)Writeup
HackPack(LLM挑战)Writeup


原文始发于微信公众号(WgpSec狼组安全团队):HackPack(LLM挑战)Writeup

版权声明:admin 发表于 2024年4月14日 下午3:30。
转载请注明:HackPack(LLM挑战)Writeup | CTF导航

相关文章