Skip to content
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

Safely print cert string values in ronin cert-dump #193

Open
postmodern opened this issue May 19, 2024 · 0 comments
Open

Safely print cert string values in ronin cert-dump #193

postmodern opened this issue May 19, 2024 · 0 comments
Labels
cert-dump ronin cert-dump command Ronin Command enhancement Enhancement to existing code

Comments

@postmodern
Copy link
Member

X509 certificate strings can contain newlines and other control characters. If a cert string contains non-printable characters (ex: str =~ /[^[:print:]]/) then display the string as quoted/escaped (ex: str = str.inspect). This should be done for all String values in the parsed Cert object.

def escape_string(string)
  if string =~ /[^[:print:]]/
    string.inspect
  else
    string
  end
end

References

@postmodern postmodern added enhancement Enhancement to existing code command Ronin Command cert-dump ronin cert-dump labels May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cert-dump ronin cert-dump command Ronin Command enhancement Enhancement to existing code
Projects
None yet
Development

No branches or pull requests

1 participant