zoukankan      html  css  js  c++  java
  • 实验吧CTF题库-编程(部分)

    • 百米

    3秒提交答案,数字是随机变化的

    利用Python脚本解题

    # -*- coding:utf-8 -*-
    __author__ = "MuT6 Sch01aR"
    
    import requests
    from bs4 import BeautifulSoup
    import sys,io
    
    url = "http://ctf5.shiyanbar.com/jia/index.php"
    url_check = "http://ctf5.shiyanbar.com/jia/index.php?action=check_pass"
    s = requests.session()
    
    respons = s.get(url)
    
    soup = BeautifulSoup(respons.text,features="html.parser")
    a = soup.find("div",attrs={"name":"my_expr"}).get_text()
    a = a.replace("x","*")
    
    response = s.post(url_check,data={"pass_key":eval(a)})
    
    response.encoding = response.apparent_encoding
    
    soup1 = BeautifulSoup(response.text,features="html.parser")
    b = soup1.find("div",attrs={"id":"templatemo_content"})
    
    sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='gb18030')
    
    print(b)
    

     运行,得到flag

    • 找素数

    利用python脚本解题

    # -*- coding:utf-8 -*-
    __author__ = "MuT6 Sch01aR"
    
    from math import *
    a = 367-186
    b = 186
    c = 0
    while True:
        a += b
        for i in range(2,int(sqrt(a))+1):
            if a % i == 0:
                break
            else:
                if i == int(sqrt(a)):
                    c += 1
                    if c == 151:
                        print("CTF{",a,"}")
                        break
        if c == 151:
            break
    

     运行,得到flag

  • 相关阅读:
    MarkDown SequenceDiagram 语法
    mysql导出数据库文档
    使用gitlab作为go mod私服
    go context理解
    go-micro入门
    golang 接口测试
    小程序配置 app.json
    Nginx 配置详解(2)
    windows下安装nginx
    任意文件夹下打开命令提示窗
  • 原文地址:https://www.cnblogs.com/sch01ar/p/8206929.html
Copyright © 2011-2022 走看看