Skip to content

Commit

Permalink
Address second round of feedback
Browse files Browse the repository at this point in the history
Brain fart on guard clauses when I've been using them all this time...
Updating the conditions made the ternary fall out of favor.

Changed some wording in the doc to suggest the domain name for a
particular NIS server may be different from the bootparamd client's
configuration.
  • Loading branch information
wvu committed Jan 14, 2018
1 parent 1a8eb7b commit 736d438
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ From the `bootparamd(8)` man page:
The module documented within will allow a tester to disclose the NIS
domain name from a server running `bootparamd`. After knowing the domain
name, the tester can follow up with `auxiliary/gather/nis_ypserv_map` to
dump a map from an NIS server (running as `ypserv`).
dump a map from a compatible NIS server (running as `ypserv`).

## Setup

Expand Down Expand Up @@ -62,7 +62,8 @@ msf auxiliary(gather/nis_bootparamd_domain) >
```

After disclosing the domain name, you can use
`auxiliary/gather/nis_ypserv_map` to dump a map from an NIS server.
`auxiliary/gather/nis_ypserv_map` to dump a map from a compatible NIS
server.

```
msf auxiliary(gather/nis_bootparamd_domain) > use auxiliary/gather/nis_ypserv_map
Expand Down
8 changes: 3 additions & 5 deletions modules/auxiliary/gather/nis_bootparamd_domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,9 @@ def parse_bootparams(res)
Integer # Router Address: [redacted]
)

if host && domain
bootparams[host] = domain
else
break
end
break unless host && domain

bootparams[host] = domain
rescue Rex::ArgumentError
vprint_status("Finished XDR decoding at #{res.inspect}")
break
Expand Down
8 changes: 3 additions & 5 deletions modules/auxiliary/gather/nis_ypserv_map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,9 @@ def parse_map(res)
String # Key: [redacted]
)

if status == 1 && key && value
map[key] = value
else
break
end
break unless status == 1 && key && value

map[key] = value
rescue Rex::ArgumentError
vprint_status("Finished XDR decoding at #{res.inspect}")
break
Expand Down

0 comments on commit 736d438

Please sign in to comment.