-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: surface the duration and error metrics for each source when enumerating domains #727
feat: surface the duration and error metrics for each source when enumerating domains #727
Conversation
It looks like the issues breaking the build were already there? Possibly already being tracked by #678 |
I'm not sure about this change, modifying the source result properties from the outside is pretty weird, I think this should be done per source, each source is the entity responsible for doing this. |
Let me rework it and move the duration into Run. I'm inclined to agree, it doesn't feel great updating state of the source externally |
7d49486
to
e0a5e1a
Compare
@vzamanillo I've reworked to move the time keeping into the source. Exposing as a I also stepped over commoncrawl test for without auth - that seemed to be consistently failing and when I looked at the actually payload, it's downloading 5mb of JSON for the test. |
@owenrumney , If I run the program now time taken by each source is printed before all subdomains . Printing time taken by each source at end of program will be much better and visible . I suggest to implement and we can call this new function from runner package after I hope this makes sense . Feel free to comment if you have any questions or suggestions. |
@tarunKoyalwar - Thanks for the feedback, I've restructured the timer with the deferred function but also added counts for the results and errors. In the debug flag group, I've added I wanted to get your thoughts on the intent then if the principle is acceptable I'll update the PR |
@owenrumney , this looks awesome are you using any 3rd party library for this ?? |
also |
- Add a duration field to the `subscraping.Result` struct - Populate the `TimeTaken` field before passing to the result channel Resolves projectdiscovery#726
- sources responsible for their own time keeping - step over commoncrawl in the no auth test, it is consistently failing as a timeout
e0a5e1a
to
ef04847
Compare
@tarunKoyalwar - no 3rd library just a simple stats.go file I'm more than happy to keep chipping away at this if there are any changes you want made. I've changed the flag to |
- add stats flag to the debug group - print the time taken, number of results and errors for sources that run - print stats for each run of the agent
ef04847
to
f55404f
Compare
@owenrumney , everything seems good . can you use |
@tarunKoyalwar - switched to Fixed linting issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
./subfinder -d hackerone.com -stats
__ _____ __
_______ __/ /_ / __(_)___ ____/ /__ _____
/ ___/ / / / __ \/ /_/ / __ \/ __ / _ \/ ___/
(__ ) /_/ / /_/ / __/ / / / / /_/ / __/ /
/____/\__,_/_.___/_/ /_/_/ /_/\__,_/\___/_/ v2.5.5
projectdiscovery.io
Use with caution. You are responsible for your actions
Developers assume no liability and are not responsible for any misuse or damage.
By using subfinder, you also agree to the terms of the APIs used.
[INF] Loading provider config from '/Users/tarun/.config/subfinder/provider-config.yaml'
[INF] Enumerating subdomains for 'hackerone.com'
b.ns.hackerone.com
api.hackerone.com
go.hackerone.com
mta-sts.managed.hackerone.com
mta-sts.forwarding.hackerone.com
www.hackerone.com
design.hackerone.com
support.hackerone.com
mta-sts.hackerone.com
info.hackerone.com
events.hackerone.com
gslink.hackerone.com
hackerone.com
a.ns.hackerone.com
links.hackerone.com
docs.hackerone.com
3d.hackerone.com
resources.hackerone.com
[INF] Found 18 subdomains for 'hackerone.com' in 2 seconds 897 milliseconds
[INF] Printing source statistics for 'hackerone.com'
Source Duration Results Errors
────────────────────────────────────────────────────────
alienvault 797ms 91 0
anubis 116ms 13 0
crtsh 730ms 437 0
digitorus 791ms 228 0
dnsdumpster 2.898s 18 0
hackertarget 1.884s 4 0
riddler 480ms 12 0
virustotal 0s 0 0
The following sources were included but skipped...
bevigil
bufferover
c99
censys
certspotter
chaos
chinaz
dnsrepo
fofa
fullhunt
hunter
intelx
passivetotal
quake
robtex
securitytrails
shodan
whoisxmlapi
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@owenrumney this is nice, thank you for improving the UX by adding this option.
I also noticed some numbers are odd (censys), and we can handle it separately..
./subfinder -d hackerone.com -stats
__ _____ __
_______ __/ /_ / __(_)___ ____/ /__ _____
/ ___/ / / / __ \/ /_/ / __ \/ __ / _ \/ ___/
(__ ) /_/ / /_/ / __/ / / / / /_/ / __/ /
/____/\__,_/_.___/_/ /_/_/ /_/\__,_/\___/_/ v2.5.5
projectdiscovery.io
Use with caution. You are responsible for your actions
Developers assume no liability and are not responsible for any misuse or damage.
By using subfinder, you also agree to the terms of the APIs used.
[INF] Loading provider config from '/Users/geekboy/.config/subfinder/provider-config.yaml'
[INF] Enumerating subdomains for 'hackerone.com'
o1.email.hackerone.com
3d.hackerone.com
zendesk1.hackerone.com
www.hackerone.com
docs.hackerone.com
mta-sts.forwarding.hackerone.com
b.ns.hackerone.com
info.hackerone.com
events.hackerone.com
zendesk3.hackerone.com
api.hackerone.com
o3.email.hackerone.com
hackerone.com
zendesk2.hackerone.com
email.hackerone.com
zendesk4.hackerone.com
support.hackerone.com
gslink.hackerone.com
o2.email.hackerone.com
gsemail.hackerone.com
mta-sts.hackerone.com
mta-sts.managed.hackerone.com
a.ns.hackerone.com
links.hackerone.com
design.hackerone.com
resources.hackerone.com
ns.hackerone.com
go.hackerone.com
managed.hackerone.com
[INF] Found 29 subdomains for 'hackerone.com' in 9 seconds 584 milliseconds
[INF] Printing source statistics for 'hackerone.com'
Source Duration Results Errors
────────────────────────────────────────────────────────
alienvault 850ms 91 0
anubis 350ms 13 0
bevigil 899ms 0 0
c99 562ms 14 0
censys 9.514s 50615 0
chaos 386ms 21 0
crtsh 698ms 438 0
digitorus 699ms 228 0
dnsdumpster 2.74s 18 0
dnsrepo 901ms 49 0
fullhunt 892ms 16 0
hackertarget 1.753s 4 0
quake 9.584s 25 0
riddler 463ms 12 0
shodan 302ms 6 0
virustotal 0s 0 0
@ehsandeep Noticed the Gitlab source was not migrated, can we reopen this? |
@vzamanillo , there is a work in progress PR with lot of code refactoring and other changes (including gitlab source and default rate limit) . It will be available by tomorrow eve |
Oki oki, dind't know, thanks. |
Oh sorry did I miss updating one? |
@owenrumney , no worries I updated it |
subscraping.Result
structTimeTaken
field before passing to the result channelI've tried to be as light touch as possible - if this option isn't desirable I thought about adding a
map[string]map[string]time.Duration
to theAgent
and storing the sources time taken for a given domain against the agent and surface that way.If that would be more desirable, happy to rework the PR for that
Resolves #726