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

deleting output directory is dangerous #34

Closed
sethsec opened this issue Jul 29, 2018 · 2 comments
Closed

deleting output directory is dangerous #34

sethsec opened this issue Jul 29, 2018 · 2 comments

Comments

@sethsec
Copy link

sethsec commented Jul 29, 2018

right now, if the user specifies -o /root, won't the program recursively delete /root because it exists (line 640).

That is why in my pull i changed the w+ to w and only modified the files you wrote in the first place.

I suggest removing the part about recursively removing the directory structure, and instead, just overwrite your files if the tools is run twice.

@s0md3v
Copy link
Owner

s0md3v commented Jul 29, 2018

If the user enters -o root, Photon will create a new directory in the current directory with the name root.

The logic used to create directories is:
the_directory_from_which_photon_was_run + '/' + new_directory

So even if you are running it from root, the directory that will be deleted is /root/root
However I will do what you said, its seems more elegant.

PS: There are only 507 lines in Photon :D

@s0md3v
Copy link
Owner

s0md3v commented Jul 29, 2018

This issue has been addressed in a331acd .

Now if the output directory exists, Photon will simply create (can overwrite) new files for saving in it.
If the output directory doesn't exists, it will be created.

Thanks for contributing ^_^

@s0md3v s0md3v closed this as completed Jul 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants