-
Notifications
You must be signed in to change notification settings - Fork 32
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
Output of script not being saved to file or piped #52
Comments
Hello, thank You for taking interest in LFImap. |
I think the best option is to replace I can work on it if you give me the green light BTW: I strongly suggest to consider linting, many lines of work are very long (way over 100 characters), some are written in |
You can see a basic And the outcome of it that creates
There is more work to do though, like color removal, understand why it prints the outcome a few times, etc |
Hey, first of, thanks for the suggestion. This would be great, however we would need to account the ANSI escape sequences, which color the certain output in a colored way. Logging library will print these ANSI strings (unformatted) directly to the file. With that said, planning to continue to have the colored output support, because when the user tests large amount of URLs, the output is too clustered. The colors solve this problem. Additionally, in the future there will be command-line switches so that user can output to the XML, HTML, and TXT files sort of like a output 'report'. The TXT switch would output the LFImap output as is to the specified file location. |
For me at least, the ANSI part wouldn't be a problem, as I have already written a small function that deletes any ANSI sequences in a string, I could put it here if it's any help. What I really needed was a way to capture the exact output of the script and process it in some way. |
@X-l-l-l Of course, if you have it already written and ready, mind pasting it here? Thanks. :) |
Sure thing, here it is:
Haven't tested it in every situation, but worked well in the cases i needed it. |
The problem is identified as incorrect buffering done by the python for some unknown reasons (Guessing because we use ANSI escape sequences, buffers are not flushed correctly -> not a hundred percent on that). However, executing |
@X-l-l-l Could you git pull the latest update and test if it now works for you? Default colored: No colors: |
Tested it now. That seems like it fixed it. Tried it as you did, with outputting to a file and also tried it with subprocess.run and Popen and piping the stdout to other scripts or areas. Thank you very much! Amazing work! |
👍 Thanks for raising this |
Hi, I am trying to save the output of the script, for example like this:
python3 LFImap/lfimap.py -U "http://localhost/vulnerabilities/fi/?page=include.php" -C "..." -a > fi.txt
Or by using subprocess.Popen and then using iter to get the output, but id does not print anything.
Also tryed with subprocess.run and capture_output, and printing it at the end... Still nothing.
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: