projectdiscovery / httpx

httpx is a fast and multi-purpose HTTP toolkit that allows running multiple probes using the retryablehttp library.
https://docs.projectdiscovery.io/tools/httpx
MIT License
7.54k stars 823 forks source link

Json parsing error while validating the json output in JSONLint #152

Closed sA74n closed 3 years ago

sA74n commented 3 years ago

while beautifying the output of json in any online website i encounter an error saying

Error: Parse error on line 22: ...": "500.794337ms"} { "ips": ["13.227.1 ----------------------^ Expecting 'EOF', '}', ',', ']', got '{'

ehsandeep commented 3 years ago

@sA74n Can you share the complete output block that you are trying to beautify?

sA74n commented 3 years ago

u want me to show u the json output

ehsandeep commented 3 years ago

Yes @sA74n

ehsandeep commented 3 years ago

Hi @sA74n,

I mean the output content that you trying to validate, can you post here, for example:- echo 1.1.1.1 | httpx -silent -json gives following output and it's valid on https://jsonlint.com

{"url":"https://1.1.1.1","content-length":48916,"status-code":200,"location":"","title":"1.1.1.1 — The free app that makes your Internet faster.","vhost":false,"webserver":"cloudflare","content-type":"text/html","tls":{"dns_names":["cloudflare-dns.com","*.cloudflare-dns.com","one.one.one.one"],"common_name":["cloudflare-dns.com","DigiCert ECC Secure Server CA"],"organization":["Cloudflare, Inc.","DigiCert Inc"],"issuer_common_name":["DigiCert ECC Secure Server CA","DigiCert Global Root CA"],"issuer_organization":["DigiCert Inc","DigiCert Inc"]},"http2":false,"method":"GET"}
sA74n commented 3 years ago

but i am not doing httpx for a single url, inputting a list of urls cat shuffledns.txt aiodnsbrute.txt | sort -u |httpx -title -location -o httpx-output.txt -threads 200 -cdn -status-code retries 5

sA74n commented 3 years ago

but i am not doing httpx for a single url, inputting a list of urls cat shuffledns.txt aiodnsbrute.txt | sort -u |httpx -title -location -o httpx-output.txt -threads 200 -cdn -status-code retries 5

json validation works for only one url, but not for multiple urls as input

ehsandeep commented 3 years ago

@sA74n it works for multiple URLs as well, you can confirm with the following:-

subfinder -d hackerone.com -sources crtsh | httpx -json -silent | jq .
sA74n commented 3 years ago

cat http.json | jq . parse error: Invalid numeric literal at line 1, column 6 i am getting this error:(

sA74n commented 3 years ago

test

ehsandeep commented 3 years ago

@sA74n Can you upload http.json file here or join the discord server linked in the project to discuss this further.