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
Added two new options: -o/--output and --stdout #23
Conversation
… output directory (overriding the default), and a --stdout option to allow user to print everything to stdout so they can pipe it into another tool or redirect all output to an output file with an operating system redirector.
Thanks for fixing the directory wiping problem and adding the |
I'm writing a tool like vanquish/sniper/etc that runs a whole bunch of tools (gobuster,nikto,whatweb,sqlmap,etc.) and then parses all of that output. it will give you a report of all of the tools output that was run, but it will also parse the output and start recursively running the tools on new directions found by spidering (your tool) or brute force (gobuster). Gobuster just gives you a list of full urls that it found (no separated output files) and i'd like your tool to do the same so i can then cat them together, remove duplicates, and use that to launch my next wave of tools against any unique directory. i could parse each of your files and add them each one at a time, but redirecting it to one file is much more in line with what i am doing for all of the other tools: photon -u url --stdout > 10.10.10.1_80_photon.txt I guess another way to solve this (for me), is if you add an option that the user can tell the tool to log all of the data to one file: make sense? |
Oh I am sorry, I thought you are talking about the output that gets printed on the terminal.
As you may have guessed, Do you agree with this approach? |
i like it! |
HI there,
Thanks ^_^ |
Great! |
So for the output directory, it just works. It is a hack from here: 1adf69b#diff-cafd309176bc7c20679341c01350e33fR396 (lines 396 to 401). If no output directory, it works the way you built it. If there is an output dir, i just change name to = that instead of current directory. As for the third thing, i'm not sure what you mean about the w+ in the new file saving code. |
I am talking about this statement of yours:
The code responsible for saving the files has been changed so you may want to replace |
Do whatever you think is good, just resolve the conflicts :D |
Any update? |
|
now that you could potentially be writing to either one of two different places based on the new output param, for the dnsdumpster part, you can just return the image back to photon.py and then it will write it in the right place (either within Photon folder, or within the specified output folder). want me to take a crack at it? or are you working on it? |
Please revert the change related to dnsdumpster plugin, Do this exactly before file saving related lines if args.output:
name = args.output It's that simple! |
Awesome tool. I've been looking for something like this for a while to integrate with something I am building! I added two new options for you to consider:
Command:
python photon.py -u http://10.10.10.102:80 -l 2 -t100 -o /pentest/photontest
In this case, all of the output files will be written to /pentest/photontest:
Command:
root@htbeu:/opt/dev/Photon# python photon.py -u http://10.10.10.9:80 -l 2 -t100 --stdout
Output:
The last thing i changed is the way you were wiping the directory each time you ran the tool so that you would get clean output. If you accept the -o option which allows the user to specify the directory, you can't just blindly delete the directory anymore (can't trust user input ;)). So i think i added a cleaner way to just overwrite each file (replacing the w+ with w), that should accomplish the same thing without needing to delete directories.