Skip to content

Add hash flag, to support multi body hash type. - #517

Merged
ehsandeep merged 5 commits into
projectdiscovery:devfrom
M09Ic:dev
Feb 15, 2022
Merged

ehsandeep merged 5 commits into
projectdiscovery:devfrom
M09Ic:dev

Conversation

@M09Ic

@M09Ic M09Ic commented Feb 11, 2022 •

Copy link
Copy Markdown
Contributor

#489
#488

add -hash flag, support body select multiple hash types.

example:
echo "baidu.com" | httpx -hash md5,sha256,mmh3,simhash

output:
https://baidu.com [f9ae0e69a566407c669d0b2b634e3499] [3568381554487407123a8684c0918f59d3097a8c6c6970f60a8275cad3f4b275] [3641448047] [15074517028871015366]

echo "baidu.com" | httpx -hash md5,sha256,mmh3,simhash -json

output:
{"timestamp":"2022-02-11T18:11:16.8055152+08:00","scheme":"https","port":"443","path":"/","body-sha256":"3568381554487407123a8684c0918f59d3097a8c6c6970f60a8275cad3f4b275","header-sha256":"70b4d4a698a384f13948c1372c6ee583bbdd8ff5f7671dae23da3f95860efb14","a":["220.181.38.148","220.181.38.251"],"url":"https://baidu.com:443","input":"baidu.com","location":"http://www.baidu.com/","title":"302 Found","webserver":"bfe/1.0.8.18","content-type":"text/html","method":"GET","host":"220.181.38.148","content-length":161,"status-code":302,"response-time":"2.3005656s","failed":false,"hashes":{"md5":"f9ae0e69a566407c669d0b2b634e3499","mmh3":"3641448047","sha256":"3568381554487407123a8684c0918f59d3097a8c6c6970f60a8275cad3f4b275","simhash":"15074517028871015366"},"lines":8,"words":4}

@ehsandeep
ehsandeep requested a review from Mzack9999 February 11, 2022 19:43

@Mzack9999 Mzack9999 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@ehsandeep
ehsandeep merged commit e2b0c16 into projectdiscovery:dev Feb 15, 2022
@atlassion

Copy link
Copy Markdown

Regarding my request: how to filter this? you already have body-sha256 in json-output by default. Need a filter option by this hash like a "MATCHERS" to filter results. I see only new section "hashes":
...
"body-sha256": "HASH"
...
"hashes": {
"sha256":"HASH"
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: support -simhash Please, add BodySHA256 match/filter

4 participants