当前位置:网站首页>[GXYCTF2019]SXMgdGhpcyBiYXNlPw==
[GXYCTF2019]SXMgdGhpcyBiYXNlPw==
2022-06-22 00:12:00 【[mzq]】
[GXYCTF2019]SXMgdGhpcyBiYXNlPw==
see flag.txt, Subconsciously think it should be base Steganography 
exp
from urllib3.connectionpool import xrange
def get_base64_diff_value(s1, s2):
base64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
res = 0
for i in xrange(len(s2)):
if s1[i] != s2[i]:
return abs(base64chars.index(s1[i]) - base64chars.index(s2[i]))
return res
def solve_stego():
with open('flag.txt', 'rb') as f:
file_lines = f.readlines()
bin_str = ''
for line in file_lines:
steg_line = line.replace('\n', '')
norm_line = line.replace('\n', '').decode('base64').encode('base64').replace('\n', '')
diff = get_base64_diff_value(steg_line, norm_line)
print diff
pads_num = steg_line.count('=')
if diff:
bin_str += bin(diff)[2:].zfill(pads_num * 2)
else:
bin_str += '0' * pads_num * 2
print goflag(bin_str)
def goflag(bin_str):
res_str = ''
for i in xrange(0, len(bin_str), 8):
res_str += chr(int(bin_str[i:i + 8], 2))
return res_str
if __name__ == '__main__':
solve_stego()

边栏推荐
- Object partition
- HMS Core机器学习服务身份证识别功能,实现信息高效录入
- arm汇编DCB、DCW、DCD、DCQ解析
- 渗透测试-逻辑漏洞专题
- Programming dry goods │ PHP common method encapsulation
- Youth without words │ use technology to frame the best memories of graduation season
- Nearly 90% of servers can be saved, but the anti fraud efficiency has greatly increased. Why is PayPal's plan to break the "Ai memory wall" so cost-effective?
- Software testing -- Classification of tests
- 如何使用tensorboard add_histogram
- vim自动命令事件大全
猜你喜欢

Based on asp Net development of enterprise communication source text message management platform source code

En juin, le classement des langues de programmation a été publié et la langue doit être « féodale ».

ERP is dead, the management background is cold, and seckill system is king!

Component value transfer: value transfer between siblings (value transfer by non parent and child components)

metersphere与jenkins的持续集成

标志位生成

二叉排序树

buuctf misc zip

Here comes the CV overview of target detection, visual weakly supervised learning, brain multimodal imaging technology and so on! Image graphics development annual report review special issue!

Based on vscode platformio under Arduino framework, one project is configured with two compatibility modes of different development boards
随机推荐
Programming dry goods │ PHP common method encapsulation
211高校神級碩士論文刷屏!75行字錯了20行!學校回應:導師停招...
Go语言学习教程(十二)
Redis master-slave replication (9)
目标检测、视觉弱监督学习、大脑多模态成像技术等CV综述来了!图像图形学发展年度报告综述专刊!
What if the word selection box is not displayed for win11 typing? Solution of not displaying word selection box in win11 typing
The minimum non composable sum of arrays
数学知识:约数个数—约数
spacy.load(“en_core_web_sm“)###OSError: [E050] Can‘t find model ‘en_core_web_sm‘.
Get the value value according to the key in the data
Flag bit generation
IDA静态逆向分析工具使用详解
WMS warehouse management system source code
[RoarCTF2019]黄金6年
[Database Course Design] classroom information management system based on SQL Server (with part of source code)
重载和重写的区别
Reddit product director: a necessary NFT member practical guide for Web3 creators
Basic contents of external sorting
【微信小程序】微信小程序使用表单的一些坑和注意事项
标志位生成