Skip to content

Comments

hunter.how - new api provider support #166

Merged
ehsandeep merged 8 commits intodevfrom
issue-149-hunterhow-enfine-integration
Mar 3, 2023
Merged

hunter.how - new api provider support #166
ehsandeep merged 8 commits intodevfrom
issue-149-hunterhow-enfine-integration

Conversation

@xm1k3
Copy link
Contributor

@xm1k3 xm1k3 commented Feb 28, 2023

./uncover -e hunterhow -q 'product.name="jira"' -f host -v  

  __  ______  _________ _   _____  _____
 / / / / __ \/ ___/ __ \ | / / _ \/ ___/
/ /_/ / / / / /__/ /_/ / |/ /  __/ /    
\__,_/_/ /_/\___/\____/|___/\___/_/ v1.0.2

                projectdiscovery.io

[hunterhow] community.deiser.com
[hunterhow] jira.deiser.com
[hunterhow] retchat.com
[hunterhow] www.retchat.com
[hunterhow] www.rico-baby.com
[hunterhow] ip74.ip-79-137-122.eu
[hunterhow] team.gitee.cn

query guide:
https://hunter.how/guide

@xm1k3 xm1k3 self-assigned this Feb 28, 2023
@xm1k3 xm1k3 added the Type: Enhancement Most issues will probably ask for additions or changes. label Feb 28, 2023
@xm1k3 xm1k3 linked an issue Feb 28, 2023 that may be closed by this pull request
@xm1k3 xm1k3 force-pushed the issue-149-hunterhow-enfine-integration branch from e4b01d8 to dfd80c3 Compare March 1, 2023 13:12
@xm1k3 xm1k3 marked this pull request as ready for review March 1, 2023 13:17
@xm1k3 xm1k3 requested review from Mzack9999 and tarunKoyalwar March 1, 2023 13:36
Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Please update the readme with newly added sources (including publicwww)
  • Could you provide an example query, I'm getting no results with a valid token and
$ go run . -q test -e hunterhow

@xm1k3
Copy link
Contributor Author

xm1k3 commented Mar 1, 2023

./uncover -e hunterhow -q 'product.name=\"jira\"' -f host -v  

  __  ______  _________ _   _____  _____
 / / / / __ \/ ___/ __ \ | / / _ \/ ___/
/ /_/ / / / / /__/ /_/ / |/ /  __/ /    
\__,_/_/ /_/\___/\____/|___/\___/_/ v1.0.2

                projectdiscovery.io

[hunterhow] community.deiser.com
[hunterhow] jira.deiser.com
[hunterhow] retchat.com
[hunterhow] www.retchat.com
[hunterhow] www.rico-baby.com
[hunterhow] ip74.ip-79-137-122.eu
[hunterhow] team.gitee.cn

@xm1k3 xm1k3 requested a review from Mzack9999 March 1, 2023 15:46
Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

$ go run . -e hunterhow -q 'product.name=\"jira\"' -f host -v  
...
[hunterhow] dev.proaimltd.com.cn
[hunterhow] build.bmb1688.com

Comment on lines +45 to +71
pageQuery := 1

for {
hunterhowRequest := &Request{
Query: query.Query,
PageSize: query.Limit,
Page: pageQuery,
}

if numberOfResults > query.Limit {
break
}

hunterhowResponse := agent.query(hunterhowRequest.buildURL(session.Keys.HunterHowToken), session, results)
if hunterhowResponse == nil {
break
}

if len(hunterhowResponse) == 0 {
break
}

numberOfResults += len(hunterhowResponse)
pageQuery += 1
}
}()

Copy link
Member

@tarunKoyalwar tarunKoyalwar Mar 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xm1k3 ,not sure if you want to implement in this PR or a new one . but just to point out this implementation looks good if no of results < 1000 (10 requests are made in serial) but if there are more than 1000> requests it takes time which shouldn't be the case .
From api docs a example response returns "total":5994 in response so after first request we can get total results and calculate number of pages available and fetch them according to limit cli option in parallel, this way it won't take that much time

so query returns 5994 results it is ~60 req 
60 req in serial (current implementation) takes ~40-50 sec 
60 req in parallel takes ~10 sec
*estimated time here is approx and depends on various factors

Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm ! suggested some possible optimizations

$ ./uncover -hh "product.name=\"jira\"" -f host -v

  __  ______  _________ _   _____  _____
 / / / / __ \/ ___/ __ \ | / / _ \/ ___/
/ /_/ / / / / /__/ /_/ / |/ /  __/ /    
\__,_/_/ /_/\___/\____/|___/\___/_/ v1.0.2

		projectdiscovery.io

[hunterhow] gentlecode.com
[hunterhow] www.gentlecode.com
[hunterhow] host64.ru
[hunterhow] jira.erbanyy.com
[hunterhow] jira.ptponclick.com

@ehsandeep ehsandeep merged commit 43e1143 into dev Mar 3, 2023
@ehsandeep ehsandeep deleted the issue-149-hunterhow-enfine-integration branch March 3, 2023 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Enhancement Most issues will probably ask for additions or changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hunter.how - new api provider support

4 participants