Fix: Replace f-strings and correct OS loop logic
This commit addresses several review comments:
-
I replaced f-strings with .format() for Python 2.x/3.x compatibility in:
-
src/core/injections/semiblind/techniques/tempfile_based/tfb_payloads.py -
src/core/injections/controller/controller.py
-
-
I modified the OS checking loop in
src/core/injections/controller/controller.py(around line 320) to correctly respect thesettings.OS_CHECKS_NUMvariable. Previously, ifsettings.CHECK_BOTH_OSwas true, the loop would iterate at most twice (once for UNIX, once for Windows). The new logic ensures that ifsettings.CHECK_BOTH_OSis true, the loop runssettings.OS_CHECKS_NUMtimes, cycling through the available OS options (UNIX, Windows). Ifsettings.OS_CHECKS_NUMis not set or invalid, it defaults to iterating through each OS option once. The behavior forsettings.CHECK_BOTH_OSbeing false (iterate once forsettings.TARGET_OS) is preserved. -
I investigated potential double encoding and newline handling in
src/core/injections/semiblind/techniques/tempfile_based/tfb_payloads.py. No issues requiring changes within this specific file were identified; quoting/unquoting of separators is balanced, and newline manipulation is the final step in payload construction within this file.
Thanks for the new PR! I’ll review it soon and follow up.
Closing your previous PR https://github.com/commixproject/commix/pull/1002 as it overlaps with this one.
@ManojINaik the majority of the proposed changes in this PR were applied manually, since there were several conflicts with the existing code.