<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Replace expert password on SMB Appliance in Spark Firewall (SMB)</title>
    <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102974#M4401</link>
    <description>&lt;P&gt;You're welcome!&lt;/P&gt;</description>
    <pubDate>Mon, 23 Nov 2020 12:45:21 GMT</pubDate>
    <dc:creator>KennyManrique</dc:creator>
    <dc:date>2020-11-23T12:45:21Z</dc:date>
    <item>
      <title>Replace expert password on SMB Appliance</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102708#M4387</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;Some time ago a customer requested changes at expert level for compliance purposes. The thing was that since the&amp;nbsp;&lt;STRONG&gt;locally managed SMB device (1140)&lt;/STRONG&gt;&amp;nbsp;was inherited from another administrator, the &lt;STRONG&gt;expert password was unknown&lt;/STRONG&gt;. Tried a ton of usual passwords for the organization, none of them worked.&lt;/P&gt;&lt;P&gt;After a fast search on SK, I landed on&amp;nbsp;&lt;A href="https://supportcenter.checkpoint.com/supportcenter/portal?action=portlets.SearchResultMainAction&amp;amp;eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk106025" target="_blank" rel="noopener"&gt;sk106025&lt;/A&gt;&amp;nbsp;and read the following statement:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 567px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9153i3E955BDAA248DCAD/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;That was a little bit dissapointing, because I still was able to access as web gui admin and perform many administrator operations. So I decided to find a way to gain expert access without having to factory default the device and reconfigure all parameters from scratch (maybe my lazziness was the main cause of this haha).&lt;/P&gt;&lt;P&gt;So, moving on. On Web GUI, I generated a backup as usual. This is so important since all the required configurations are contained on this file. Also previous experience from backup restore on different smb hardware, reminded me that all the time expert password was replaced for the one contained on backup.&lt;/P&gt;&lt;P&gt;Opening the backup I found the following files:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 278px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9154i0E8AC0DBB1D68DE0/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;According to sk106025&amp;nbsp;&lt;STRONG&gt;expert_pass_&lt;/STRONG&gt;&amp;nbsp;file contains the MD5 expert password hash, as expert it can be deleted so the system will ask again for a new password. Also there is the&amp;nbsp;&lt;STRONG&gt;shadow&lt;/STRONG&gt;&amp;nbsp;file, that contains MD5 hashed credentials for all users; the web admin among of them (notice the last&amp;nbsp;line was added by me to explain the segments):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 311px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9155i7DB37F96AEFBF583/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 545px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9156i13EF9880527ED118/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;One interesting fact when extracted the ZIP backup on a Windows computer was the following message:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 310px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9157iAC37836B459F85B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I opened the ZIP file as text to verify, and found the following:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 410px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9158iFC3F3213EFAB21E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Some metadata is added to the ZIP file, I presume that is to identify the device and proceed with restore. Because of this, I needed to undrestand how backups are generated. I can't only modify the contents under windows since the metadata will be missing after recompression.&lt;/P&gt;&lt;P&gt;After some digging on Internet, I found a 2016&amp;nbsp;&lt;A href="https://blog.spikefishsolutions.com/2016/04/strace-backsup-how-magically-strace-is.html" target="_blank" rel="noopener"&gt;blog entry&lt;/A&gt;&amp;nbsp;by&amp;nbsp;&lt;STRONG&gt;John Fleming&lt;/STRONG&gt;&amp;nbsp;where he does a great analysis of backup routine using strace. This gave me the necessary flags to recreate the file using any linux distro with ZIP support. So started a live usb image of Parrot linux (you can use whatever you want). The first thing I did was to check the comment for the previously generated backup and found that not all data is added as comment:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 567px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9159i6A7C32C9363D9D9F/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;At backup creation, this comment is generated by /pfrm2.0/bin/&lt;STRONG&gt;backup_settings.sh&amp;nbsp;&lt;/STRONG&gt;execution, adding the relevant info for the appliance:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 348px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9213iF548EB617C22628D/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So copied the backup to a new directory and unzipped:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 567px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9160i7E6A374DF3259F88/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Once all files were extraced, procedeed to edit&lt;STRONG&gt;&amp;nbsp;expert_pass_&lt;/STRONG&gt;&amp;nbsp;file using vim. The unknown expert password hashed data was located here, I replaced it with the information of web gui admin from shadow file (only $&lt;EM&gt;1&lt;/EM&gt;$&lt;EM&gt;SALT&lt;/EM&gt;$&lt;EM&gt;HASH&amp;nbsp;&lt;/EM&gt;is needed):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 483px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9161i5458ABE606A76C8E/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Zipped a new file named backup.zip using the flags -ry (recursive - include sym links only where is necessary) and -z at the end to add the same comment extracted some steps ago:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 684px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9163i2E05F866FB884FF4/image-dimensions/684x227?v=v2" width="684" height="227" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 460px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9164i1AD01C57C7B0D2D9/image-dimensions/460x59?v=v2" width="460" height="59" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 549px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9165i96C50F2ADC545E36/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The new generated ZIP backup contains almost exactly the same information at the end of the payload. Using echo, I added the final information (maybe this step is not necessary, I didn't test the restore up to this point) &lt;STRONG&gt;EDIT:&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;After downloading a backup through SCP noticed this information doesn't exists; it's only added when the backup is obtained through a web browser&lt;/EM&gt;&lt;/STRONG&gt;. Used -n flag to avoid a line jump at the end, so it matches the original format:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 431px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9167i1CA2BB92424A0619/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Changed the name back to original to match the CP format:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 567px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9169i01714928AAB97032/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Finally changed file permissions as the original backup (777):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 567px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9170i32F6649B15819712/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Backup was uploaded and restored to appliance sucessfully:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 415px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9171i59EBD9BBD5B213AB/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 431px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9172i9709EB1E68BA8E1B/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 438px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9173iD5EECCD51EBE3684/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 432px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9174i08904AE5DBF18820/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Finally I got expert access with same password as web gui admin user:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 409px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9175i59169E3C23ECB4EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;All configurations (policy, vpn, filtering, etc) worked perfectly!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 13:59:56 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102708#M4387</guid>
      <dc:creator>KennyManrique</dc:creator>
      <dc:date>2020-11-23T13:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Replace expert password on SMB Appliance</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102719#M4388</link>
      <description>&lt;P&gt;Yeah ! That is the spirit i love 8)&lt;/img&gt; !!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 18:07:49 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102719#M4388</guid>
      <dc:creator>G_W_Albrecht</dc:creator>
      <dc:date>2020-11-19T18:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Replace expert password on SMB Appliance</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102784#M4390</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It should work up to R77.20.XX versions. Still not tried on R80.20.XX since I don't have the hardware.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 12:33:31 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102784#M4390</guid>
      <dc:creator>KennyManrique</dc:creator>
      <dc:date>2020-11-20T12:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Replace expert password on SMB Appliance</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102867#M4395</link>
      <description>&lt;P&gt;Impressed you worked that out.&lt;BR /&gt;Thanks for sharing!&lt;/P&gt;</description>
      <pubDate>Sun, 22 Nov 2020 04:17:29 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102867#M4395</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2020-11-22T04:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Replace expert password on SMB Appliance</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102924#M4399</link>
      <description>&lt;P&gt;w00t! I remember finding backup info in the comments and thinking that was an interesting abuse of comments.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 04:31:30 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102924#M4399</guid>
      <dc:creator>John_Fleming</dc:creator>
      <dc:date>2020-11-23T04:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Replace expert password on SMB Appliance</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102973#M4400</link>
      <description>&lt;P&gt;It was there for a reason haha! On my very first test, without comments, the file was recognized as "Invalid backup".&lt;/P&gt;&lt;P&gt;BTW, thank you for the blog post!&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 12:43:45 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102973#M4400</guid>
      <dc:creator>KennyManrique</dc:creator>
      <dc:date>2020-11-23T12:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Replace expert password on SMB Appliance</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102974#M4401</link>
      <description>&lt;P&gt;You're welcome!&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 12:45:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102974#M4401</guid>
      <dc:creator>KennyManrique</dc:creator>
      <dc:date>2020-11-23T12:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Replace expert password on SMB Appliance</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102986#M4402</link>
      <description>&lt;P&gt;It seems that the file structure is identical and we have expert_pass_ here also:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SMB.png" style="width: 617px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9214i3B293570D572373F/image-size/large?v=v2&amp;amp;px=999" role="button" title="SMB.png" alt="SMB.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So it should work for R80.20.xx also...&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 13:42:49 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102986#M4402</guid>
      <dc:creator>G_W_Albrecht</dc:creator>
      <dc:date>2020-11-23T13:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Replace expert password on SMB Appliance</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102993#M4403</link>
      <description>&lt;P&gt;It's good to know!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 14:03:54 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/102993#M4403</guid>
      <dc:creator>KennyManrique</dc:creator>
      <dc:date>2020-11-23T14:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: Replace expert password on SMB Appliance</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/103028#M4404</link>
      <description>&lt;P&gt;Excellent hack I must say. Thanx for sharing it.&lt;/P&gt;
&lt;P&gt;However, I find this as a potential security issue. Tampering with backup files for security devices should not be possible. They must at least be signed. Something CheckPoint should think about...&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 17:15:20 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/103028#M4404</guid>
      <dc:creator>HristoGrigorov</dc:creator>
      <dc:date>2020-11-23T17:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Replace expert password on SMB Appliance</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/103034#M4405</link>
      <description>&lt;P&gt;That's right, it can be considered as security issue because the modification of sensitive information. Maybe administrators should document the SHA2 hash of the file itself after the backup generation and&amp;nbsp;manually verify at restore that is not a modified file. This until CP propose new backup procedures to avoid tampering.&lt;/P&gt;&lt;P&gt;Luckily for my case, there was no other checks than zip's comment.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 18:09:47 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Replace-expert-password-on-SMB-Appliance/m-p/103034#M4405</guid>
      <dc:creator>KennyManrique</dc:creator>
      <dc:date>2020-11-23T18:09:47Z</dc:date>
    </item>
  </channel>
</rss>

