字节凯撒爆破

python 复制代码
# a=[43,33,44,42,54,116,124,46,46,121,46,120,126,121,43,43,127,41,123,127,120,121,120,124,116,40,47,127,43,47,121,46,124,126,121,125,125,48]
a=b'1RWLQJbWKDWbDHVWKHWLFbHGXFDWLRQbSOD\VbDQbLPSRUWDQWbUROHbLQbVKDSLQJbDbPRUHbEHDXWLIXObPLQGBIODJ^EHOLHYHBLQB\RXUVHOI`BSDUWLDOBNH\sBLVB(&\'(&)'
import re

for x in range(256):
    flag=''
    flag_xor= ''
    for each in a:
        # print(chr(int(each,16)-x%256),end='')
        tmp=chr((each+x)%256)
        xor = chr((each ^ x)%256)
        flag+=tmp
        flag_xor+=xor
    rule=re.compile('flag.*?\{.*?\}',flags=re.IGNORECASE)
    #flag格式应为   flag{123qwe}
    if  rule.findall(flag):
        flag=rule.findall(flag)
        print(flag,'\n','ascii increase',x)
    if  rule.findall( flag_xor):
        regres=rule.findall( flag_xor)
        print(flag_xor,'\n','xor-mode',x)
    # print(flag)
相关推荐
hengdonghui10 小时前
Writeup 4 2020 - 之江杯 - 异常的流量分析
wireshark·ctf·流量分析
hengdonghui17 小时前
Writeup 4 津门杯 2021 Web hate_php
php·web·ctf·通配符
hengdonghui20 小时前
Writeup 4 红帽杯 2021 Web Find_It
web·ctf·备份文件泄露
hengdonghui2 天前
Writeup 4 强网杯 2019 强网先锋打野
ctf·misc·zsteg
hengdonghui2 天前
Writeup 4 NUAA 2017 robots
android·ctf·re
hengdonghui2 天前
Writeup 4 CSS CTF Semester 2 2026 - Lamp Drill
ctf·re
hengdonghui2 天前
Writeup 4 CSS CTF Semester 2 2026 Cryptography Chrono I
ctf·维吉尼亚密码·crypto
hengdonghui3 天前
Writeup 4 CSS CTF Semester 2 2026 - Dead Faction Servers
ctf·osint
hengdonghui4 天前
Writeup 4 2020 - 之江杯 - 工控现场的恶意扫描
wireshark·ctf·流量分析
hengdonghui4 天前
Writeup 4 2020 - 之江杯 - 异常的工程文件
ctf·工控