Skip to content

Instantly share code, notes, and snippets.

View eugenpirogoff's full-sized avatar
🖖
making

Eugen Pirogoff eugenpirogoff

🖖
making
View GitHub Profile
@justin
justin / sim.zsh
Last active January 18, 2023 20:21
Convenience wrapper around the simctl command to perform operations related to iOS simulators.
#!/usr/bin/env zsh
#
# Convenience wrapper around the simctl command to perform operations related to iOS simulators.
# Author: Justin Williams (@justin)
#
# Usage: sim <options> <subcommand>
#
# This script is designed to work with ZSH. ymmv with other shells.
set -e
@ole
ole / DateFormatting.swift
Created June 18, 2021 19:27
ISO8601 date formatting in Foundation in iOS 15/macOS 12
import Foundation
let date = Date.now
date.formatted(.iso8601) // "20210618T191800Z"
date.formatted(.iso8601.year().month().day().dateSeparator(.dash)) // "2021-06-18"
date.formatted(.iso8601.dateSeparator(.dash).timeSeparator(.colon)) // "2021-06-18T19:18:00Z"
extension UIHostingController {
convenience public init(rootView: Content, ignoreSafeArea: Bool) {
self.init(rootView: rootView)
if ignoreSafeArea {
disableSafeArea()
}
}
func disableSafeArea() {
@SwitHak
SwitHak / 20200114-TLP-WHITE_CVE-2020-0601.md
Last active February 9, 2024 14:42
BlueTeam CheatSheet * CVE-2020-0601 * crypt32.dll | Last updated: 2020-01-21 1817 UTC

CVE-2020-0601 AKA ChainOfFools OR CurveBall

General

  • Microsoft disclosed a vulnerability in their monthly Patch Tuesday referenced under CVE-2020-0601.
  • The vulnerability was discovered by the U.S. National Security Agency, anounced today (2020-01-14) in their press conference, followed by a blog post and an official security advisory.
  • The flaw is located in the "CRYPT32.DLL" file under the C:\Windows\System32\ directory.

Vulnerability explanation

  • NSA description:
  • NSA has discovered a critical vulnerability (CVE-2020-0601) affecting Microsoft Windows® cryptographic functionality.
@saelo
saelo / writeup.md
Last active February 21, 2023 14:37
Writeup for the "Dezhou Instrumentz" challenge from the Real World CTF Qualifier 2019

Dezhou Instrumentz

The challenge consisted of an iOS app (Calc.app) which implemented a simple calculator. Moreover, the app also registered a custom URL scheme (icalc://) which would simply evaluate the content of the URL. The calculator was implemented using NSExpressions and the input string would simply be parsed as such an expression and executed. NSExpressions are pretty powerful and allow for example calls to ObjC Methods (e.q. typing in sqrt(42) would end up calling +[_NSPredicateUtilities sqrt:@42]). Further, there are two interesting helper functions available in NSExpressions:

FUNCTION(obj, 'foo', "bar")

Which will result in a call of the method 'foo' on object obj with parameter "bar" (an NSString).

@standinga
standinga / Swift Playground Audio playing audio files with AVAudioPlayerNode on top of AVPlayer or on top of another AVAudioPlayerNode.swift
Last active October 31, 2023 07:33
Swift Playground Audio playing audio files with AVAudioPlayerNode on top of AVPlayer or on top of another AVAudioPlayerNode
import AVFoundation
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
class AudioPlayer {
var topAudioFiles: [AVAudioFile] = []
var engine:AVAudioEngine
var backgroundAudioNode: AVAudioPlayerNode
var backgroundAudioFile: AVAudioFile
@standinga
standinga / AudioPlayground.swift
Last active March 22, 2023 14:06
Swift Playground shows how to play multiple wav files on top of background audio file, using AVAudioPlayerNode, AVAudioMixerNode, AVAudioEngine
import AVFoundation
import UIKit
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
class AudioPlayer {
var backgroundAudioFile:AVAudioFile
var topAudioFiles: [AVAudioFile] = []
@fs0c131y
fs0c131y / get_sqlcipher_password.js
Created January 27, 2019 20:57
Frida script to get the password of a sqlcipher database
/*
* get_sqlcipher_password.js
* Copyright (c) 2019 Elliot Alderson <fs0c131y@protonmail.com>
*
* Frida.re JS functions to get SQLCipher database passwords.
*
* Example usage:
* # frida -U -f in.gov.uidai.mAadhaarPlus -l get_sqlcipher_password.js --no-pause
*
*/
@DerekSelander
DerekSelander / dsresign
Last active April 16, 2023 02:26
Resign iOS .app directories, expects app dir, provisioning profile, [optional] new name for iOS app
#!/bin/bash
# MIT License
#
# Copyright (c) 2018 Derek Selander (@LOLgrep)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@shaps80
shaps80 / Scheduling-AppDelegate.swift
Last active February 16, 2022 03:14
NSNotification Scheduling Service in Swift. (the only required file is `SchedulingService.swift`)
//
// AppDelegate.swift
// Scheduling
//
// Created by Shaps Benkau on 19/02/2018.
// Copyright © 2018 152percent Ltd. All rights reserved.
//
import UIKit