https://github.com/hrbrmstr/zdnsr
🚚 Perform Bulk ‘DNS’ Queries Using ‘zdns’
https://github.com/hrbrmstr/zdnsr
bulk-dns r r-cyber rstats zdns
Last synced: about 1 year ago
JSON representation
🚚 Perform Bulk ‘DNS’ Queries Using ‘zdns’
- Host: GitHub
- URL: https://github.com/hrbrmstr/zdnsr
- Owner: hrbrmstr
- Created: 2018-09-07T19:54:53.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-21T13:50:21.000Z (over 6 years ago)
- Last Synced: 2025-03-27T02:43:41.634Z (about 1 year ago)
- Topics: bulk-dns, r, r-cyber, rstats, zdns
- Language: R
- Homepage:
- Size: 29.3 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
Awesome Lists containing this project
README
---
output: rmarkdown::github_document
---
# zdnsr
Perform Bulk 'DNS' Queries Using 'zdns'
## Description
Provides wrapper/helper methods for executing 'zdns' () bulk queries along with utility methods to retrieve and cache 'Public DNS' () nameserver lists.
- `zdns`:
- `Public DNS Lists`:
## What's Inside The Tin
The following functions are implemented:
- `install_zdns`: Helper to try to get `zdns` installed
- `refresh_publc_nameservers_list`: Refresh the list of valid public nameservers
- `zdns_exec`: Raw interface to `zdns`
- `zdns_help`: Raw interface to `zdns`
- `zdns_query`: Bulk query using `zdns`
## Installation
```{r eval=FALSE}
devtools::install_github("hrbrmstr/zdnsr")
```
```{r message=FALSE, warning=FALSE, error=FALSE, include=FALSE}
options(width=120)
```
## Usage
```{r message=FALSE, warning=FALSE, error=FALSE}
library(zdnsr)
# current verison
packageVersion("zdnsr")
```
### Example (top prefix enumeration)
```{r cache=TRUE}
c(
"www", "mail", "mx", "blog", "ns1", "ns2", "dev", "server", "email",
"cloud", "api", "support", "smtp", "app", "webmail", "test", "box",
"m", "admin", "forum", "news", "web", "mail2", "ns", "demo", "my",
"portal", "shop", "host", "cdn", "git", "vps", "mx1", "mail1",
"static", "help", "ns3", "beta", "chat", "secure", "staging", "vpn",
"apps", "server1", "ftp", "crm", "new", "wiki", "home", "info"
) -> top_common_prefixes # via Rapid7 FDNS analysis
tf <- tempfile(fileext = ".json")
zdns_query(
sprintf("%s.rstudio.com", top_common_prefixes),
query_type = "A",
num_nameservers = (length(top_common_prefixes) * 2),
output_file = tf
)
res <- jsonlite::stream_in(file(tf))
unlink(tf)
found <- which(lengths(res$data$answers) > 0)
do.call(
rbind.data.frame,
lapply(found, function(idx) {
res$data$answers[[idx]]$query_name <- res$name[idx]
res$data$answers[[idx]]
})
) -> xdf
xdf <- xdf[,c("query_name", "name", "class", "ttl", "type", "answer")]
knitr::kable(xdf)
```