diff --git a/modules/redis/scanner.go b/modules/redis/scanner.go index a1ebf7b..802453c 100644 --- a/modules/redis/scanner.go +++ b/modules/redis/scanner.go @@ -339,7 +339,6 @@ func (s *Scanner) Protocol() string { func convToUint32(s string) uint32 { s_64, err := strconv.ParseUint(s, 10, 32) if err != nil { - // TODO: LEARN HOW TO LOG return 0 } return uint32(s_64) @@ -387,7 +386,11 @@ func (scanner *Scanner) Scan(target zgrab2.ScanTarget) (zgrab2.ScanStatus, inter fieldsWeAreLookingFor := 12 fieldsFound := 0 for _, line := range strings.Split(string(infoResponseBulk), "\r\n") { - switch line_prefix_suffix := strings.SplitN(line, ":", 2); line_prefix_suffix[0] { + line_prefix_suffix := strings.SplitN(line, ":", 2) + if len(line_prefix_suffix) == 1 { + line_prefix_suffix = append(line_prefix_suffix, "") + } + switch line_prefix_suffix[0] { case "redis_version": fieldsFound += 1 result.Version = line_prefix_suffix[1] diff --git a/zgrab2_schemas/zgrab2/redis.py b/zgrab2_schemas/zgrab2/redis.py index 63be93e..d9d3dcf 100644 --- a/zgrab2_schemas/zgrab2/redis.py +++ b/zgrab2_schemas/zgrab2/redis.py @@ -27,7 +27,7 @@ redis_scan_response = SubRecord({ "version": String(doc="The version string, read from the the info_response (if available)."), "os": String(doc="The os the redis server is running, read from the the info_response (if available)."), "mode": String(doc="The mode the redis server is running (standalone or cluster), read from the the info_response (if available)."), - "git_sha1": String(doc="The Git Sha 1 the redis server used."), + "git_sha1": String(doc="The Sha-1 Git commit hash the redis server used."), "build_id": String(doc="The Build ID of the redis server."), "arch_bits": String(doc="The architecture bits (32 or 64) the redis server used to build."), "gcc_version": String(doc="The version of the GCC compiler used to compile the Redis server."),