Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fix: changed output directory + fix crtsh #215

Merged
merged 4 commits into from
Jan 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/runner/banners.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ____ _| |__ / _(_)_ _ __| |___ _ _
`

// Version is the current version of subfinder
const Version = `2.3.0`
const Version = `2.3.1`

// showBanner is used to show the banner to the user
func showBanner() {
Expand Down
4 changes: 3 additions & 1 deletion pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ func (r *Runner) EnumerateMultipleDomains(reader io.Reader) error {
// for each domain in the directory.
if r.options.Output != "" {
err = r.EnumerateSingleDomain(domain, r.options.Output, true)
} else {
} else if r.options.OutputDirectory != "" {
outputFile := path.Join(r.options.OutputDirectory, domain)
err = r.EnumerateSingleDomain(domain, outputFile, false)
} else {
err = r.EnumerateSingleDomain(domain, "", true)
}
if err != nil {
return err
Expand Down
4 changes: 3 additions & 1 deletion pkg/subscraping/sources/crtsh/crtsh.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"io/ioutil"
"strings"

"github.com/projectdiscovery/subfinder/pkg/subscraping"
)
Expand Down Expand Up @@ -32,7 +33,8 @@ func (s *Source) Run(ctx context.Context, domain string, session *subscraping.Se
}
resp.Body.Close()

src := string(body)
// Also replace all newlines
src := strings.Replace(string(body), "\\n", " ", -1)

for _, subdomain := range session.Extractor.FindAllString(src, -1) {
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Subdomain, Value: subdomain}
Expand Down