mirror of https://github.com/cbeuw/Cloak
Check proxy method after checking admin uid to allow admin to have an invalid but unused proxy method
This commit is contained in:
parent
67dba8c8fa
commit
e157e73ade
|
|
@ -83,10 +83,6 @@ func AuthFirstPacket(firstPacket []byte, transport Transport, sta *State) (info
|
|||
err = fmt.Errorf("%w: %v", ErrBadDecryption, err)
|
||||
return
|
||||
}
|
||||
if _, ok := sta.ProxyBook[info.ProxyMethod]; !ok {
|
||||
err = ErrBadProxyMethod
|
||||
return
|
||||
}
|
||||
info.Transport = transport
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -213,6 +213,18 @@ func dispatchConnection(conn net.Conn, sta *State) {
|
|||
return
|
||||
}
|
||||
|
||||
if _, ok := sta.ProxyBook[ci.ProxyMethod]; !ok {
|
||||
log.WithFields(log.Fields{
|
||||
"remoteAddr": conn.RemoteAddr(),
|
||||
"UID": b64(ci.UID),
|
||||
"sessionId": ci.SessionId,
|
||||
"proxyMethod": ci.ProxyMethod,
|
||||
"encryptionMethod": ci.EncryptionMethod,
|
||||
}).Error(ErrBadProxyMethod)
|
||||
goWeb()
|
||||
return
|
||||
}
|
||||
|
||||
var user *ActiveUser
|
||||
if sta.IsBypass(ci.UID) {
|
||||
user, err = sta.Panel.GetBypassUser(ci.UID)
|
||||
|
|
|
|||
Loading…
Reference in New Issue