Skip to content

Instantly share code, notes, and snippets.

@0xsha
0xsha / Solarwinds_Orion_LFD.py
Last active September 24, 2024 05:28
Solarwinds_Orion_LFD local file disclosure PoC for SolarWinds Orion aka door to SuperNova?)
# CVE-2020-10148 (local file disclosure PoC for SolarWinds Orion aka door to SuperNova ? )
# @0xSha
# (C) 2020 0xSha.io
# Advisory : https://www.solarwinds.com/securityadvisory
# Mitigation : https://downloads.solarwinds.com/solarwinds/Support/SupernovaMitigation.zip
# Details : https://kb.cert.org/vuls/id/843464
# C:\inetpub\SolarWinds\bin\OrionWeb.DLL
# According to SolarWinds.Orion.Web.HttpModules
@haginara
haginara / mongo_ipv4_codes.py
Created May 1, 2020 17:41
Mongo Custom IP Field for PyMongo
import ipaddress
from bson.codec_options import TypeCodec
from bson.codec_options import TypeRegistry
from bson.codec_options import CodecOptions
from bson.int64 import Int64
class IPv4Codec(TypeCodec):
python_type = ipaddress.IPv4Address
bson_type = Int64
def transform_python(self, value):
@haginara
haginara / dns_over_https.go
Created February 27, 2020 23:59
Example code to query dns to cloudflare-dns.com
package main
import (
"encoding/json"
"log"
"fmt"
"net/http"
)
type DNSQuestion struct {
@haginara
haginara / msrc.py
Last active May 14, 2024 17:13
Getting Microsoft Security Update from api.msrc.microsoft.com via Python
# coding: utf-8
from dataclasses import dataclass, asdict, field
from typing import Dict, List, Optional
import pprint
import json
try:
import requests
except ImportError:
raise SystemExit("Please install 'requests' first")
@haginara
haginara / audit-ioctl-osx.py
Created November 19, 2019 22:59
IOCTLs for OSX Audit
#from ioctl_opt import IOC, IO, IOC_READ, IOC_WRITE, IOR, IOW
from fcntl import ioctl
import ctypes
#https://github.com/apple/darwin-xnu/blob/0a798f6738bc1db01281fc08ae024145e84df927/bsd/security/audit/audit_ioctl.h
#/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/ioccom.h
AUDITPIPE_IOBASE = ord('A')
AUDITSDEV_IOBASE = ord('S')
##========================================================================================================================
#@(#)ioccom.h 8.2 (Berkeley) 3/28/94
@haginara
haginara / timeconvert.py
Created October 8, 2019 20:29
Converting timetstamp between diffract timezones.
import time
from datetime import datetime, timedelta
# pip install pytz is required.
from pytz import timezone
import pytz
import os
import sys
import argparse
@haginara
haginara / zeek-cut.py
Last active September 27, 2019 23:07
zee-cut script with python3
#!/usr/bin/env python3
import os
import sys
import csv
import json
import logging
import pprint
import time
@Omar-Ikram
Omar-Ikram / EndpointSecurityDemo.m
Last active October 16, 2024 10:15
A demo of using Apple's EndpointSecurity framework - tested on macOS Monterey 12.2.1 (21D62)
//
// 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)
@victorabraham
victorabraham / EmailUtility.java
Created August 13, 2015 04:46
Apex class to send email
public class EmailUtility{
public Boolean sendEmail(String emailTo, String emailCC, String emailSubject, String emailBody){
//Flag to track whether email is sent successfully
Boolean isSuccess = false;
//Body of attachment in email. It can be replaced with standard sf attachment
Blob body = Blob.valueOf('Sample Body for email attachment');
//Creating email attachmentattachment specifying content type and file name
Messaging.EmailFileAttachment attach = new Messaging.EmailFileAttachment();
@joshbode
joshbode / LICENSE.md
Last active August 1, 2024 20:37
YAML Loader with include constructor (Python 3)

MIT License

Copyright (c) 2018 Josh Bode

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 copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: