Skip to content

Instantly share code, notes, and snippets.

@ypcrts
ypcrts / tmux_ignore_shell_startup.sh
Last active January 19, 2021 15:16
tmux server connection refused
#!/bin/sh
#
# If your shell is returning an error on initialization, it makes tmux-server di.
# This gist shows how to work around that. Googling shows that this happens to
# zsh users a lot.
#
# `autoload: command not found`
# `bashcompinit: command not found`
# `server_signal: Child exited`
# `connect failed: Connection refused`
@ypcrts
ypcrts / keepawake.ps1
Created January 12, 2021 16:03 — forked from jamesfreeman959/keepawake.ps1
A very simple PowerShell script to keep a Windows PC awake and make lync think the user is active on the keyboard
# Useful references:
#
# https://superuser.com/questions/992511/emulate-a-keyboard-button-via-the-command-line
# https://ss64.com/vb/sendkeys.html
# https://social.technet.microsoft.com/Forums/windowsserver/en-US/96b339e2-e9da-4802-a66d-be619aeb21ac/execute-function-one-time-in-every-10-mins-in-windows-powershell?forum=winserverpowershell
# https://learn-powershell.net/2013/02/08/powershell-and-events-object-events/
#
# Future enhancements - use events rather than an infinite loop
while (1) {
$wsh = New-Object -ComObject WScript.Shell
@ypcrts
ypcrts / windows_hardening.cmd
Created July 3, 2020 21:12 — forked from ricardojba/windows_hardening.cmd
A Windows hardening script
::###############################################################################################################
:: Credits and More info: https://gist.github.com/mackwage/08604751462126599d7e52f233490efe
:: https://github.com/LOLBAS-Project/LOLBAS
:: https://lolbas-project.github.io/
:: https://github.com/Disassembler0/Win10-Initial-Setup-Script
:: https://github.com/cryps1s/DARKSURGEON/tree/master/configuration/configuration-scripts
:: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1#file-reclaimwindows10-ps1-L71
:: https://github.com/teusink/Home-Security-by-W10-Hardening
::
::###############################################################################################################
@ypcrts
ypcrts / smb_is_compromised.ps1
Created March 14, 2020 20:31
Windows 10 Hardening - Powershell
# disable smb 1
Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol
# disable smb2 / smb3
Set-SmbServerConfiguration -EnableSMB2Protocol $false
@ypcrts
ypcrts / office365-scraper-distribution-list-to-csv.md
Last active February 26, 2020 19:32
Outlook Office 365 Distribution List to CSV Scraper

Office 365 office.com Distribution List Scraper using Browser console

This grabs the distribution list members and email addresses, outputting them as CSV

@ypcrts
ypcrts / distccd_rce_CVE-2004-2687.py
Created December 13, 2019 14:47 — forked from DarkCoderSc/distccd_rce_CVE-2004-2687.py
(CVE-2004-2687) DistCC Daemon - Command Execution (Python)
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
distccd v1 RCE (CVE-2004-2687)
This exploit is ported from a public Metasploit exploit code :
https://www.exploit-db.com/exploits/9915
@ypcrts
ypcrts / linkedin_attacker.js
Created November 7, 2019 18:03
LinkedIn name scraper
const j = new Set;
document.querySelectorAll('.actor-name').forEach(e => j.add(e.innerText));
document.querySelector('#ember2469').click();
@ypcrts
ypcrts / asp_webshell_source_exfil.py
Last active August 12, 2019 20:38
rsync for dot net // asp webshell exploited to download all files recursively
import requests
import os
import os.path
import re
# using fuzzdb webshell
# https://github.com/tennc/webshell/blob/master/fuzzdb-webshell/asp/cmd.aspx
shell_url = 'https://example.com/vulnerable'
cmd_output_re = re.compile(r'.*\<pre\>(.*)\</pre\>', re.DOTALL)
@ypcrts
ypcrts / linkedin_name_scrape.js
Last active June 3, 2019 15:20
LinkedIn Name Scraping
(function () {
var s = new Set();
document.querySelectorAll('.actor-name').forEach( e=> {
s.add(e.innerText)
});
console.log(s)
})()
@ypcrts
ypcrts / virtualhost_bruteforcer.go
Last active May 4, 2019 02:11
Golang HTTP virtual host bruteforcer, with concurrency
package main
import "net/http"
import "fmt"
import "io/ioutil"
import "bufio"
import "os"
// golang virtualhost bruteforcer with concurrency
func makeRequest(subdomain string) bool {