{"id":437,"date":"2021-02-27T16:34:19","date_gmt":"2021-02-27T15:34:19","guid":{"rendered":"http:\/\/www.labtinker.net\/?p=437"},"modified":"2021-02-27T16:34:19","modified_gmt":"2021-02-27T15:34:19","slug":"smashing-in-saml","status":"publish","type":"post","link":"http:\/\/18.135.13.153\/?p=437","title":{"rendered":"Smashing in SAML"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">My aim in this post is to get administrator access to a Palo Alto firewall using SAML authentication. The theory of this proccess is well-documented. Here is a explanation of it from Palo themselves:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/knowledgebase.paloaltonetworks.com\/KCSArticleDetail?id=kA10g000000ClVvCAK\">https:\/\/knowledgebase.paloaltonetworks.com\/KCSArticleDetail?id=kA10g000000ClVvCAK<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In summary, SAML allows federated authentication: basically we have a service provider (SP) and an identity provider (IdP) who trust each other. So when a user tries to authenticate to the SP, they are redirected to the IdP where the user has an account. The user inputs their credentials to prove this, and is then rewarded with a SAML assertion which the user then presents  to the SP. As the SP trusts the IdP, it consumes the assertion and allows the user the appropriate access using the contents of the assertion.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Our lab looks something like this (None of annoying infrastrucure an enterprise would have such as firewalls, proxies, load-balancers etc)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"629\" height=\"419\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/saml-1.jpg\" alt=\"\" class=\"wp-image-441\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/saml-1.jpg 629w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/saml-1-300x200.jpg 300w\" sizes=\"auto, (max-width: 629px) 100vw, 629px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"> In the rectangle we have two AWS Windows 2016 servers. The AD server is the PDC for the Active Directory domain. On the server<em> <\/em><strong>fs.labtinker.net <\/strong> we have ADFS (Active Directory Federation Service) installed or will have; and <strong>vpn.badtinker.net<\/strong> is a Palo Alto firewall spun up in Azure (bundle2) . My domains badtinker.net and<strong> <\/strong>labtinker.net are both in AWS Route 53 so DNS changes are easy enough.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>ADFS Installation<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So I joined <strong>fs.labtinker.net <\/strong>to the labtinker.net AD domain and then installed ADFS as below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"268\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/adfs-install1.jpg\" alt=\"\" class=\"wp-image-443\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/adfs-install1.jpg 600w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/adfs-install1-300x134.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption class=\"wp-element-caption\">Install Page 1<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Oh&#8230; I had to get hold of a certificate and install this on this box before I could select it, so I had added this this in my local machine store:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"415\" height=\"394\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-2.png\" alt=\"\" class=\"wp-image-451\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-2.png 415w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-2-300x285.png 300w\" sizes=\"auto, (max-width: 415px) 100vw, 415px\" \/><figcaption class=\"wp-element-caption\">The ADFS server certificate<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"596\" height=\"259\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/adfs-install2-1.jpg\" alt=\"\" class=\"wp-image-445\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/adfs-install2-1.jpg 596w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/adfs-install2-1-300x130.jpg 300w\" sizes=\"auto, (max-width: 596px) 100vw, 596px\" \/><figcaption class=\"wp-element-caption\">Install Page 2<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We specify a service account then create a database.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1023\" height=\"450\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/adfs-install3.jpg\" alt=\"\" class=\"wp-image-446\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/adfs-install3.jpg 1023w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/adfs-install3-300x132.jpg 300w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/adfs-install3-768x338.jpg 768w\" sizes=\"auto, (max-width: 1023px) 100vw, 1023px\" \/><figcaption class=\"wp-element-caption\">Install Page 3<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This process should create an SPN and we can confirm that with the following command (after logging into a domain account):<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"857\" height=\"112\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-3.png\" alt=\"\" class=\"wp-image-452\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-3.png 857w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-3-300x39.png 300w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-3-768x100.png 768w\" sizes=\"auto, (max-width: 857px) 100vw, 857px\" \/><figcaption class=\"wp-element-caption\">SPN in place.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>AD<\/strong> <strong>Server Config<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There&#8217;s not much we need to do on the AD server itself apart from add a user. In this example I&#8217;m using John which I have already added.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Palo Alto<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On the Palo Alto we will need to define a SAML IdP. The easiest way to do this is to import the metadata from the ADFS server. As long as we have our DNS entry set up for <strong>fs.labtinker.net<\/strong><em> <\/em>this can be imported from the URL you find in AD FS Endpoints.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"265\" height=\"231\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-4.png\" alt=\"\" class=\"wp-image-453\"\/><figcaption class=\"wp-element-caption\">ADFS Endponts<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"813\" height=\"82\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-5.png\" alt=\"\" class=\"wp-image-454\" style=\"width:630px;height:63px\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-5.png 813w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-5-300x30.png 300w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-5-768x77.png 768w\" sizes=\"auto, (max-width: 813px) 100vw, 813px\" \/><figcaption class=\"wp-element-caption\">Metadata URL<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Namely:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/fs.labtinker.net\/FederationMetadata\/2007-06\/FederationMetadata.xml\">https:\/\/fs.labtinker.net\/FederationMetadata\/2007-06\/FederationMetadata.xml<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You will be able to browse to this and save an XML (not when you&#8217;re reading this as I&#8217;ll have shut down the lab &#8211; those cloud fees rack up.)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"435\" height=\"343\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-6.png\" alt=\"\" class=\"wp-image-455\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-6.png 435w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-6-300x237.png 300w\" sizes=\"auto, (max-width: 435px) 100vw, 435px\" \/><figcaption class=\"wp-element-caption\">Grab the metadata file.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Put that to one side and log into your Palo Alto &#8211; we will also need to add a DNS entry for <strong>vpn.badtinker.net <\/strong>and also import a certificate of the same name into the Palo&#8217;s cert store.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Add SAML Identity Provider<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On the Palo Alto&#8217;s device menu, we pop down to the SAML Identity Provider Screen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"229\" height=\"228\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-7.png\" alt=\"\" class=\"wp-image-456\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-7.png 229w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-7-150x150.png 150w\" sizes=\"auto, (max-width: 229px) 100vw, 229px\" \/><figcaption class=\"wp-element-caption\">SAML IdP on the Palo<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We have an &#8216;Import&#8217; action and we name our IdP server and then browse to the ADFS metadata file. For my lab, I unticked the &#8216;Validate Identity Provider Certificate&#8217; and increased the clock skew.. the latter I think unecessary but was a hangover from some troubleshooting, the former is necessary as we would need our IdP signing cert to be issued by a CA and it&#8217;s not &#8211; see below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"502\" height=\"291\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-12.png\" alt=\"\" class=\"wp-image-461\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-12.png 502w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-12-300x174.png 300w\" sizes=\"auto, (max-width: 502px) 100vw, 502px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Having done this you&#8217;ll get a server entry and if you click on this you&#8217;ll see what&#8217;s in the metadata&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"656\" height=\"441\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-9.png\" alt=\"\" class=\"wp-image-458\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-9.png 656w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-9-300x202.png 300w\" sizes=\"auto, (max-width: 656px) 100vw, 656px\" \/><figcaption class=\"wp-element-caption\">ADFS Server definition &#8211; notice I bumped up the clock skew when troubleshooting.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Notice the IdP cert is <strong>crt.labtinker.shared.<\/strong> This is a self-signed cert our ADFS created and included in metadata so we should find it in the Palo&#8217;s cert store as indeed we do.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"816\" height=\"356\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-11.png\" alt=\"\" class=\"wp-image-460\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-11.png 816w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-11-300x131.png 300w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-11-768x335.png 768w\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" \/><figcaption class=\"wp-element-caption\">Signing Cert in the Palo&#8217;s Certificates Store.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">As this is a self-signed certificate, if we&#8217;d have checked &#8216;Validate Identity Provider Certifcate&#8217;, the Palo would try and check this online and find it couldn&#8217;t. There are ways to configure the ADFS server to use a CA-issued certificate but we haven&#8217;t here. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">OK, now we need to create an Authentication Profile which again is on the Palo&#8217;s device menu.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"238\" height=\"163\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-13.png\" alt=\"\" class=\"wp-image-462\" style=\"width:239px;height:164px\"\/><figcaption class=\"wp-element-caption\">Authentication Profile<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We name it &#8216;saml&#8217;, or I did, specify the Type as &#8216;SAML&#8217; and for the IdP Server profile select the certificate <strong>vpn.labtinker.net <\/strong>(installed earlier &#8211; with its private key &#8211; the public key of this will be included in the metadata we generated for the ADFS). We&#8217;ll keep the attribute we are using as <em>username<\/em> so this is what we&#8217;ll expect to see in the SAML assertion from the ADFS.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"597\" height=\"294\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-14.png\" alt=\"\" class=\"wp-image-463\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-14.png 597w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-14-300x148.png 300w\" sizes=\"auto, (max-width: 597px) 100vw, 597px\" \/><figcaption class=\"wp-element-caption\">Add an authentication profile.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The &#8216;Advanced&#8217; tab allows us to restrict this to given users, we&#8217;ll just add &#8216;any&#8217;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"607\" height=\"201\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-15.png\" alt=\"\" class=\"wp-image-464\" style=\"width:607px;height:201px\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-15.png 607w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-15-300x99.png 300w\" sizes=\"auto, (max-width: 607px) 100vw, 607px\" \/><figcaption class=\"wp-element-caption\">All wecome.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Having done this you&#8217;ll see the following&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"83\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/saml-auth2-1024x83.jpg\" alt=\"\" class=\"wp-image-469\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/saml-auth2-1024x83.jpg 1024w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/saml-auth2-300x24.jpg 300w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/saml-auth2-768x62.jpg 768w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/saml-auth2.jpg 1123w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">SAML authentication profile<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll notice there&#8217;s a metadata link here which will provide the metadata file we need to provide to the ADFS. Clicking on this, we need to fill in a couple of things. The service will be &#8216;managment&#8217;, the authentication profile is &#8216;saml&#8217; and the ip or hostname is <strong>https:\/\/vpn.badtinker.net.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"712\" height=\"241\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-17.png\" alt=\"\" class=\"wp-image-471\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-17.png 712w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-17-300x102.png 300w\" sizes=\"auto, (max-width: 712px) 100vw, 712px\" \/><figcaption class=\"wp-element-caption\">Palo SAML Metadata export.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">OK &#8211; save this file away &#8211; we&#8217;ll need it back on our ADFS server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We need to do one more thing on the Palo and add a SAML admininstrator with the username that we&#8217;ll present in our assertion and map this to our &#8216;saml&#8217; authentication profile. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"265\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-19.png\" alt=\"\" class=\"wp-image-473\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-19.png 650w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-19-300x122.png 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><figcaption class=\"wp-element-caption\">John &#8211; SAML administrator.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Back on the ADFS server&#8230;<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We need to tell the ADFS server about the Palo by adding it as a Relying Party in the AD FS Tool.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"264\" height=\"292\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-20.png\" alt=\"\" class=\"wp-image-474\"\/><figcaption class=\"wp-element-caption\">Relying Party Trust Menu<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Clicking on the &#8216;Add Relying Party Trust&#8217; sends us into a wizard.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"378\" height=\"292\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-23.png\" alt=\"\" class=\"wp-image-477\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-23.png 378w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-23-300x232.png 300w\" sizes=\"auto, (max-width: 378px) 100vw, 378px\" \/><figcaption class=\"wp-element-caption\">Relying Party Trusts Options.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"712\" height=\"262\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-21.png\" alt=\"\" class=\"wp-image-475\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-21.png 712w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-21-300x110.png 300w\" sizes=\"auto, (max-width: 712px) 100vw, 712px\" \/><figcaption class=\"wp-element-caption\">Add a trust<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We then are given a chance to import the Palo&#8217;s metadata.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"723\" height=\"371\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-22.png\" alt=\"\" class=\"wp-image-476\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-22.png 723w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-22-300x154.png 300w\" sizes=\"auto, (max-width: 723px) 100vw, 723px\" \/><figcaption class=\"wp-element-caption\">Import the Palo&#8217;s metadata<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Here I input the metadata file I generated on the Palo then allowed all access to finish off.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> The relying party  I named &#8216;Palo&#8217;  has the URL and public cert of the Palo in it&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"407\" height=\"284\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-24.png\" alt=\"\" class=\"wp-image-478\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-24.png 407w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-24-300x209.png 300w\" sizes=\"auto, (max-width: 407px) 100vw, 407px\" \/><figcaption class=\"wp-element-caption\">Who&#8217;s relying on us?<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"414\" height=\"217\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-25.png\" alt=\"\" class=\"wp-image-479\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-25.png 414w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-25-300x157.png 300w\" sizes=\"auto, (max-width: 414px) 100vw, 414px\" \/><figcaption class=\"wp-element-caption\">What&#8217;s their public signature?<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">OK, we&#8217;re not quite done. We need to tell the ADFS server what claims to send. We can stuff our assertion with no end of them but on this occasion we just want username so&#8230; we click on add &#8216;Claims Issuance Policy&#8217;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"723\" height=\"200\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-26.png\" alt=\"\" class=\"wp-image-482\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-26.png 723w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-26-300x83.png 300w\" sizes=\"auto, (max-width: 723px) 100vw, 723px\" \/><figcaption class=\"wp-element-caption\">LDAP Attribute<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"715\" height=\"356\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-27.png\" alt=\"\" class=\"wp-image-483\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-27.png 715w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-27-300x149.png 300w\" sizes=\"auto, (max-width: 715px) 100vw, 715px\" \/><figcaption class=\"wp-element-caption\">Getting assertive.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So this is what we send to the Palo. Now there&#8217;s one more thing I had to do to get this working and it you&#8217;re troubleshooting in a none-Production environment this may be worth doing anyway.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I ran the following command on the ADFS server where &#8216;Palo&#8217; was the name of the relying party.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>set-ADFSRelyingPartyTrust \u2013TargetName Palo \u2013EncryptClaims $False<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As you might gather this means that the assertions that the ADFS sends to the Palo are not encrypted with the Palo&#8217;s public key of the <strong>vpn.badtinker.net <\/strong>certificate. You can still seem these claims if they are encrypted  (if you have the private key) by using an online tool but this exposes the key to a third party. I will perhaps go into this a little deeper in subsquent post.  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Anyway, let&#8217;s give this a try. We&#8217;ll browse to the Palo&#8217;s GUI on <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"419\" height=\"418\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/Palo-Signon.png\" alt=\"\" class=\"wp-image-486\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/Palo-Signon.png 419w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/Palo-Signon-300x300.png 300w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/Palo-Signon-150x150.png 150w\" sizes=\"auto, (max-width: 419px) 100vw, 419px\" \/><figcaption class=\"wp-element-caption\">The Palo&#8217;s front door.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Choose &#8216;Use Single Sign-On&#8217; and then input the SAML Administrator we created earlier (it&#8217;s case sensitive):<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"415\" height=\"423\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-31.png\" alt=\"\" class=\"wp-image-489\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-31.png 415w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-31-294x300.png 294w\" sizes=\"auto, (max-width: 415px) 100vw, 415px\" \/><figcaption class=\"wp-element-caption\">Who goes there?<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This will re-direct us to our ADFS server on<strong> https:\/\/fs.labtinker.net<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"284\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-33-1024x284.png\" alt=\"\" class=\"wp-image-491\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-33-1024x284.png 1024w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-33-300x83.png 300w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-33-768x213.png 768w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-33-1536x426.png 1536w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-33.png 1917w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Re-direct to the ADFS<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">and here we sign in using our labtinker domain account:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"510\" height=\"261\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-34.png\" alt=\"\" class=\"wp-image-492\" style=\"width:510px;height:261px\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-34.png 510w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-34-300x154.png 300w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><figcaption class=\"wp-element-caption\">Authenticate to the domain.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">On a successful authentication this will re-direct back to Palo with the correct assertion.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"953\" height=\"332\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-36.png\" alt=\"\" class=\"wp-image-494\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-36.png 953w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-36-300x105.png 300w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-36-768x268.png 768w\" sizes=\"auto, (max-width: 953px) 100vw, 953px\" \/><figcaption class=\"wp-element-caption\">SAML authenticated Admin session<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"745\" height=\"160\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-35.png\" alt=\"\" class=\"wp-image-493\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-35.png 745w, http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/02\/image-35-300x64.png 300w\" sizes=\"auto, (max-width: 745px) 100vw, 745px\" \/><figcaption class=\"wp-element-caption\">System logs on the Palo.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Next post I&#8217;ll dig a little bit more into what&#8217;s going on and demonstrate a couple of SAML tools.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My aim in this post is to get administrator access to a Palo Alto firewall using SAML authentication. The theory of this proccess is well-documented. Here is a explanation of it from Palo themselves: https:\/\/knowledgebase.paloaltonetworks.com\/KCSArticleDetail?id=kA10g000000ClVvCAK In summary, SAML allows federated authentication: basically we have a service provider (SP) and an identity provider (IdP) who trust [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-437","post","type-post","status-publish","format-standard","hentry","category-authentication"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/18.135.13.153\/index.php?rest_route=\/wp\/v2\/posts\/437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/18.135.13.153\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/18.135.13.153\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/18.135.13.153\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/18.135.13.153\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=437"}],"version-history":[{"count":0,"href":"http:\/\/18.135.13.153\/index.php?rest_route=\/wp\/v2\/posts\/437\/revisions"}],"wp:attachment":[{"href":"http:\/\/18.135.13.153\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/18.135.13.153\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=437"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/18.135.13.153\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}