LSBf

1575273185670

1575273204914

发现过滤出一张图片。保存二进制。

扫描二维码。

爱因斯坦

图片备注this_is_not_password。

binwalk分出一个压缩包,密码就是图片备注。

视而不见

1575274150297

1575274154684

easy crypto

摩斯电码解出:keyisvigenerecipher

维吉尼亚密码,key是vigenerecipher,解出vigenereencryptionhhh。带flag{}提交。

摩斯: http://moersima.00cha.net/

维吉尼亚密码:https://www.qqxiuzi.cn/bianma/weijiniyamima.php

PS Master

后缀是jpg,但是是gif.

gif分离器分出一个二维码,ps修复。

传感器1

1575279582530

参考:曼彻斯特编码——传感器1

b = str(bin(int('5555555595555A65556AA696AA6666666955',16)))[2:]
if len(b) % 2 == 1:
    b = '0' + b
print(b)

s = ''
for i in range(len(b)//2):
    if b[i*2:i*2+2] == '01':
        s += '1'
    else:
        s += '0'
print(s)

f = ''
for i in range(len(s)//8):
    a = str(hex(int(s[i*8:i*8+8][::-1], 2)))[2:]
    f += a if len(a) == 2 else '0'+a
print(f.upper())
  • 01电平跳变表示1, 10的电平跳变表示0
  • 对二进制流str时注意前面首位是0时,转换得到的串长度并非8的倍数,每八位取值时得到错误数据。(参考上面代码第二行)
  • 根据八位倒序传输协议将二进制每八位reverse(第16行)

传感器2

1575283081758

用上面的脚本跑出解密报文,分别是

FFFF FED31F 63 5055 F8

FFFF FED31F 42 5055 D7

对比只有两位不同。找规律发现45->0x63,30->0x42,45与30相差5的3倍,0x63与0x42相差33。所以25-> 0x63 - 33/3*4 = 0x37(就是小学的找规律~)

最后一位数据其实也相差33,我也为也是这个规律,于是卡住了。但其实最后一位时是校验位,它等于从ID开始的6位数据之和 & 0xff。(根本想不到好吗??

于是算出flag{FFFFFEB757375055E8}

萌萌哒

一串颜文字,其实是加密的js代码,正式名称叫AAEncode

可以直接再浏览器控制台(console)跑。运行的结果是弹出一个窗口,内有3Nc0d3.txt的文本信息。

以下内容(节选):

゚ω゚ノ= /`m´)ノ ~┻━┻ //*´∇`*/ ['_']; o=(゚ー゚) =_=3; c=(゚Θ゚) =(゚ー゚)-(゚ー゚); (゚Д゚) =(゚Θ゚)= (o^_^o)/ (o^_^o);(゚Д゚)={゚Θ゚: '_' ,゚ω゚ノ : ((゚ω゚ノ==3) +'_') [゚Θ゚] ,゚ー゚ノ :(゚ω゚ノ+ '_')[o^_^o -(゚Θ゚)] ,゚Д゚ノ:((゚ー゚==3) +'_')[゚ー゚] }; (゚Д゚) [゚Θ゚] =((゚ω゚ノ==3) +'_') [c^_^o];(゚Д゚) ['c'] = ((゚Д゚)+'_') [ (゚ー゚)+(゚ー゚)-(゚Θ゚) ];(゚Д゚) ['o'] = ((゚Д゚)+'_') [゚Θ゚];(゚o゚)=(゚Д゚) ['c']+(゚Д゚) ['o']+(゚ω゚ノ +'_')[゚Θ゚]+ ((゚ω゚ノ==3) +'_') [゚ー゚] + ((゚Д゚) +'_') [(゚ー゚)+(゚ー゚)]+ ((゚ー゚==3) +'_') [゚Θ゚]+((゚ー゚==3) +'_') [(゚ー゚) - (゚Θ゚)]+(゚Д゚) ['c']+((゚Д゚)+'_') [(゚ー゚)+(゚ー゚)]+ (゚Д゚) ['o']+((゚ー゚==3) +'_') [゚Θ゚];(゚Д゚) ['_'] =(o^_^o) [゚o゚] [゚o゚];(゚ε゚)=((゚ー゚==3) +'_') [゚

http://bxs.cumt.edu.cn/challenge/misc/fxxk/encodes.php改为http://bxs.cumt.edu.cn/challenge/misc/fxxk/3Nc0d3.txt并访问。

看到一下内容(节选):正式名称叫Brainfuck

+++++ +[->+ +++++ <]>++ +++++ +++.. ...<+ ++[-> ---<] >---- -.<++ +[->+
++<]> +++++ ..... <+++[ ->--- <]>-- ---.< +++[- >+++< ]>+++ ++... ..<++
+[->- --<]> ----- .<+++ [->++ +<]>+ ++++. ....< +++[- >---< ]>--- --.+.
<++++ +[->+ ++++< ]>+++ ++.<+ ++++[ ->--- --<]> ----- ..<++ +[->+ 

在线解密:https://www.splitbrain.org/services/ook

github:https://github.com/splitbrain/ook

在线解密有些卡,可以自己本地或服务器上搭一个。

解密得到:(节选)

..... ..... ..... ..... !?!!. ?.... ..... ..... ..... .?.?! .?... .!...
..... ..... !.?.. ..... !?!!. ?!!!! !!?.? !.?!! !!!.. ..... ..... .!.?.
..... ...!? !!.?. ..... ..?.? !.?.. ..... .!.?. ..... ..... ..!?! !.?!!
!!!!! !!!!! ?.?!. ?!!!! !!!!! !!!!! !!!!! !!.?. ..... ..... ..!?! !.?..

虽然看着像,但这并不是解码失败。

观察到只有.!?这三种字符,考虑Ook

OokBrainfuck的加解密在同一个脚本上(就是上面的那个)。

1575293529680

别问我按哪个按钮,自己翻译一下英语就好。你已经是一个成熟的带学生了。

你的石锅拌饭。

1575294869142

培根密码由两种字体表示,分别表a和b,再由26个字母的对应表解密。

参考阅读:https://blog.csdn.net/Nicky_1218/article/details/86626373

alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
cipher = ["aaaaa","aaaab","aaaba","aaabb","aabaa","aabab","aabba","aabbb","abaaa","abaab","ababa","ababb","abbaa","abbab","abbba","abbbb","baaaa","baaab","baaba","baabb","babaa","babab","babba","babbb","bbaaa","bbaab"]
s = '101111010010001010101101101101110011111011010'.replace('1','a').replace('0','b')
flag = ''
for i in range(len(s)//5):
    print(s[i*5:i*5+5],end=' ')
    flag += alphabet[cipher.index(s[i*5:i*5+5])]
print('\n', flag.upper())

据说是个签到题

流量分析,流量很少。

1575295803419

找到这个长度比较长的,追踪TCP流。

1575295831249

bash: cannot set terminal process group (1778): Inappropriate ioctl for device
bash: no job control in this shell
<test/something/welcome/web/upload_function/upload$ ]ls
]ls
No command ']ls' found, did you mean:
 Command 'ils' from package 'sleuthkit' (universe)
 Command 'als' from package 'atool' (universe)
 Command 'fls' from package 'sleuthkit' (universe)
 Command 'jls' from package 'sleuthkit' (universe)
 Command 'ls' from package 'coreutils' (main)
 Command 'ols' from package 'speech-tools' (universe)
 Command 'hls' from package 'hfsutils' (main)
 Command 'bls' from package 'bacula-sd' (universe)
 Command 'bls' from package 'bareos-tools' (universe)
]ls: command not found
<test/something/welcome/web/upload_function/upload$ ls
ls
c2hlbGw=.php
<test/something/welcome/web/upload_function/upload$ cd ..
cd ..
<lt/evaltest/something/welcome/web/upload_function$ cd ..
cd ..
www@cola:/home/wwwroot/default/evaltest/something/welcome/web$ cd ..
cd ..
www@cola:/home/wwwroot/default/evaltest/something/welcome$ ls
ls
fun
music
others
picture
secret
web
work
www@cola:/home/wwwroot/default/evaltest/something/welcome$ cd se    
cd secret/
www@cola:/home/wwwroot/default/evaltest/something/welcome/secret$ ls
ls
important_secret
not_important_secret
www@cola:/home/wwwroot/default/evaltest/something/welcome/secret$ cd im    
cd im
<test/something/welcome/secret$ cd important_secret/                   ...................
<valtest/something/welcome/secret/important_secret$ ls
ls
very_important
<valtest/something/welcome/secret/important_secret$ cd ve    
cd very_important/
<ng/welcome/secret/important_secret/very_important$ ls
ls
function.py
secrect
<ng/welcome/secret/important_secret/very_important$ cat fun    
cat function.py 
#!/usr/bin/env python
# coding:utf-8
__author__ = 'Aklis'

from Crypto import Random
from Crypto.Cipher import AES

import sys
import base64


def decrypt(encrypted, passphrase):
  IV = encrypted[:16]
  aes = AES.new(passphrase, AES.MODE_CBC, IV)
  return aes.decrypt(encrypted[16:])


def encrypt(message, passphrase):
  IV = message[:16]
  length = 16
  count = len(message)
  padding = length - (count % length)
  message = message + '\0' * padding
  aes = AES.new(passphrase, AES.MODE_CBC, IV)
  return aes.encrypt(message)


IV = 'YUFHJKVWEASDGQDH'

message = IV + 'flag is hctf{xxxxxxxxxxxxxxx}'


print len(message)

example = encrypt(message, 'Qq4wdrhhyEWe4qBF')
print example
example = decrypt(example, 'Qq4wdrhhyEWe4qBF') 
print example


<ng/welcome/secret/important_secret/very_important$ ls
ls
function.py
secrect
<ng/welcome/secret/important_secret/very_important$ cd se    
cd secrect 
bash: cd: secrect: Not a directory
<ng/welcome/secret/important_secret/very_important$ cat se    
cat secrect 
Congratulations on your being cheated.<ng/welcome/secret/important_secret/very_important$ ls
ls
function.py
secrect
<ng/welcome/secret/important_secret/very_important$ cd ..
cd ..
<valtest/something/welcome/secret/important_secret$ cd ..
cd ..
www@cola:/home/wwwroot/default/evaltest/something/welcome/secret$ cd not    
cd not
</something/welcome/secret$ cd not_important_secret/                    ....................
<est/something/welcome/secret/not_important_secret$ ls
ls
trash
<est/something/welcome/secret/not_important_secret$ cd tr    
cd trash/
<mething/welcome/secret/not_important_secret/trash$ ls
ls
flag
<mething/welcome/secret/not_important_secret/trash$ cat fl    
cat flag 
mbZoEMrhAO0WWeugNjqNw3U6Tt2C+rwpgpbdWRZgfQI3MAh0sZ9qjnziUKkV90XhAOkIs/OXoYVw5uQDjVvgNA==<mething/welcome/secret/not_important_secret/trash$ ls
ls
flag
<mething/welcome/secret/not_important_secret/trash$ exit
exit
exit

从上面找到相关的参数,解密:

1575295883423

大家来找茬

binwalk分离出两张看似相同的图片。

使用stegsolve进行双图分析。

首先open其中一张图片,然后像下图这样打开另一张。

1575298757402

但是如果先打开00000000.png再通过image combiner打开00000668.png,看到的二维码是这样的:

1575298909176

相反顺序是这样的:

1575298788311

所以说要尝试不同先后顺序。

PS反色处理(快捷键ctrl+i)

我就想试试这个名字到底能够起多长

LSB拿到压缩包,忽略压缩包损坏的提示,提取出一个elf文件,脱节IDA直接看到flag.

1575299287040

1575299300807

md5

hash长度扩展攻击。

参考:

hashpump安装:

git clone https://github.com/bwall/HashPump
apt-get install g++ libssl-dev
cd HashPump
make
make install

1575303436341

1575303600353

1575303630265

明文:63 79 72 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 98 00 00 00 00 00 00 00 61 61 61

hash:d1a19d7c6b2f55781603b37a3607aacf

几个误区:

  1. 后面的aaa我写的是97 97 97 。忘了这是16进制了。
  2. 开始时中间全写的是00,看漏了中间的0x98

本题有待继续思考和学习,TODO

猜猜看

使用jphide隐写的图片。

1575346542879

key是flag,输入两次。

OK保存解出的文本。是一串二进制字符串。

with open(r'd:/桌面/11111', 'r')as f:
    dump = f.read()
h = str(hex(int(dump, 2)))[2:]
for i in range(len(h)//2):
    print(chr(int(h[i*2:i*2+2], 16)),end='')

解码得到一个html得图片标签,使用base64保存图片信息。

写入html文件,浏览器打开,发现是二维码。

Last modification:January 7th, 2020 at 04:13 pm