当前位置:网站首页>[GXYCTF2019]SXMgdGhpcyBiYXNlPw==
[GXYCTF2019]SXMgdGhpcyBiYXNlPw==
2022-06-21 22:22:00 【[mzq]】
[GXYCTF2019]SXMgdGhpcyBiYXNlPw==
查看flag.txt,下意识就认为应该是base隐写
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()

边栏推荐
- Component value transfer: child components transfer data to parent components
- 洞見數據價值,啟迪數字未來,《數字化的力量》問世
- JS implementation of Fibonacci sequence
- How to modify the judgment time of the equipment in the offline state when the national standard equipment is registered on the easycvr platform?
- pytorch可视化
- Infant name [adjacency matrix and DFS of connected components]
- 被八股文害惨了。。。。
- Insight into the value of data, enlighten the digital future, and the power of digitalization came out
- Today's sleep quality record 81 points
- 微博关闭发布多个兼职诈骗信息违规账号:如何打击数据造假灰产
猜你喜欢
随机推荐
Win11 hotspot connection successful but no network? Solution of win11 mobile hotspot and network conflict
青春无言│用技术定格毕业季最美好的回忆
企业综合组网实训二
Fork join thread pool
Google AI big model lamda can one day replace the search engine? Google researcher: search can be re imagined as a two-way dialogue between users and languages
洞见数据价值,启迪数字未来,《数字化的力量》问世
VB screen resolution setting and acquisition_ hawkol_ Sina blog
Promise error capture processing -- promise Technology
What is the fault when the router is connected but not connected to the network
路由器连接上但上不了网是什么故障
Object划分
组件传值:子组件向父组件传递数据
How to uninstall windows SQL Server cleanly?
无法定位程序输入点于动态链接库怎么办
Component value transfer: child components transfer data to parent components
Go语言学习教程(十二)
Operate files through QT drag events
Résolution de l'erreur de développement du système Kirin "erreur réelle: gl / gl.h: pas de fichier ou de répertoire"
The solution to the error "xxx.pri has modification time XXXX s in the futrue" in the compilation of domestic Kirin QT
Student management system experiment report -asp Net programming




![spacy. load(“en_core_web_sm“)###OSError: [E050] Can‘t find model ‘en_core_web_sm‘.](/img/f5/e6e480f69481bef826b155fab57669.png)




