Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
packages
tools
goofileN
Commits
ca0816bf
Commit
ca0816bf
authored
Nov 17, 2020
by
dmknght
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the multiple extension error
parent
46490929
Pipeline
#1440
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
src/goofileN.nim
src/goofileN.nim
+10
-14
No files found.
src/goofileN.nim
View file @
ca0816bf
...
...
@@ -95,9 +95,12 @@ proc downloadFiles(folder: string, agent: string) =
finalPath = folder & fileName
try:
echo "[+] Downloading " & eachResult.realURL
# TODO add color for downloading and saved at.
# Downloading -> yellow
# Saved at -> cyan
echo "[+] Downloading
\e
[33m" & eachResult.realURL & "
\e
[0m"
discard client.downloadFile(eachResult.realURL, finalPath)
echo "[*] Saved at " & finalPath
echo "[*] Saved at
\e
[96m
" & finalPath
& "
\e
[0m"
downloaded += 1
except:
stderr.write("[x] Error while downloading " & eachResult.realURL & "
\n
")
...
...
@@ -122,7 +125,7 @@ proc getResult(resp: AsyncResponse, ext: string) =
else:
let allResults = parseHTML(waitfor(resp.body))
for eachResult in allResults.findAll("div"):
#
# Filter all result thing
# Filter all result thing
let
urlResults = eachResult.findAll("a")
titleResults = eachResult.findAll("h3")
...
...
@@ -143,19 +146,12 @@ proc getResult(resp: AsyncResponse, ext: string) =
cacheURL: tmpCacheURL,
)
# Filter: Only use URL with file
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)
allDorkResults.add(dorkResult)
except:
# Google Dork has some false URL like /search?q=site:gov.vn ext:(xlsx | pdf) in resp
# We ignore it
discard
proc basicSearch(domain, extension, query, agent: string) =
#[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment