Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am arnydo on github.
  • I am arnydo (https://keybase.io/arnydo) on keybase.
  • I have a public key ASAlcTCYaTLfzRAPC9Msy_g5D9OMs88Gt0XrjjttGGXI2Qo

To claim this, I am signing this object:

@arnydo
arnydo / check-dehashed.ps1
Last active September 19, 2019 19:46
Quickly check domain breaches against DeHashed
function check-dehashed ($dom) {
$url = "https://dehashed.com/search?query=%22{0}%22" -f $dom
($(iwr $url).AllElements | ?{$_.class -eq "d-block text _500"})[0] | select @{name="Domain";E={$dom}},@{Name="Results";E={[int]$_.InnerText}}
}
magnet:?xt=urn:btih:827FBFFA925AF95BA20C7C0BA8D35807C1E31C75&dn=Combined_HaveIBeenPwnedWordlists.txt&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.opentrackr.org%3a1337%2fannounce
@arnydo
arnydo / OrphanAdminSDHolder.ps1
Created April 12, 2021 20:18 — forked from webash/OrphanAdminSDHolder.ps1
Detect and correct orphaned 'adminCount=1' users who are no longer in protected groups
<#
.SYNOPSIS
Detects Orphaned SD Admin users, resets admin count attribute and enables inheritable permissions
.Author
Alan.McBurney (+ Ashley Steel)
THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE
RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.
@arnydo
arnydo / aes-test.ps1
Created May 17, 2021 20:26
aes-test.ps1
Write-Host ""
Write-Host " ___ _ _ _ ___ ___ ___ __ _____ _ _ " -ForegroundColor Yellow
Write-Host "| \ /_\ | \| |/ __| __| _ \ \ \ / /_ _| | | | " -ForegroundColor Yellow
Write-Host "| |) / _ \| . ` | (_ | _|| / \ \/\/ / | || |__| |__ " -ForegroundColor Yellow
Write-Host "|___/_/_\_\_|\_|\___|___|_|_\___\_/\_/ |___|____|____|" -ForegroundColor Yellow
Write-Host "| _ \/ _ \| _ )_ _| \| / __|/ _ \| \| | " -ForegroundColor Yellow
Write-Host "| / (_) | _ \| || . ` \__ \ (_) | .` | " -ForegroundColor Yellow
Write-Host "|_|_\\___/|___/___|_|\_|___/\___/|_|\_| " -ForegroundColor Yellow
Write-Host "THIS WILL ENCRYPT FILES! FOR REALZ! YOU HAVE BEEN WARNED!" -ForegroundColor Green
Write-Host ""
@arnydo
arnydo / Get-GPOName.ps1
Created May 26, 2021 20:39
Get Friendly Name of a GPO from its GUID
function Get-GPOName {
[Cmdletbinding()]
param (
[Parameter(Mandatory)]
[string]$GUID
)
$CN = ‘CN={0}’ -f $GUID
(New-Object DirectoryServices.DirectorySearcher -Property @{Filter = $CN }).FindOne().properties.displayname
@arnydo
arnydo / Invoke-CarnaryToken.ps1
Created June 23, 2021 18:10
Quickly generate CararyTokens with Powershell
function New-CanaryPDF {
param (
[string]$ThreatActor,
[string]$NotifyEmail
)
Invoke-RestMethod -Uri "https://canarytokens.org/generate" `
-Method "POST" `
-ContentType "multipart/form-data; boundary=----WebKitFormBoundaryKLrj8QtQRBMCWR38" `
-Body ([System.Text.Encoding]::UTF8.GetBytes("------WebKitFormBoundaryKLrj8QtQRBMCWR38$([char]13)$([char]10)Content-Disposition: form-data; name=`"type`"$([char]13)$([char]10)$([char]13)$([char]10)adobe_pdf$([char]13)$([char]10)------WebKitFormBoundaryKLrj8QtQRBMCWR38$([char]13)$([char]10)Content-Disposition: form-data; name=`"email`"$([char]13)$([char]10)$([char]13)$([char]10)$($notifyEmail)$([char]13)$([char]10)------WebKitFormBoundaryKLrj8QtQRBMCWR38$([char]13)$([char]10)Content-Disposition: form-data; name=`"webhook`"$([char]13)$([char]10)$([char]13)$([char]10)$([char]13)$([char]10)------WebKitFormBoundaryKLrj8QtQRBMCWR38$([char]13)$([char]10)Content-Disposition: form-data; name=`"fmt`"$([char]13)$([char]10)$([char]1
@arnydo
arnydo / click-all-the-onions.js
Created July 12, 2021 13:02
Snippet to click all onion links on a page
var links = document.links
for (let i = 0; i < links.length; i++) {
if (links[i].origin.match(/onion/gi)){
links[i].click();
}
}
from fastapi import Security, Depends, FastAPI, HTTPException
from fastapi.security.api_key import APIKeyQuery, APIKeyCookie, APIKeyHeader, APIKey
from fastapi.openapi.docs import get_swagger_ui_html
from fastapi.openapi.utils import get_openapi
from starlette.status import HTTP_403_FORBIDDEN
from starlette.responses import RedirectResponse, JSONResponse
API_KEY = "1234567asdfgh"
API_KEY_NAME = "access_token"