BugKu-MISC-图穷匕见 题目
思路 先丢到010editor看看先,满足jpg的文件头和文件尾,但是文件尾后面有一段看起来很像编码的数据
一眼丁真觉得这就是16进制,新建一个hex文件,发现了一大串坐标
查阅资料之后这个应该是一个二维码,借用BugKu评论区wp中的脚本
注:侵删,原文:https://www.aristore.top/posts/Bugku_WP(1-30)/#29-%E5%9B%BE%E7%A9%B7%E5%8C%95%E8%A7%81
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 from PIL import Imagedef load_points_from_file (filename ): points = [] with open (filename, 'r' ) as file: for line in file: x, y = line.strip().strip('()' ).split(',' ) points.append((int (x), int (y))) return points def create_image (points, image_size=(20 , 20 ) ): img = Image.new('RGB' , image_size, 'white' ) pixels = img.load() for point in points: if 0 <= point[0 ] < image_size[0 ] and 0 <= point[1 ] < image_size[1 ]: pixels[point[0 ], point[1 ]] = (0 , 0 , 0 ) return img def main (): points = load_points_from_file('flag.txt' ) max_x = max ([p[0 ] for p in points]) + 1 max_y = max ([p[1 ] for p in points]) + 1 image_size = (max_x, max_y) img = create_image(points, image_size) img.save('output_image.png' ) print ("图像已成功生成并保存为 'output_image.png'." ) if __name__ == '__main__' : main()
得到二维码,扫码得flag
Flag 1 flag{40fc0a979f759c8892f4dc045e28b820}