Skip to content

Commit

Permalink
linting, update deprecated methods, add bw key
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardottt committed Nov 30, 2023
1 parent 19afee7 commit d726c92
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 25 deletions.
17 changes: 9 additions & 8 deletions pkg/input/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type Input struct {
SubdomainPlain bool
SubdomainNoCheck bool
SubdomainVirusTotal bool
SubdomainBuiltWith bool
SubdomainBuiltWith bool
SubdomainUserAgent string
SubdomainRandomUserAgent bool
SubdomainDNS string
Expand Down Expand Up @@ -109,13 +109,14 @@ type Input struct {

// ReadArgs reads arguments/options from stdin.
// Subcommands:
// report ==> Full report
// dns ==> Dns records enumeration
// subdomains ==> Subdomains enumeration
// port ==> ports enumeration
// dir ==> directiories enumeration
// help ==> doc
// examples ==> examples
//
// report ==> Full report
// dns ==> Dns records enumeration
// subdomains ==> Subdomains enumeration
// port ==> ports enumeration
// dir ==> directiories enumeration
// help ==> doc
// examples ==> examples
func ReadArgs() Input {
reportCommand := flag.NewFlagSet("report", flag.ExitOnError)
dnsCommand := flag.NewFlagSet("dns", flag.ExitOnError)
Expand Down
4 changes: 2 additions & 2 deletions pkg/opendb/anubis.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ package opendb
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"

httpUtils "github.com/edoardottt/scilla/internal/http"
Expand All @@ -56,7 +56,7 @@ func AnubisSubdomains(target string, plain bool) []string {
defer resp.Body.Close()

if resp.StatusCode == http.StatusOK {
bodyBytes, err := ioutil.ReadAll(resp.Body)
bodyBytes, err := io.ReadAll(resp.Body)
if err != nil {
return arr
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/opendb/builtwith.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type builtWithResultWrapper struct {
Social []string `json:"Social"`
CompanyName string `json:"CompanyName"`
Telephones []string `json:"Telephones"`
Emails []string `json:"Emails"`
Emails []string `json:"Emails"`
City string `json:"City"`
State string `json:"State"`
Postcode string `json:"Postcode"`
Expand Down Expand Up @@ -107,11 +107,11 @@ type builtWithResultWrapper struct {
SalesRevenue int `json:"SalesRevenue"`
} `json:"Results"`
Errors []struct {
Code int `json:"Code"`
Code int `json:"Code"`
Message string `json:"Message"`
Lookup string `json:"Lookup"`
} `json:"Errors"`
Trust string `json:"Trust"`
Trust string `json:"Trust"`
}

// Builtwith retrieves from the url below some known subdomains.
Expand Down Expand Up @@ -156,7 +156,7 @@ func BuiltWithSubdomains(target, apikey string, plain bool) []string {
if elem.SubDomain == "" {
continue
}

fullDomain := elem.SubDomain + "." + target
result = append(result, fullDomain)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/opendb/crtsh.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ package opendb
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"strings"

Expand Down Expand Up @@ -63,7 +63,7 @@ func CrtshSubdomains(domain string, plain bool) []string {
defer resp.Body.Close()

output := make([]string, 0)
body, _ := ioutil.ReadAll(resp.Body)
body, _ := io.ReadAll(resp.Body)

if err := json.Unmarshal(body, &results); err != nil {
return []string{}
Expand Down
4 changes: 2 additions & 2 deletions pkg/opendb/hackertarget.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"bufio"
"bytes"
"fmt"
"io/ioutil"
"io"
"net/http"
"strings"

Expand All @@ -54,7 +54,7 @@ func HackerTargetSubdomains(domain string, plain bool) []string {
return result
}

res, err := ioutil.ReadAll(raw.Body)
res, err := io.ReadAll(raw.Body)
if err != nil {
return result
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/opendb/sonar.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ package opendb
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"

httpUtils "github.com/edoardottt/scilla/internal/http"
Expand All @@ -56,7 +56,7 @@ func SonarSubdomains(target string, plain bool) []string {
defer resp.Body.Close()

if resp.StatusCode == http.StatusOK {
bodyBytes, err := ioutil.ReadAll(resp.Body)
bodyBytes, err := io.ReadAll(resp.Body)
if err != nil {
return arr
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/opendb/threatminer.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ package opendb
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"

httpUtils "github.com/edoardottt/scilla/internal/http"
Expand Down Expand Up @@ -65,7 +65,7 @@ func ThreatMinerSubdomains(domain string, plain bool) []string {
defer resp.Body.Close()

output := make([]string, 0)
body, _ := ioutil.ReadAll(resp.Body)
body, _ := io.ReadAll(resp.Body)

if err := json.Unmarshal(body, &result); err != nil {
return []string{}
Expand Down
2 changes: 0 additions & 2 deletions pkg/opendb/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ package opendb
import (
"math/rand"
"strings"
"time"

sliceUtils "github.com/edoardottt/scilla/internal/slice"
)
Expand All @@ -53,7 +52,6 @@ func AppendDBSubdomains(dbsubs []string, urls []string) []string {
}

func ShuffleSubdomains(input []string) []string {
rand.Seed(time.Now().UnixNano())
rand.Shuffle(len(input), func(i, j int) { input[i], input[j] = input[j], input[i] })

return input
Expand Down
2 changes: 1 addition & 1 deletion scripts/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fi
# check if scilla keys file exists
if [[ ! -e "$HOME/.config/scilla/keys.yaml" ]]; then
touch $HOME/.config/scilla/keys.yaml
echo -n "VirusTotal: " > $HOME/.config/scilla/keys.yaml
echo -en "VirusTotal: \nBuiltWith:" > $HOME/.config/scilla/keys.yaml
echo "Remember to add your keys in $HOME/.config/scilla/keys.yaml!"
fi

Expand Down

0 comments on commit d726c92

Please sign in to comment.