zoukankan      html  css  js  c++  java
  • VolgaCTF 2020 Qualifier Library

    fuzz

    初步fuzz整个网站的功能,数据传输使用JSON格式,输入点只有注册和登录,也没有测出sql注入。但是随便删掉query中属性后看到报错{"code":"GRAPHQL_PARSE_FAILED"},判断出前后端是用graphql来查询api

    获取信息

    根据文档中Introspection的部分
    获取所有的数据类型,包括用户定义的,bp没有json美化,转战postman

    {
      __schema {
        types {
          name
        }
      }
    }
    

    获取数据库所有的结构

    fragment FullType on __Type {
      kind
      name
      description
      fields(includeDeprecated: true) {
        name
        description
        args {
          ...InputValue
        }
        type {
          ...TypeRef
        }
        isDeprecated
        deprecationReason
      }
      inputFields {
        ...InputValue
      }
      interfaces {
        ...TypeRef
      }
      enumValues(includeDeprecated: true) {
        name
        description
        isDeprecated
        deprecationReason
      }
      possibleTypes {
        ...TypeRef
      }
    }
    fragment InputValue on __InputValue {
      name
      description
      type {
        ...TypeRef
      }
      defaultValue
    }
    fragment TypeRef on __Type {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
            ofType {
              kind
              name
              ofType {
                kind
                name
                ofType {
                  kind
                  name
                  ofType {
                    kind
                    name
                  }
                }
              }
            }
          }
        }
      }
    }
    
    query IntrospectionQuery {
      __schema {
        queryType {
          name
        }
        mutationType {
          name
        }
        types {
          ...FullType
        }
        directives {
          name
          description
          locations
          args {
            ...InputValue
          }
        }
      }
    }
    

    在获取的数据中我们可以看到loginregister的部分,但是还有一个并没有暴露在外的testGetUserByFilter值得我们关注,因为作为测试功能,往往会比正式功能更容易攻击。

    testGetUserByFilter的参数是loginemaliname

    GraphQL Injection

    要获取数据首先要登录,在header中加上Authentication:Bearer [token here]
    测试发现引号无效,但是报错,用union select测试列数

    直接注出flag

  • 相关阅读:
    《Java技术》第七次作业
    《Java技术》第六次作业
    《Java技术》第五次作业
    《Java技术》第四次作业
    《Java技术》第三次作业
    《Java技术》第二次作业
    《Java技术》第一次作业
    股票——布林带
    股票——指数移动平均线
    股票——简单移动平均线
  • 原文地址:https://www.cnblogs.com/20175211lyz/p/12605583.html
Copyright © 2011-2022 走看看