Decloaks content of a given file to a temporary file with similar name and extension NOTE: using in-memory decloak() in docTests because of the "problem" on Windows platform >>> decloak(os.path.join(paths.SQLMAP_SHELL_PATH, "stagers", "stager.asp_")).startswith(b'<%') True >>>
(filename)
| 5129 | raise SqlmapGenericException(errMsg) |
| 5130 | |
| 5131 | def decloakToTemp(filename): |
| 5132 | """ |
| 5133 | Decloaks content of a given file to a temporary file with similar name and extension |
| 5134 | |
| 5135 | NOTE: using in-memory decloak() in docTests because of the "problem" on Windows platform |
| 5136 | |
| 5137 | >>> decloak(os.path.join(paths.SQLMAP_SHELL_PATH, "stagers", "stager.asp_")).startswith(b'<%') |
| 5138 | True |
| 5139 | >>> decloak(os.path.join(paths.SQLMAP_SHELL_PATH, "backdoors", "backdoor.asp_")).startswith(b'<%') |
| 5140 | True |
| 5141 | >>> b'sys_eval' in decloak(os.path.join(paths.SQLMAP_UDF_PATH, "postgresql", "linux", "64", "11", "lib_postgresqludf_sys.so_")) |
| 5142 | True |
| 5143 | """ |
| 5144 | |
| 5145 | content = decloak(filename) |
| 5146 | |
| 5147 | parts = os.path.split(filename[:-1])[-1].split('.') |
| 5148 | prefix, suffix = parts[0], '.' + parts[-1] |
| 5149 | handle, filename = tempfile.mkstemp(prefix=prefix, suffix=suffix) |
| 5150 | os.close(handle) |
| 5151 | |
| 5152 | with openFile(filename, "w+b", encoding=None) as f: |
| 5153 | f.write(content) |
| 5154 | |
| 5155 | return filename |
| 5156 | |
| 5157 | def prioritySortColumns(columns): |
| 5158 | """ |
no test coverage detected
searching dependent graphs…