(shc_name)
| 284 | |
| 285 | |
| 286 | def verify_shellcode(shc_name): |
| 287 | logger.info(" Verify shellcode: {}".format(shc_name)) |
| 288 | |
| 289 | # check if directory exists |
| 290 | if not os.path.exists(os.path.dirname(VerifyFilename)): |
| 291 | logger.info("Error, directory does not exist for: {}".format(VerifyFilename)) |
| 292 | return |
| 293 | |
| 294 | # remove indicator file |
| 295 | pathlib.Path(VerifyFilename).unlink(missing_ok=True) |
| 296 | |
| 297 | run_process_checkret([ |
| 298 | config.get("path_runshc"), |
| 299 | "{}".format(shc_name), |
| 300 | ], check=False) |
| 301 | time.sleep(SHC_VERIFY_SLEEP) |
| 302 | if os.path.isfile(VerifyFilename): |
| 303 | logger.info("---> Verify OK. Shellcode works (file was created)") |
| 304 | os.remove(VerifyFilename) |
| 305 | return True |
| 306 | else: |
| 307 | logger.error("---> Verify FAIL. Shellcode doesnt work (file was not created)") |
| 308 | return False |
| 309 | |
| 310 | |
| 311 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected