Skip to content

Instantly share code, notes, and snippets.

View elreydetoda's full-sized avatar

elreydetoda

View GitHub Profile
@dan4thewin
dan4thewin / bash4thewin.md
Last active April 27, 2025 20:20
Bash idioms and tools

This page collects a set of bash scripting idioms and tools for easy reference.

Improved Error Detection: set -e and set -u

With -e (errexit), bash exits immediately if an unchecked command exits with a nonzero value. A checked command is part of a while, until, if, elif, or an expression with && or ||. Everything else is unchecked. For a pipeline, only the last command is considered. Adding "or no-op", || :, ensures a command is safe, e.g., do-something | grep 'may_not_match' || :. NB. Calling a bash function in a checked context effectively disables -e for all commands in the function. Use the optional shellcheck, check-set-e-suppressed, to alert on this.

###################################### Will Schroeder (@harmj0y) #######################################
S4U2Pwnage
http://www.harmj0y.net/blog/activedirectory/s4u2pwnage/
A Guide to Attacking Domain Trusts
https://www.harmj0y.net/blog/redteaming/a-guide-to-attacking-domain-trusts/
Another Word on Delegation
https://www.harmj0y.net/blog/redteaming/another-word-on-delegation/
@FilBot3
FilBot3 / 00_README.md
Last active December 3, 2024 23:54
Trying to use VSCode from a Flatpak using Podman-Remote to connect to Host to use DevContainers
@benpturner
benpturner / EventLogSearcher.cs
Last active March 6, 2024 09:50
Threaded EventLogSearcher for 4624 events
using System;
using System.Collections.Generic;
using System.Diagnostics.Eventing.Reader;
using System.Text.RegularExpressions;
using System.Threading;
namespace EventLogSearcher
{
class Program
{
@mgraeber-rc
mgraeber-rc / CS_Beacon_TEARDROP_Config.json
Created December 22, 2020 16:23
Extracted Cobalt Strike Beacon config for 3cfbf519913d703a802423e6e3fb734abf8297971caccc7ae45df172196b6e84 from this post: https://research.checkpoint.com/2020/sunburst-teardrop-and-the-netsec-new-normal/
{
"BeaconType": [
"HTTPS"
],
"Port": 443,
"SleepTime": 5000,
"MaxGetSize": 1049611,
"Jitter": 99,
"MaxDNS": 255,
"C2Server": "static.rennorigroup.com,/api/v1/meemes/latest",
@mubix
mubix / Get-CSharp.ps1
Created November 30, 2020 05:13
Powershell Get-CSharp
function Get-CSharpProcess {
$proclist = Get-Process
foreach($proc in $proclist) {
foreach($mod in $proc.Modules)
{
if($mod.ModuleName -imatch "mscoree")
{
Write-Output(".NET Found in:`t" + $proc.Name)
}
}
@HarmJ0y
HarmJ0y / Jenkinsfile
Created November 2, 2020 23:15
Rubeus Jenkinsfile
@Library('ci-jenkins-common') _
// Jenkins build pipeline (declarative)
// Project: Seatbelt
// URL: https://github.com/GhostPack/Seatbelt
// Author: @tifkin_/@harmj0y
// Pipeline Author: harmj0y
def gitURL = "https://github.com/GhostPack/Seatbelt"
@nil0x42
nil0x42 / github_badge_makers.md
Last active October 25, 2020 16:35
Awesome Project Badge Generators
pulp_default_admin_password: password
pulp_install_source: pip
pulp_settings:
secret_key: secret
content_origin: "https://{{ inventory_hostname }}"
x_pulp_api_host: 127.0.0.1
x_pulp_api_port: 24817
x_pulp_api_user: "admin"
x_pulp_api_password: "{{ pulp_default_admin_password }}"
x_pulp_api_prefix: "pulp_ansible/galaxy/automation-hub/api"
  • SC1000 $ is not used specially and should therefore be escaped.
  • SC1001 This \o will be a regular 'o' in this context.
  • SC1003 Want to escape a single quote? echo 'This is how it'\''s done'.
  • SC1004 This backslash+linefeed is literal. Break outside single quotes if you just want to break the line.
  • SC1007 Remove space after = if trying to assign a value (or for empty string, use var='' ... ).
  • SC1008 This shebang was unrecognized. ShellCheck only supports sh/bash/dash/ksh. Add a 'shell' directive to specify.
  • SC1009 The mentioned parser error was in ...
  • SC1010 Use semicolo