首页 > 其他分享 >BUUCTF:[ASIS 2019]Unicorn shop

BUUCTF:[ASIS 2019]Unicorn shop

时间:2023-06-19 16:36:43浏览次数:72  
标签:shop unicodedata BUUCTF price numeric 2019 unicode 源代码 id


https://buuoj.cn/challenges#[ASIS%202019]Unicorn%20shop

BUUCTF:[ASIS 2019]Unicorn shop_html


BUUCTF:[ASIS 2019]Unicorn shop_html_02


功能是一个购物商店,输入商品ID和价钱进行点击购买。源代码中提醒<meta charset="utf-8">很重要

html使用的是UTF-8编码

BUUCTF:[ASIS 2019]Unicorn shop_ico_03


id和price都为空点击购买,返回报错及原因

BUUCTF:[ASIS 2019]Unicorn shop_html_04


从中可以发现源代码是如何处理price

使用的是unicodedata.numeric()

>>> import unicodedata
>>>
>>> unicodedata.numeric('1')
1.0
>>> unicodedata.numeric('11')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: numeric() argument 1 must be a unicode character, not str
>>>
>>> unicodedata.numeric('7')
7.0
>>> unicodedata.numeric('17')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: numeric() argument 1 must be a unicode character, not str
>>>

BUUCTF:[ASIS 2019]Unicorn shop_ico_05


只能输入单个字符,猜测flag就是id = 4、price >= 1337 前端html使用的是utf-8,后端python处理使用的是unicode,编码不一致造成了转码问题利用这个网站https://www.compart.com/en/unicode 找一下大于单个字符数值化之后1337的

BUUCTF:[ASIS 2019]Unicorn shop_ico_06


BUUCTF:[ASIS 2019]Unicorn shop_python_07


找到这个字符的UTF-8 Encoding0xF0 0x90 0x84 0xA3

0x替换成%

id=4&price=%F0%90%84%A3

购买得到flag

BUUCTF:[ASIS 2019]Unicorn shop_ico_08


标签:shop,unicodedata,BUUCTF,price,numeric,2019,unicode,源代码,id
From: https://blog.51cto.com/u_16159500/6515567

相关文章

  • BUUCTF:[羊城杯 2020]image_rar
    binwalk分析xiao_mi2.mp4发现很多压缩包,压缩了很多图片将xiao_mi2.mp4修改后缀改为xiao_mi2.zip得到一个hint,但这个压缩包密码并不是指当前的zip压缩包继续往后看,解压这些图片之后发现里面只有65.jpg显示不正常010Editor打开65.jpg文件头ara!,非常类似rar压缩包的文件头Rar!,修......
  • BUUCTF:[UTCTF2020]sstv
    https://buuoj.cn/challenges#[UTCTF2020]sstvattachment.wavKali安装QSSTVapt-getinstallqsstvOptions->Configuration->Sound勾选Fromfile然后点击这个小按钮,选择attachment.wav开始解码flag{6bdfeac1e2baa12d6ac5384cdfd166b0}......
  • BUUCTF:[BSidesSF2019]table-tennis
    https://buuoj.cn/challenges#[BSidesSF2019]table-tennisattachment.pcapng在ICMP包的尾部发现html代码,其中有打印base64信息拼接起来就是Q1RGe0p1c3RBUzBuZ0FiMHV0UDFuZ1Awbmd9>>>importbase64>>>base64.b64decode('Q1RGe0p1c3RBUzBuZ0FiMHV0UDFuZ1Awbmd9')b&......
  • BUUCTF:[GUET-CTF2019]soul sipse
    https://buuoj.cn/challenges#[GUET-CTF2019]soul%20sipseout.wav可用Steghide无密码分离出download.txtdownload.txthttps://share.weiyun.com/5wVTIN3下载得到GUET.png,修改为正确的PNG文件头保存得到正常的图片。如下\u0034\u0030\u0037\u0030\u000d\u000a\u0031\u0032\u0033\u0......
  • BUUCTF:[INSHack2017]remote-multimedia-controller
    https://buuoj.cn/challenges#[INSHack2017]remote-multimedia-controllerremote-media-controler.pcap流量包中发现一个长度很大的包,里面有一串base64,解了一下发现是套娃,直接用脚本importbase64withopen('base64.txt','r')asfile:codestr=file.read()try:......
  • BUUCTF:[DDCTF2018]流量分析
    https://buuoj.cn/challenges#[DDCTF2018]%E6%B5%81%E9%87%8F%E5%88%86%E6%9E%90流量分析.pcap流量分析.txt流量分析200pt提示一:若感觉在中间某个容易出错的步骤,若有需要检验是否正确时,可以比较MD5:90c490781f9c320cd1ba671fcb112d1c提示二:注意补齐私钥格式-----BEGINRSAPR......
  • BUUCTF:[BSidesSF2019]diskimage
    https://buuoj.cn/challenges#[BSidesSF2019]diskimageattachment.pngzsteg-aattachment.png发现磁盘数据zsteg-e'b8,rgb,lsb,xy'attachment.png>data.dat分离出FAT格式的数据使用TestDisk对文件进行分析testdiskdata.dat[Proceed]回车[None]回车[Boot]回车[RebuildsBS]......
  • BUUCTF:[CFI-CTF 2018]webLogon capture
    https://buuoj.cn/challenges#[CFI-CTF%202018]webLogon%20capturelogon.pcapng包的数量很少,随便抓个包跟踪一下流即可发现passwordPSC:\Users\Administrator>php-r"var_dump(urldecode('%20%43%46%49%7b%31%6e%73%33%63%75%72%33%5f%6c%30%67%30%6e%7d%20'));"Co......
  • BUUCTF:[SWPU2019]伟大的侦探
    题目地址:https://buuoj.cn/challenges#[SWPU2019]%E4%BC%9F%E5%A4%A7%E7%9A%84%E4%BE%A6%E6%8E%A2密码.txt可解压,misc文件夹需要解压密码,将密码.txt使用010Editor打开,使用EBCDIC编码即可发现密码明文解压,misc文件夹内容如下:福尔摩斯小人密码对照得到:iloveholmesandwllmflag{ilov......
  • BUUCTF:[WUSTCTF2020]spaceclub
    题目地址:https://buuoj.cn/challenges#[WUSTCTF2020]spaceclub一个txt用记事本打开的话,什么都看到确有4kb的大小,联想题目名字spaceclub,使用ctrl+a全选就看清楚了notepad这样全选可能还是不太直观,我这里用sublime打开然后全选一开始以为是摩斯密码,后来发现是每一行的长短对应一个......