Skip to content

Commit

Permalink
oob
Browse files Browse the repository at this point in the history
  • Loading branch information
ac0d3r committed Dec 26, 2022
1 parent 4e830a7 commit 9e68c49
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ dump.rdb
node_modules/
dist/
docs/
deploy/
deploy/
tests/
2 changes: 2 additions & 0 deletions hyuga/database/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ func GetUserRecordsByUserID(record Record, userID string, filter string) ([]map[
sample = data["name"]
case "http":
sample = data["url"]
case "jdni":
sample = data["path"]
}
if strings.Contains(sample, filter) {
resultList = append(resultList, data)
Expand Down
16 changes: 8 additions & 8 deletions hyuga/oob/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ func (d *DnsServer) ServeDNS(w dns.ResponseWriter, r *dns.Msg) {
}
if err := database.SetUserRecord(identity, record, config.RecordExpiration); err != nil {
log.Printf("[dns] set record '%s' '%#v' error: %s\n", identity, record, err)
} else {
if name == fmt.Sprintf("r.%s.%s", identity, config.MainDomain) {
isDnsRebinding = true
t, err := database.SetUserDnsRebindingTimes(identity)
if err != nil {
log.Printf("[dns] set query times '%s' error: %s\n", identity, err)
}
recordtimes = t
}

if name == fmt.Sprintf("r.%s.%s", identity, config.MainDomain) {
isDnsRebinding = true
t, err := database.SetUserDnsRebindingTimes(identity)
if err != nil {
log.Printf("[dns] set query times '%s' error: %s\n", identity, err)
}
recordtimes = t
}
}

Expand Down
5 changes: 1 addition & 4 deletions hyuga/oob/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@ func HttpLog(c *gin.Context) {
if err := database.SetUserRecord(identity, record, config.RecordExpiration); err != nil {
log.Printf("[http] set record %s %#v error: %s", identity, record, err)
}

c.Status(http.StatusOK)
c.Writer.Write([]byte(http.StatusText(http.StatusOK)))
return
}
c.Status(http.StatusOK)
c.Writer.Write([]byte(http.StatusText(http.StatusOK)))
}

func getRealIP(r *http.Request) string {
Expand Down
16 changes: 11 additions & 5 deletions hyuga/oob/jndi.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ var (
02 01 03 -- The LDAP protocol version (integer value 3)
04 00 -- Empty bind DN (0-byte octet string)
80 00 -- Empty password (0-byte octet string with type context-specific
-- primitive zero)
-- primitive zero)
*/
ldapfinger string = "300c020101600702010304008000"
/*
Expand Down Expand Up @@ -241,13 +241,19 @@ func checkRMI(data []byte) bool {
return false
}
// header
if data[0] == 0x4a && data[1] == 0x52 &&
data[2] == 0x4d && data[3] == 0x49 {
if data[0] == 0x4a &&
data[1] == 0x52 &&
data[2] == 0x4d &&
data[3] == 0x49 {
// version
if data[4] != 0x00 &&
data[4] != 0x01 {
if data[4] != 0x00 {
return false
}
if data[5] != 0x01 &&
data[5] != 0x02 {
return false
}

// protocol
if data[6] != 0x4b &&
data[6] != 0x4c &&
Expand Down

0 comments on commit 9e68c49

Please sign in to comment.