Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get all files by extension no matter what filename it has #1089

Open
redsigma opened this issue Apr 15, 2022 · 9 comments
Open

Get all files by extension no matter what filename it has #1089

redsigma opened this issue Apr 15, 2022 · 9 comments
Labels
enhancement New feature or request need more info Some information is missing

Comments

@redsigma
Copy link

redsigma commented Apr 15, 2022

What is the feature?

I want to make a wordlist where i can search for all files of a specific extension. I don't know the name of these files.

I don't know if i am doing something wrong with my wordlist but i checked the manpage and the issues on this repository and i could not find any meaningful help

My word list looks like this:

.%EXT%
.*.%EXT%
[a-z].%EXT%

For some reason it succesfully finds a file called .html but if it's called test.html then it does not find it.
From what i have tried i assume regex is not supported.

I am using the docker image on windows with the following batch script:

docker run -it --rm --name dirsearch ^
  --mount type=bind,source="%path_wordlist%",target=/root/db/dicc.txt ^
  --mount type=bind,source="%cd%/reports/",target="/root/reports/" ^
  --mount type=bind,source="%cd%/logs/",target="/root/logs/" ^
  "dirsearch:v0.4.2" ^
    --threads %thread_number% ^
    --max-rate %total_requests_in_1_sec% ^
    --delay %delay_between_request_in_sec% ^
    --output %path_report% --format simple ^
    --random-agent ^
    -e pdf,html ^
    -u "%URL%"

What is the use case?

I am under the impression that this program only searches specific names, so maybe a feature that retrives files just by their extension would be useful for quick testing.

@redsigma redsigma added the enhancement New feature or request label Apr 15, 2022
@shelld3v
Copy link
Collaborator

Hi, I don't understand what you are trying to say here, can you explain it clearer, with your current situation and what you expect to get?

@shelld3v shelld3v added the need more info Some information is missing label Apr 15, 2022
@redsigma
Copy link
Author

I have a directory with 2 files.

.html
test.html

I want to make a wordlist which shows me those 2 files. I only know the extensions of the files and not their names.

@shelld3v
Copy link
Collaborator

So for example you have a wordlist like this:

.html
a.html
b.jsp
c.php

And you want to get only paths that have .html extension (in this case .html and a.html)? Why don't you use regex? Something like [.]html$

@redsigma
Copy link
Author

So for example you have a wordlist like this:

.html
a.html
b.jsp
c.php

And you want to get only paths that have .html extension (in this case .html and a.html)? Why don't you use regex? Something like [.]html$

Yes i want to get .html and a.html files. I have a page where there are multiple .html and .pdf files and also subfolders with these files, however not all subfolders have these files and instead of manually checking each folder and subfolder i am using this tool.

I emptied my dictionary file and added only the following

[.].pdf$
[.].html$
[.].%EXT%$

However there is no output . Log file is empty, and there is no report.html file
image

@shelld3v
Copy link
Collaborator

I think it should be:

[.]pdf$
[.]html$
[.]%EXT%$

@redsigma
Copy link
Author

redsigma commented Apr 21, 2022

I think it should be:

[.]pdf$
[.]html$
[.]%EXT%$

Ah my bad. I made sure to copy paste that this time, but the output is still the same as before

I am not sure if regex works or maybe it's a problem with case sensitivity. The filenames have mixed uppercase and lower case characters and sometimes characters such as - or _

EDIT: I think i have not pointed this out but the filenames have more than 1 character

@shelld3v
Copy link
Collaborator

shelld3v commented May 2, 2022

What bash command (or any way you tried) did you use to filter?

@redsigma
Copy link
Author

redsigma commented May 2, 2022

What bash command (or any way you tried) did you use to filter?

As stated in the description i have run the following docker image (that i build locally using the provisioned docker file )

  "dirsearch:v0.4.2"
    --threads %thread_number% 
    --max-rate %total_requests_in_1_sec% 
    --delay %delay_between_request_in_sec% 
    --output %path_report% --format simple 
    --random-agent 
    -e pdf,html
    -u "%URL%"

I am running this from a windows machine, but i dont think this matters. The dictionary file is mounted from my host machine and i checked that it works by adding a hardcoded filename in it.

The dictionary file which i used to get all .html and .pdf files is the following (but it doesn't work)

[.]pdf$
[.]html$
[.]%EXT%$

@shelld3v
Copy link
Collaborator

That should not be what is in the dictionary, dirsearch doesn't support wordlist with regex inside it (maybe something similar in the future?).

Sorry for the late reply anyway!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request need more info Some information is missing
Projects
None yet
Development

No branches or pull requests

2 participants