Skip to content

Persistence libraries/Mixins #20381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

h00die
Copy link
Contributor

@h00die h00die commented Jul 11, 2025

Phase 1 of #20374 with files directly taken from #19815 . This PR adds the necessary libraries/mixins to create the new persistence types.

Verification

  • Start msfconsole
  • Verify Make sure no errors show up in logs since the modules that use this mixin will be in a different PR
  • Verify Spec passes


save_cleanup_rc if datastore['CleanUpRc'] && !@clean_up_rc.empty?

@persistence_service.wait if run_as_background
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking aloud; I wonder if we should be aligning with the WfsDelay/passive stance concepts that already exist in framework versus introducing a new approach here 🤔

Edit: Looks like @dledda-r7 was looking into this here: #19815 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dledda-r7 any updates on this?


# logfile name
clean_rc = logs + ::File::Separator + Rex::FileUtils.clean_path(host + filenameinfo) + '.rc'
file_local_write(clean_rc, @clean_up_rc)
Copy link
Contributor

@adfoster-r7 adfoster-r7 Jul 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker since this is an existing pattern; I think nowadays we've got real loggers/logsinks set up in framework for this kind of manual logging; but these lines will be easy to change in the future so not a blocker

# -*- coding: binary -*-

module Msf
module Exploit::Local::Timespec
Copy link
Contributor

@adfoster-r7 adfoster-r7 Jul 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there's a better name we can throw in here, is it a posix specific timespec or similar? 👀

It'd be great to add a comment to an RFC or something similar that shows where this format is documented for future travellers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked chatgpt for some suggestions:

  • TimeExpression
  • TimeStringParser
  • FlexibleTime
  • NaturalTime
  • TimeInputValidator

I'm a fan of NaturalTime, chatgpt recommends TimeInputValidator overall.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think these are actually based off of any RFCs. 3339 is YYYY-MM-DDTHH:MM:SSZ but that isn't covered here at all. ISO 8601 is similar. RFC 2822/5322 is somewhat covered, but not really. I think this is just unique!

@h00die
Copy link
Contributor Author

h00die commented Aug 6, 2025

@dledda-r7 see #20381 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants