Fix small bug from curl 404 output

This PR fixes a small bug from when `curl` receives an `HTTP 404` from the web server and the error code is non-zero (in this case `22`). This handles that case in the if statement. There may other error codes that `curl` throws, HTTP-wise, that you may want to catch in the future as well but I didn't run into them.
This commit is contained in:
goproslowyo 2022-01-02 14:53:49 -08:00 committed by GitHub
parent c4d1c8a9db
commit d13b25c703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -235,7 +235,7 @@ async def port_scan(plugin, target):
warn('A process was left running after port scan {bblue}' + plugin.name + ' {green}(' + plugin.slug + '){rst} against {byellow}' + target.address + '{rst} finished. Please ensure non-blocking processes are awaited before the run coroutine finishes. Awaiting now.', verbosity=2)
await process_dict['process'].wait()
if process_dict['process'].returncode != 0:
if process_dict['process'].returncode != 0 or (process_dict['cmd'].contains('curl') and process_dict['process'].returncode != 22):
errors = []
while True:
line = await process_dict['stderr'].readline()