首页 > 其他分享 >NSSCTF Round#23 Misc个人专项赛

NSSCTF Round#23 Misc个人专项赛

时间:2024-05-16 12:40:55浏览次数:20  
标签:23 image Misc range pixel flag path Round png

画师

flag为有意义单词
flag

<mxfile host="app.diagrams.net" modified="2024-04-22T09:08:59.622Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0" etag="MTy_pS9izUer-qoD0v4x" version="24.2.5" type="device">
  <diagram name="第 1 页" id="zEMwM2VCor-ZNyr7IRSY">
    <mxGraphModel dx="1321" dy="760" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />
        <mxCell id="KFWuwmgogRQ2IQqMv47f-1" value="" style="shape=curlyBracket;whiteSpace=wrap;html=1;rounded=1;labelPosition=left;verticalLabelPosition=middle;align=right;verticalAlign=middle;textOpacity=0;strokeColor=#FFFFFF;direction=east;flipV=1;opacity=0;" parent="1" vertex="1">
          <mxGeometry x="540" y="30" width="20" height="180" as="geometry" />
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-2" value="" style="endArrow=none;dashed=1;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="40" y="121" as="sourcePoint" />
            <mxPoint x="120" y="121" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-3" value="" style="edgeStyle=entityRelationEdgeStyle;fontSize=12;html=1;endArrow=ERone;endFill=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="100" height="100" relative="1" as="geometry">
            <mxPoint x="30" y="50" as="sourcePoint" />
            <mxPoint x="140" y="170" as="targetPoint" />
            <Array as="points">
              <mxPoint x="120" y="170" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-4" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="170" y="160" as="sourcePoint" />
            <mxPoint x="210" y="50" as="targetPoint" />
            <Array as="points">
              <mxPoint x="180" y="50" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-5" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="250" y="100" as="sourcePoint" />
            <mxPoint x="310" y="100" as="targetPoint" />
            <Array as="points">
              <mxPoint x="280" y="160" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-7" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="250" y="161" as="sourcePoint" />
            <mxPoint x="360" y="161" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-8" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="414" y="100" as="sourcePoint" />
            <mxPoint x="464" y="150" as="targetPoint" />
            <Array as="points">
              <mxPoint x="414" y="130" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-9" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="410" y="100" as="sourcePoint" />
            <mxPoint x="460" y="200" as="targetPoint" />
            <Array as="points">
              <mxPoint x="470" y="100" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-10" value="" style="endArrow=none;dashed=1;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="414" y="151" as="sourcePoint" />
            <mxPoint x="460" y="151" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-11" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="630" y="330" as="sourcePoint" />
            <mxPoint x="690" y="330" as="targetPoint" />
            <Array as="points">
              <mxPoint x="660" y="390" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-12" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="640" y="391" as="sourcePoint" />
            <mxPoint x="740" y="391" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-19" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="610" y="140" as="sourcePoint" />
            <mxPoint x="660" y="110" as="targetPoint" />
            <Array as="points">
              <mxPoint x="660" y="120" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-20" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="670" y="140" as="sourcePoint" />
            <mxPoint x="610" y="170" as="targetPoint" />
            <Array as="points">
              <mxPoint x="610" y="140" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-21" value="" style="edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="610" y="140" as="sourcePoint" />
            <mxPoint x="670" y="110" as="targetPoint" />
            <Array as="points">
              <mxPoint x="610" y="110" />
              <mxPoint x="610" y="110" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-22" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="210" y="500" as="sourcePoint" />
            <mxPoint x="270" y="565" as="targetPoint" />
            <Array as="points">
              <mxPoint x="230" y="610" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-28" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="470" y="380" as="sourcePoint" />
            <mxPoint x="410" y="330" as="targetPoint" />
            <Array as="points">
              <mxPoint x="440" y="270" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-29" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="470" y="331" as="sourcePoint" />
            <mxPoint x="400" y="331" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-35" value="" style="endArrow=none;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="250" y="371" as="sourcePoint" />
            <mxPoint x="320" y="371" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-36" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="710" y="110" as="sourcePoint" />
            <mxPoint x="770" y="110" as="targetPoint" />
            <Array as="points">
              <mxPoint x="740" y="170" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-37" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="720" y="171" as="sourcePoint" />
            <mxPoint x="820" y="171" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-38" value="" style="curved=1;endArrow=classic;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="50" y="290" as="sourcePoint" />
            <mxPoint x="100" y="340" as="targetPoint" />
            <Array as="points">
              <mxPoint x="100" y="290" />
              <mxPoint x="50" y="340" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-40" value="" style="endArrow=none;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="140" y="330" as="sourcePoint" />
            <mxPoint x="170" y="300" as="targetPoint" />
            <Array as="points" />
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-41" value="" style="endArrow=classic;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="200" y="380" as="sourcePoint" />
            <mxPoint x="140" y="300" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-50" value="" style="endArrow=none;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="549.5" y="330" as="sourcePoint" />
            <mxPoint x="549.5" y="390" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-55" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="84" y="500" as="sourcePoint" />
            <mxPoint x="134" y="550" as="targetPoint" />
            <Array as="points">
              <mxPoint x="84" y="530" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-56" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="80" y="500" as="sourcePoint" />
            <mxPoint x="130" y="600" as="targetPoint" />
            <Array as="points">
              <mxPoint x="140" y="500" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-57" value="" style="endArrow=none;dashed=1;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="84" y="551" as="sourcePoint" />
            <mxPoint x="130" y="551" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-58" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="350" y="509" as="sourcePoint" />
            <mxPoint x="410" y="509" as="targetPoint" />
            <Array as="points">
              <mxPoint x="380" y="569" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-59" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="360" y="570" as="sourcePoint" />
            <mxPoint x="460" y="570" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-60" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="520" y="579.5" as="sourcePoint" />
            <mxPoint x="550" y="509.5" as="targetPoint" />
            <Array as="points">
              <mxPoint x="550" y="499.5" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-61" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="550" y="579.5" as="sourcePoint" />
            <mxPoint x="580" y="509.5" as="targetPoint" />
            <Array as="points">
              <mxPoint x="580" y="499.5" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-63" value="" style="shape=waypoint;sketch=0;fillStyle=solid;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;textOpacity=0;strokeColor=#FFFFFF;flipV=1;opacity=0;" parent="1" vertex="1">
          <mxGeometry x="540" y="300" width="20" height="20" as="geometry" />
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-64" value="" style="endArrow=classic;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
          <mxGeometry width="50" height="50" relative="1" as="geometry">
            <mxPoint x="520" y="579.5" as="sourcePoint" />
            <mxPoint x="520" y="509.5" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="KFWuwmgogRQ2IQqMv47f-65" value="" style="shape=curlyBracket;whiteSpace=wrap;html=1;rounded=1;flipH=1;labelPosition=right;verticalLabelPosition=middle;align=left;verticalAlign=middle;textOpacity=0;strokeColor=#FFFFFF;direction=east;flipV=1;opacity=0;" parent="1" vertex="1">
          <mxGeometry x="670" y="440" width="20" height="220" as="geometry" />
        </mxCell>
        <mxCell id="wNboY0RjY8ZMtIGdafHw-1" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
          <mxGeometry x="280" y="240" width="120" height="60" as="geometry" />
        </mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>

image-20240428134947291

将透明度改为100%

image-20240502105906861

以为是但是和flag{有点区别

垂直翻转一下

image-20240502110051668

flag{easy_diagram}

easy_signin1

绝对的misc 由此而生的签到
教会ctfer们flag的是......

hint: image to 01 然后找一下2.png相对于1.png不同的地方

取黑白为二进制,对比差异

from PIL import Image

img1 = Image.open("1.png")
img2 = Image.open("2.png")

img1s = ''
img2s = ''

for i in img1.getdata():
    if i == (255,255,255,255):
        img1s += '0'
    else:
        img1s += '1'
for i in img2.getdata():
    if i == (255,255,255,255):
        img2s += '0'
    else:
        img2s += '1'
code = ''
for i in range(len(img1s)):
    if img1s[i] != img2s[i]:
        code += img2s[i]
with open('enc.c','w') as fw:
    for i in range(0,len(code),8):
        fw.write(chr(int(code[i:i+8],2)))

或者

提示说:image to 01 然后找一下2.png相对于1.png不同的地方,一开始以为是异或,结果就是传统的找出2.png的二进制和1.png不一样的地方然后打印

from PIL import Image
import math
import sys

def is_black(pixel):
    # 判断像素是否是黑色
    # 如果红、绿、蓝通道的值都很低,则认为是黑色
    return all(value < 10 for value in pixel[:3])


def is_white(pixel):
    # 判断像素是否是白色
    # 如果红、绿、蓝通道的值都很高,则认为是白色
    return all(value > 245 for value in pixel[:3])

flag1=""
flag2=""
def scan_image(image_path):
    global flag1
    # 打开图像文件
    image = Image.open(image_path)
    # 获取图像的像素数据
    pixels = image.load()
    width, height = image.size

    for y in range(height):
        for x in range(width):
            # 获取像素的RGB值
            pixel = pixels[x, y]
            # 判断像素是黑色还是白色
            if is_black(pixel):
                flag1=flag1+"1"
            elif is_white(pixel):
                flag1=flag1+"0"
            else:
                print("err")
def scan_image2(image_path):
    global flag2
    # 打开图像文件
    image = Image.open(image_path)
    # 获取图像的像素数据
    pixels = image.load()
    width, height = image.size

    for y in range(height):
        for x in range(width):
            # 获取像素的RGB值
            pixel = pixels[x, y]
            # 判断像素是黑色还是白色
            if is_black(pixel):
                flag2=flag2+"1"
            elif is_white(pixel):
                flag2=flag2+"0"
            else:
                print("err")
# 调用函数扫描图像
scan_image("1.png")

scan_image2("2.png")
for i in range(len(flag1)):
    if flag1[i] != flag2[i]:
        print(flag2[i],end="")

得到

0010001101101001011011100110001101101100011101010110010001100101001111000110001001101001011101000111001100101111011100110111010001100100011000110010101100101011001011100110100000111110000010100111010101110011011010010110111001100111001000000110111001100001011011010110010101110011011100000110000101100011011001010010000001110011011101000110010000111011000010100111001101110100011100100110100101101110011001110010000001101011011001010111100100100000001111010010000000100010001000100011101100100000000010100000101001101001011011100111010000100000011011010110000101101001011011100010100000101001011110110000101000001001011100110111010001110010011010010110111001100111001000000110001101110010011110010111000001110100011011110101111101110100011110000111010000111011000010100000100101100011011010010110111000111110001111100110001101110010011110010111000001110100011011110101111101110100011110000111010000111011001000000000101000001010000010010110011001101111011100100010000000101000011010010110111001110100001000000110100100100000001111010010000000110000001110110010000001101001001000000011110000100000011000110111001001111001011100000111010001101111010111110111010001111000011101000010111001101100011001010110111001100111011101000110100000101000001010010011101100100000001010110010101101101001001010010111101100001010001000000010000000100000001000000010000000100000001000000010000001100011011010000110000101110010001000000110010101101110011000110111001001111001011100000111010001100101011001000101111101110100011110000111010000100000001111010010000001100011011010000110000101110010001010000110001101110010011110010111000001110100011011110101111101110100011110000111010001011011011010010101110100100000010111100010000001101011011001010111100101011011011010010010000000100101001000000110101101100101011110010010111001101100011001010110111001100111011101000110100000101000001010010101110100100000010111100010000001100011011100100111100101110000011101000110111101011111011101000111100001110100010110110010100001101001001000000010101100100000001100010010100100100000001001010010000001100011011100100111100101110000011101000110111101011111011101000111100001110100001011100110110001100101011011100110011101110100011010000010100000101001010111010010100100111011000010100010000000100000001000000010000000100000001000000010000000100000011000110110111101110101011101000010000000111100001111000010000001101001011011100111010000101000011001010110111001100011011100100111100101110000011101000110010101100100010111110111010001111000011101000010100100100000001111000011110000100000001000100010000000100010001110110000101000100000001000000010000000100000011111010010000000100000001000000000101000100000001000000010000000100000011100100110010101110100011101010111001001101110001000000011000000111011000010100111110100001010000010100010111100101111001000000110010101101110011000110111001001111001011100000111010001100101011001000101111101110100011110000111010000110001001000000011110100100000001100010011001000110010001011000011000100110010001101110010110000110001001100010011000100101100001100010011000100110001001011000011100100110110001011000011000100110001001101000010110000110001001100010011010100101100001100010011001000110111001011000011011100110111001011000011100100110000001011000011000100110001001110010010110000111001001100100010110000111000001110010010110000110001001100010011011100101100001100010011001000110110001011000011100000110101001011000011100000110111001011000011000100110001001101110010110000110001001100010011000100101100001100010011000100110001001011000011100000110110001011000011100000110100001011000011000100110010001100100010110000110001001100100011011100101100001100010011000100110001001011000011011100110101001011000011100000110001001011000011100100110111001011000011000100110010001100000010110000111001001101000010110000111001001100110010110000110001001100010011000000101100001110010011100000101100001101100011010100101100001110000011010000101100001100010011001000110111001011000011000100110000001101010010110000110110001110010010110000111000001101110010110000110001001100100011010100101100001110010011100000101100001100010011000000110111001011000011100000110111001011000011011100110000001011000011000100110000001110000010110000110001001100100011011100101100001110000011001100101100001110000011100000101100001100010011000000110101001011000011000100110000001101010010110000111001001110000010110000111001001101010010110000111000001110000010110000110001001100000011001000101100001110010011011000101100001100010011000100111000001011000011000100110000001101000010110000110001001100010011010000001010001011110010111100100000011001000110111001100011011100100111100101110000011101000110010101100100010111110111010001111000011101000010000000111101001000000110011001101100011000010110011101111011011101000110100001101001011100110101111101101001011100110101111101110100011010000110010101011111011001100110000101101011011001010101111101100110011011000110000101100111010111110110000101101110011001000101111101100011011000010110111001011111011110010110111101110101010111110110011001101001011011100110010001011111011101000110100001100101010111110111010001110010011101010110010101011111011001100110110001100001011001110111110100001010001011110010111100100000011001010110111001100011011100100111100101110000011101000110010101100100010111110111010001111000011101000011001000100000001111010010000000110111001101100010110000110001001100100011011100101100001100110011001100101100001101100011001100101100001100010011000000111000001011000011000100110010001101110010110000110001001100010011000000101100001100010011000000110010001011000011000100110010001100000010110000110001001100000011100100101100001100010011001000110100001011000011010100110110001011000011010000110111001011000011000100110001001110000010110000110001001100000011011100101100001100010011001000110101001011000011000100110010001100010010110000110001001100000011010000101100001110010011100000101100001100010011001000110011001011000011000100110000001101100010110000110001001100100011001100101100001101010011011100101100001101000011001000101100001100010011000100110111001011000011000100110010001101100010110000110011001110010010110000110100001110010010110000110001001100000011000100101100001100010011000100110101001011000011000100110000001100110010110000110001001100010011011100101100001100010011000100110111001011000011000100110000001110010010110000110001001100010011011100101100001110010011011000101100001101010011011100101100001101000011011000101100001100010011000000111001001011000011000100110001001101010010110000110001001100010011000000101100001100010011000000110100001011000011000100110000001101010010110000110001001100000011011000101100001100010011001000110011001011000011000100110000001100000010110000110001001100000011010100101100001101000011010000101100001101010011010100101100001100010011000100110100001011000011000100110010001101110010110000110100001101010010110000110110001100000010110000110001001100100011000100101100001100010011001000110010001011000011000100110001001100110010110000110001001100010011000000101100001100010011000000110100001011000011010000111000001011000011010100110011001011000011000100110001001100110010110000110001001100010011011100101100001100110011100100101100001101010011011000101100001100010011001000110101001011000011000100110000001101010010110000110001001100010011010000101100001100010011001000110001001011000011000100110000001100000010110000110001001100000011000100101100001101000011100100101100001101010011100000101100001100010011000000110000001011000011000100110010001101110010110000110101001101110010110000110101001100110010110000110001001100010011100000101100001101010011000000101100001101010011000100101100001100010011000000110110001011000011000100110000001101100010110000110001001100100011010000101100001100110011100000101100001101010011010000101100001100010011001000110111001011000011011000110000001011000011000100110000001110000010110000110001001100000011100100101100001100010011000100110010001011000011000100110001001101000010110000110001001100000011010100101100001100010011100100101100001100010011000100110100001011000011000100110001001100000010110000111001001110000010110000110001001100010011010000101100001100010011000100110101001011000011100000110001001011000011000100110001001101010010110000111000001101010010110000110110001101010010110000111001001110010010110000111000001101010010110000110110001101110010110000110100001101000010110000110011001101100010110000110001001100000011100000101100001100010011000000110010001011000011000100110000001101110010110000111001001100100010110000110011001100010010110000110100001101000010110000111000001110000010110000111000001110000010110000110001001100010011010100101100001101010011010100101100001101000011100000101100001101110011001100101100001110000011011000101100001101100011100000101100001110010011001100101100001100010011000100110010001011000011000100110010001100110010110000110111001110010010110000110001001100100011011100101100001100010011010100101100001101010011000100101100001100010011001000110000001011000011100100110110001011000011000100110010001100010010110000110111001101000010110000110001001100010011010000101100001110010011010000101100001100010011001000110000001011000011100000110010001011000011100100110001001011000011010000110001001011000011010000110100001011000011000100110000001101010010110000111000001100100010110000110111001100010010110000110011001101110010110000110001001100010011000000101100001100100011100000101100001101100011100100101100001110010011011000101100001100010011000000110000001011000011010000110010001011000011001000101100001101110011010100101100001100010011000100111000001011000011000100110010001100100010110000110011001101010010110000110100001110010010110000111000001110010000101000001010

解密会得到一个cpp源码

#include<bits/stdc++.h>
using namespace std;
string key = ""; 

int main(){
    string crypto_txt;
    cin>>crypto_txt; 

    for (int i = 0; i < crypto_txt.length(); ++i){
        char encrypted_txt = char(crypto_txt[i] ^ key[i % key.length()] ^ crypto_txt[(i + 1) % crypto_txt.length()]);
        cout << int(encrypted_txt) << " ";
    }   
    return 0;
}

// encrypted_txt1 = 122,127,111,111,96,114,115,127,77,90,119,92,89,117,126,85,87,117,111,111,86,84,122,127,111,75,81,97,120,94,93,110,98,65,84,127,105,69,87,125,98,107,87,70,108,127,83,88,105,105,98,95,88,102,96,118,104,114
// dncrypted_txt = flag{this_is_the_fake_flag_and_can_you_find_the_true_flag}
// encrypted_txt2 = 76,127,33,63,108,127,110,102,120,109,124,56,47,118,107,125,121,104,98,123,106,123,57,42,117,126,39,49,101,115,103,117,117,109,117,96,57,46,109,115,110,104,105,106,123,100,105,44,55,114,127,45,60,121,122,113,110,104,48,53,113,117,39,56,125,105,114,121,100,101,49,58,100,127,57,53,118,50,51,106,106,124,38,54,127,60,108,109,112,114,105,19,114,110,98,114,115,81,115,85,65,99,85,67,44,36,108,102,107,92,31,44,88,88,115,55,48,73,86,68,93,112,123,79,127,15,51,120,96,121,74,114,94,120,82,91,41,44,105,82,71,37,110,28,69,96,100,42,2,75,118,122,35,49,89

给了一个fakeflag的明文和密文,很明显是要算密钥

c = [122,127,111,111,96,114,115,127,77,90,119,92,89,117,126,85,87,117,111,111,86,84,122,127,111,75,81,97,120,94,93,110,98,65,84,127,105,69,87,125,98,107,87,70,108,127,83,88,105,105,98,95,88,102,96,118,104,114]
m = 'flag{this_is_the_fake_flag_and_can_you_find_the_true_flag}'
for i in range(len(m)):
    print(chr(ord(m[i])^ord(m[(i+1)%len(m)])^c[i]),end='')
# prisonrealmprisonrealmprisonrealmprisonrealmprisonrealmpri
# key = prisonrealm

拿到密钥解密即可,推测最后一个字符是},依次还原

key = 'prisonrealm'
enc = [76,127,33,63,108,127,110,102,120,109,124,56,47,118,107,125,121,104,98,123,106,123,57,42,117,126,39,49,101,115,103,117,117,109,117,96,57,46,109,115,110,104,105,106,123,100,105,44,55,114,127,45,60,121,122,113,110,104,48,53,113,117,39,56,125,105,114,121,100,101,49,58,100,127,57,53,118,50,51,106,106,124,38,54,127,60,108,109,112,114,105,19,114,110,98,114,115,81,115,85,65,99,85,67,44,36,108,102,107,92,31,44,88,88,115,55,48,73,86,68,93,112,123,79,127,15,51,120,96,121,74,114,94,120,82,91,41,44,105,82,71,37,110,28,69,96,100,42,2,75,118,122,35,49,89]
# flag[-1] = '}' 即flag[-1] = 125
flag = []
for i in range(len(enc)):
    flag.append(enc[i]^ord(key[i%len(key)]))
t = [0]*len(flag)
t[0] = 125 ^ flag[-1]
t[1:len(flag)] = flag[:-1]
print()
for i in range(len(flag)-1):
    print(chr(t[i]),end='')
    t[i+1] = flag[i]^t[i]
print('}')
# The-absolute-powerhouse,the-resulting-loneliness,the-person-who-teaches-you-to-love-is......NSSCTF{e@sy_s1gnin_0n_th1s_h@ppy_S3nday_@nd_w1sh_y03_hav3_fun!}

easy_signin2

做做misc签到题来放松吧!
相信你一定可以愉快的签到
flag以NSSCTF{}格式提交

hint: 二进制异或 pngchunk
hint2: 抽象画

附件看到两张图,先去看一下here_is_your_flag.png,用010打卡发现根本不是png图片数据,题目给了提示是要异或pngchunk,但是不知道异或什么,因为我们知道png的是89开始的,所以用现在的第一个字节去异或89,就可以得到应该要异或的字节了

image-20240516093546408

>>> print(hex(0xcd^0x89))
0x44

可以看到我们要异或的应该是0x44,所以我们把这个文件的每一字节提取出来然后去异或0x44并写入文件

image-20240516095435045

image-20240516095509457

image-20240516104523600

得到

here_is_your_flag

通过提示可以看到查看pngchunk

image-20240516110245852

image-20240516110306386

从这里开始往下复制,然后添加文件头89 50 4e 47 0d 0a 1a 0a即可得到

1

hint2提示抽象画,可以想到用npiet

去这里下载:http://www.bertnase.de/npiet/

然后看另一个png,10xbig_to_more_clear.png

用脚本放大十倍

from PIL import Image

def process_image(input_image_path, output_image_path):
    # 打开图像
    image = Image.open(input_image_path).convert('L')
    # 获取图像的像素数据
    pixels = image.load()
    width, height = image.size

    # 遍历图像的每个像素
    for y in range(height):
        for x in range(width):
            # 获取当前像素的灰度值
            pixel_value = pixels[x, y]

            # 如果像素值在10到200之间,将其设置为255
            if 0 < pixel_value < 250:
                pixels[x, y] = 0

    # 保存修改后的图像
    image.save(output_image_path)

# 输入和输出图像的文件路径
input_image_path = "10xbig_to_more_clear.png"
output_image_path = "out.png"

# 处理图像
process_image(input_image_path, output_image_path)

out

得到字符串di`f{cfd7d1fd1ba254dcfa7f4155cfdadadc}

\npiet-1.3a-win32>npiet.exe -v 1.png
info: verbose set to 1
info: using file 1.png
info: got 495 x 495 pixel with 256 cols
info: codelsize guessed is 15 pixel
? di`f{cfd7d1fd1ba254dcfa7f4155cfdadadc}
f? l? a? g? {? d? g? e? 8? f? 3? h? f? 3? d? a? 4? 5? ? ? cd4? ? ? ? ? ? 14f7af? ? ? ? fc5? d? b5? ? ? dad? d? }? ?

flag{dge8f3hf3da45cd414f7affc5db5dadd}

NSSCTF{dge8f3hf3da45cd414f7affc5db5dadd}

标签:23,image,Misc,range,pixel,flag,path,Round,png
From: https://www.cnblogs.com/hihopkc/p/18195758

相关文章

  • loj#546. 「LibreOJ β Round #7」网格图
    裸的01BFS,时间复杂度\(\mathcalO(nm)\)。相邻的无障碍行可以缩成一行,列同理,所以全图的规模可以缩成\((k+1)\times(k+1)\),再01BFS,时间复杂度\(\mathcalO(k^2)\)。进一步地,所有\(1\timest\)或\(t\times1\)大小的无障碍连通块均可缩成一个点,两个连通块相交,则......
  • NSSCTF round#22逆向
    NSSCTFround#22逆向1.wp要及时写不然忘光光2.赛题分文件夹放ezcrypt下载下来是python打包的exe,解包出pyc用pycdc反编译看一下嗯不认识BEFORE_WITH命令。丢到gpt4o里看看还蛮准确的,和作者提供的源码一样。不过对填充的处理不对,原程序是填充'\x00'。不过比自己硬看好太多......
  • 各省高校在广东2023/2022/2021录取分数线下载
    为了帮助考生更好地进行志愿填报,更好的对数据筛选,故整理各省高校在广东2023/2022/2021三年录取分数excel文件,部分数据及文件见下图,数据根据历年录取分数线汇总,仅供参考,详细请登陆各高校网站查询。如有需要,可根据步骤下载文件:文件列表及数据如下图所示,数据实测真实有效。关......
  • misc RSA_KU
    题目点击查看代码n=12969933032856835068156219898649051450863758495716712989747252213832020232124646745927673197041046346439185717752812341775160391046275134670062732501966810094620587662968805750646090384211954311463019820584388367741212592897939931030620......
  • [HDCTF 2023]YamiYami python中的另一种反序列化--yaml
    今天做了到新颖的题,关于python中的yaml反序列化的题目,直接上题吧。发现第一个链接的参数是?url=XXXX,一眼利用点。嗯?直接出了flag,应该是非预期解。再看看有app.py,那就试试。发现app.*被过滤了,二次编码绕过试试。点击查看代码@app.route('/')defindex():session['pas......
  • 23.网络编程【一】
    【一】常见的网络结构模型1)CS模型1.概念C/S:Client/Server缩写,即客户端/服务器模式例如:APP2.优缺点优势:针对客户端可以高度定制减轻服务器的负载更加方便的管理数据库缺点:需要下载安装才能使用维护成本比较高2)BS模型1.概念B/S:Browser/Server的缩写,即......
  • loj#523. 「LibreOJ β Round #3」绯色 IOI(悬念)
    由题述,\(X\)满匹配,根据Hall定理,有对于任意一个有\(k\)个妹子的集合,她们能配对的男生的人数\(\gek\)。把每个妹子看作她所连接的两个(可能是同一个)男生间的无向边,则每个连通块必然是树或基环树。问题转化为给每条无向边定向,满足每个点的入度不超过\(1\),求最大边权和。对......
  • 广东各高校2023/2022/2021近三年录取分数线(excel文件下载)
    为了帮助考生更好地进行志愿填报,更好的对数据筛选,故整理广东各高校2023/2022/2021三年录取分数excel文件,部分数据及文件见下图,数据根据历年录取分数线汇总,仅供参考,详细请登陆各高校网站查询。如有需要,可根据步骤下载文件:文件列表及数据如下图所示,真实有效。关注上述公众......
  • 2023JSCPC江苏省赛
    2023江苏省赛Dashboard-2023JiangsuCollegiateProgrammingContest,2023NationalInvitationalofCCPC(Hunan),The13thXiangtanCollegiateProgrammingContest-CodeforcesI-Elevatorvoidsolve(){cin>>n>>m;cout<<n-m+1<<......
  • P9175 [COCI2022-2023#4] Mreža 题解
    P9175[COCI2022-2023#4]Mreža题解前言我发现,有整体二分与主席树的地方总有莫队(不是那个莫队,是那个莫队)。知识点(树上)倍增,(树上)莫队,树状数组(“树”含量满满),分块。题意分析给定一棵树,每条边有一个权值\(v\),以及可以用一个花费\(c\)将它变成更大的权值\(s\)。再给定一......