Update result filter from google dork

parent 0a83c8c3
Pipeline #528 failed with stages
in 11 minutes and 37 seconds
goofile-nim (0.1.1-parrot2) rolling; urgency=medium
* Upgrade filter for adding results
-- Nong Hoang "dmknght" Tu <dmknght@parrotsec.org> Wed, 03 Jun 2020 12:28:22 +0700
goofile-nim (0.1.1-parrot1) rolling-testing; urgency=medium
* Add color to print results
......
......@@ -107,7 +107,7 @@ proc downloadFiles(folder: string) =
echo "[*] Downloaded " & intToStr(downloaded) & " files"
proc getResult(resp: Response) =
proc getResult(resp: Response, ext: string) =
#[
Check respose and create filter for the URL
Expect result:
......@@ -143,8 +143,15 @@ proc getResult(resp: Response) =
)
# Filter: Only use URL with file
if dorkResult.realURL.endsWith(".pdf"):
allDorkResults.add(dorkResult)
if "|" in ext:
let allExt = ext.replace("(", "").replace(")", "")
for eachExt in allExt.split(" | "):
if dorkResult.realURL.endsWith("." & eachExt):
allDorkResults.add(dorkResult)
break
else:
if dorkResult.realURL.endsWith("." & ext):
allDorkResults.add(dorkResult)
proc basicSearch(domain, extension, query: string) =
......@@ -166,7 +173,7 @@ proc basicSearch(domain, extension, query: string) =
client.headers = newHttpHeaders({"User-Agent": "Mozilla/5.0 (Windows NT 10.0; …) Gecko/20100101 Firefox/68.0"})
let resp = client.get("https://google.com/search?num=500&q=" & payload)
getResult(resp)
getResult(resp, extension)
proc handleOptions(options: Options) =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment