Skip to content

Instantly share code, notes, and snippets.

@jtgasper3
jtgasper3 / run.csx
Created September 6, 2023 20:58
Azure Function for MDM Client Cert validation
#r "Newtonsoft.Json"
#r "System.Formats.Asn1"
using System.Formats.Asn1;
using System.Net;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;
@jtgasper3
jtgasper3 / Falcon.ps1
Created April 26, 2022 21:52
Impersonate CrowdStrike
Set-WmiInstance -Namespace "root\SecurityCenter2" -Class AntivirusProduct -Argument @{displayName="CrowdStrike Falcon Sensor";instanceGuid="{8FE1C46C-23A5-9999-A73E-DAABB9E7B3CD}";pathToSignedProductExe="%ProgramFiles%\CrowdStrike\CSFalconController.exe";pathToSignedReportingExe="C:\Program Files\CrowdStrike\CSFalconService.exe";productState="266240";timestamp="Tue, 08 Feb 2022 15:42:15 GMT"}
@jtgasper3
jtgasper3 / docker-training-labs.md
Last active June 27, 2019 21:09
Docker Training Labs

Hello World

Objective: This is a basic container used to ensure that Docker is installed and working.

  1. Run the container: docker container run -it hello-world

    -it allows the terminal to send and receive text to/from the container.

This should have returned some text.

Verifying my Blockstack ID is secured with the address 1MAULXVaW5vBYZKjj939cgpUoJdrpDuoNZ https://explorer.blockstack.org/address/1MAULXVaW5vBYZKjj939cgpUoJdrpDuoNZ
@jtgasper3
jtgasper3 / gist:7d8589ab936416ac0295
Created March 9, 2016 21:21
CAS encryption keys.md
<https://github.com/mitreid-connect/json-web-key-generator>
encryption key:
``` java -jar json-web-key-generator-0.3-SNAPSHOT-jar-with-dependencies.jar -t oct -s 256```:
```
Full key:
{
"kty": "oct",
@jtgasper3
jtgasper3 / clean.sh
Created November 24, 2015 18:21
Docker Host Cleanup
docker rm -v $(docker ps -a -q -f status=exited)
docker rmi $(docker images -f "dangling=true" -q)
@jtgasper3
jtgasper3 / clearPassSuccess.jsp
Created June 18, 2015 04:28
ClearPass Debugging
<%@ page import="org.apache.log4j.Logger"%>
<%@ page session="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
Logger logger = Logger.getLogger( "org.jasig.cas.clearPassSuccess.jsp" );
logger.debug("clearpass: " + request.getAttribute("credentials"));
%><cas:clearPassResponse xmlns:cas='http://www.yale.edu/tp/cas'>
<cas:clearPassSuccess>
<cas:credentials>${fn:escapeXml(credentials)}</cas:credentials>
### Keybase proof
I hereby claim:
* I am jtgasper3 on github.
* I am jtgasper3 (https://keybase.io/jtgasper3) on keybase.
* I have a public key whose fingerprint is BB2F F64C CEA3 3C4C 5581 B070 1F60 9F58 BAFE E3EF
To claim this, I am signing this object:
@jtgasper3
jtgasper3 / index.jsp
Created October 29, 2014 23:50
Redirect Tomcat's ROOT page to CAS's login page
<% response.sendRedirect("/cas/login"); %>
@jtgasper3
jtgasper3 / casServiceValidationSuccess.jsp
Last active August 29, 2015 14:07
The lower half of the file with the attribute release code in place.
<%-- Begin Ldap Attributes --%>
<c:if test="${fn:length(assertion.chainedAuthentications) > 0}">
<cas:attributes>
<c:forEach var="auth" items="${assertion.chainedAuthentications}">
<c:forEach var="attr" items="${auth.principal.attributes}" >
<cas:${fn:escapeXml(attr.key)}>${fn:escapeXml(attr.value)}</cas:${fn:escapeXml(attr.key)}>
</c:forEach>
</c:forEach>
</cas:attributes>
</c:if>