This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script created by Vince Hunter | |
# Script updated by Chris Lawson 9/23/21 | |
### This allows the administrator password to be called, and used in the script where sudo is required | |
### Beware: the inputted password is used in echo commands | |
### Usage: Use `sudo` without a path to ensure the `sudo` function is called rather than the actual command | |
# Dialog Title |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* m1cat: a proof of concept for the M1RACLES vulnerability in the Apple M1. | |
* | |
* This program implements a covert channel that can be used to transmit data | |
* between two processes when run on the Apple Silicon "M1" CPUs. | |
* | |
* The channel is slightly lossy due to (presumably) the scheduler sometimes | |
* scheduling us on the wrong CPU cluster, so this PoC sends every byte twice | |
* together with some metadata/framing bits, which is usually good enough. | |
* A better approach would be to use proper FEC or something like that. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum SPErrors: Error { | |
case inputStringWasEmpty | |
} | |
struct StringPublisher: Publisher { | |
typealias Output = [Character] | |
typealias Failure = Error | |
private let data: [Character] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
preferredNetwork="$1" | |
securityType="$2" | |
| |
# For securityType, | |
# use OPEN for none, | |
# WPA for WPA Personal, | |
# WPA2 for WPA2 Personal, | |
# WPA/WPA2 for WPA/WPA2 Personal, | |
# WPAE for WPA Enterprise, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.m | |
// EndpointSecurityDemo | |
// | |
// Created by Omar Ikram on 17/06/2019 - macOS Catalina 10.15 Beta 1 (19A471t) | |
// Updated by Omar Ikram on 15/08/2019 - macOS Catalina 10.15 Beta 5 (19A526h) | |
// Updated by Omar Ikram on 01/12/2019 - macOS Catalina 10.15 (19A583) | |
// Updated by Omar Ikram on 31/01/2021 - macOS Big Sur 11.1 (20C69) | |
// Updated by Omar Ikram on 07/05/2021 - macOS Big Sur 11.3.1 (20E241) | |
// Updated by Omar Ikram on 04/07/2021 - macOS Monterey 12 Beta 2 (21A5268h) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Asymmetric.swift | |
// | |
// Created by David Hoerl on 12/23/18. | |
// Copyright © 2018 David Hoerl. All rights reserved. | |
// | |
/* | |
This is the portion you need in the distributed app, which uses the public key that can appear in plain text | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
private func gainPermissions() { | |
var authorizationRef: AuthorizationRef? = nil | |
var authItem = AuthorizationItem(name: kSMRightBlessPrivilegedHelper, valueLength: 0, value: nil, flags: 0) | |
var authRights = AuthorizationRights(count: 1, items: &authItem) | |
let flags: AuthorizationFlags = [.interactionAllowed, .preAuthorize, .extendRights] | |
var environment = AuthorizationEnvironment() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
################################################################################### | |
## Create a pwpolicy XML file based upon variables and options included below. | |
## Policy is applied and then file gets deleted. | |
## Use "sudo pwpolicy -u <user> -getaccountpolicies" | |
## to see it, and "sudo pwpolicy -u <user> -clearaccountpolicies" to clear it. | |
## | |
## Tested on: OS X 10.10 10.11 10.12 | |
#################################################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
'''amfid_patch.py - Pedro José Pereira Vieito © 2016 | |
This script can patch macOS 10.12.2 amfid daemon on memory | |
to allow arbitrary entitlements in Developer ID signed binaries. | |
Killing amfid will make the patch disapear: | |
$ sudo kill -9 `pgrep amfid` | |
You must run the script as a root (sudo) and with SIP disabled. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: # How to retrieve a host name and associated aliases from an IP address using Core Fondation's `CFHost` in Swift 3 | |
import Foundation | |
import PlaygroundSupport | |
//: In order to get the callback working we use a simple class to implement the showcase. | |
class DNSResolve { | |
//: The IP address may be a Swift `String` thanks to the toll-free bridging to C strings. | |
let ip: String = "17.172.224.47" | |
//: We use an optional `CFHost` variable because CFHost neither comes with an initializer nor is conforming to the Nullable protocol. | |
var host: CFHost? | |
//: We use this array of `String`s to store the resolved host names. |
NewerOlder