Skip to content

resume.cfg may be written before the tool fully validates or flushes the current processing #2345

@ayuxsec

Description

@ayuxsec

httpx version:

v1.7.4 (latest)

Current Behavior:

After interrupting httpx with CTRL+C, resuming with r resume.cfg does resume execution, but some URLs that were not fully processed before interruption are skipped. The resumed run does not reprocess all remaining targets, resulting in missing output compared to normal run.

Expected Behavior:

Running httpx -r resume.cfg should resume processing the remaining targets from the resume file and produce output accordingly.


Steps To Reproduce:

  1. Run httpx with input from stdin:

    cat subs.txt | httpx
  2. Interrupt execution using CTRL+C after partial output.

  3. Observe that resume.cfg is created.

  4. Attempt to resume execution:

    cat subs.txt | httpx -r resume.cfg
  5. Observer that some targets are not present compared to the output in normal run

Anything else:

Full terminal output:

ayux@pop-os:/tmp$ cat subs.txt | httpx

    __    __  __       _  __
   / /_  / /_/ /_____ | |/ /
  / __ \/ __/ __/ __ \|   /
 / / / / /_/ /_/ /_/ /   |
/_/ /_/\__/\__/ .___/_/|_|
             /_/

        projectdiscovery.io

[INF] Current httpx version v1.7.4 (latest)
[WRN] UI Dashboard is disabled, Use -dashboard option to enable
https://example.com
https://test.io
https://google.com
https://youtube.com
ayux@pop-os:/tmp$ cat subs.txt | httpx

    __    __  __       _  __
   / /_  / /_/ /_____ | |/ /
  / __ \/ __/ __/ __ \|   /
 / / / / /_/ /_/ /_/ /   |
/_/ /_/\__/\__/ .___/_/|_|
             /_/

        projectdiscovery.io

[INF] Current httpx version v1.7.4 (latest)
[WRN] UI Dashboard is disabled, Use -dashboard option to enable
https://example.com
https://test.io
^C[INF] CTRL+C pressed: Exiting
[INF] Creating resume file: resume.cfg
[ble: exit 1]
ayux@pop-os:/tmp$ cat subs.txt | httpx -r resume.cfg

    __    __  __       _  __
   / /_  / /_/ /_____ | |/ /
  / __ \/ __/ __/ __ \|   /
 / / / / /_/ /_/ /_/ /   |
/_/ /_/\__/\__/ .___/_/|_|
             /_/

        projectdiscovery.io

[INF] Current httpx version v1.7.4 (latest)
[WRN] UI Dashboard is disabled, Use -dashboard option to enable

Possible Cause (Speculation):

It appears that resume.cfg may be written before the tool fully validates or flushes the current processing state (including remaining targets and/or output state). As a result, the resume file may be incomplete or inconsistent, causing httpx -r resume.cfg to start without any remaining work to process.

Metadata

Metadata

Assignees

Labels

Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions