Skip to content

Commit

Permalink
Extract subdomains in case of 404 (#845)
Browse files Browse the repository at this point in the history
* output conditional result based on result count

* Revert "output conditional result based on result count"

This reverts commit 3741069.

* try extracting subdomains from body in case of 404

* adding doc context to 404 page

---------

Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
Co-authored-by: Mzack9999 <mzack9999@protonmail.com>
  • Loading branch information
3 people authored May 25, 2023
1 parent 90741cd commit acde91c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion v2/pkg/subscraping/sources/digitorus/digitorus.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"bufio"
"context"
"fmt"
"net/http"
"strings"
"time"

Expand All @@ -31,7 +32,8 @@ func (s *Source) Run(ctx context.Context, domain string, session *subscraping.Se
}(time.Now())

resp, err := session.SimpleGet(ctx, fmt.Sprintf("https://certificatedetails.com/%s", domain))
if err != nil {
// the 404 page still contains around 100 subdomains - https://github.com/projectdiscovery/subfinder/issues/774
if err != nil && resp.StatusCode != http.StatusNotFound {
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: err}
s.errors++
session.DiscardHTTPResponse(resp)
Expand Down

0 comments on commit acde91c

Please sign in to comment.