Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    How can I decrypt elements of the config file?

    Scheduled Pinned Locked Moved Problems Installing or Upgrading pfSense Software
    4 Posts 4 Posters 2.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      cjbujold
      last edited by

      I have an old backup file of a past configuration.  There is a section of the backup file that contains Allowed IP's.  We are configuring a new PF server and would need that list of IP to be entered in this new configuration.  When I review the backup I see the section in question but the IP's are in a custom file and the data seems compressed or encypted in some fashion.  Is there a way to uncompress the custom data so it can be read?

      Thanks
      cjb

      1 Reply Last reply Reply Quote 0
      • dotdashD
        dotdash
        last edited by

        Restore it to a test box and pull out what you need.

        1 Reply Last reply Reply Quote 0
        • BBcan177B
          BBcan177 Moderator
          last edited by

          The custom data that you see in the config.xml file is in base_64 compressed format.

          If you goto Diagnostics:Command Prompt in the GUI -

          And in the PHP Execute Box type :

          print base64_decode("  coded String  ");

          So you will need to view the config.xml file (or the Backup file) and look for the line with your coded string

          "coded string"

          and copy the "coded string" part …  It will output the decoded string to the Screen.

          Hope this helps!

          "Experience is something you don't get until just after you need it."

          Website: http://pfBlockerNG.com
          Twitter: @BBcan177  #pfBlockerNG
          Reddit: https://www.reddit.com/r/pfBlockerNG/new/

          1 Reply Last reply Reply Quote 0
          • P
            pLu
            last edited by

            $ cat - | base64 -d
            

            Paste the encoded data and end with Ctrl-D (EOF).

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.