Skip to content

Instantly share code, notes, and snippets.

View DiegoCaridei's full-sized avatar

DiegoCaridei DiegoCaridei

View GitHub Profile
@DiegoCaridei
DiegoCaridei / PowerView-3.0-tricks.ps1
Created December 7, 2021 15:00 — forked from HarmJ0y/PowerView-3.0-tricks.ps1
PowerView-3.0 tips and tricks
# PowerView's last major overhaul is detailed here: http://www.harmj0y.net/blog/powershell/make-powerview-great-again/
# tricks for the 'old' PowerView are at https://gist.github.com/HarmJ0y/3328d954607d71362e3c
# the most up-to-date version of PowerView will always be in the dev branch of PowerSploit:
# https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/PowerView.ps1
# New function naming schema:
# Verbs:
# Get : retrieve full raw data sets
# Find : ‘find’ specific data entries in a data set
@DiegoCaridei
DiegoCaridei / PowerView-3.0-tricks.ps1
Created December 7, 2021 15:00 — forked from HarmJ0y/PowerView-3.0-tricks.ps1
PowerView-3.0 tips and tricks
# PowerView's last major overhaul is detailed here: http://www.harmj0y.net/blog/powershell/make-powerview-great-again/
# tricks for the 'old' PowerView are at https://gist.github.com/HarmJ0y/3328d954607d71362e3c
# the most up-to-date version of PowerView will always be in the dev branch of PowerSploit:
# https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/PowerView.ps1
# New function naming schema:
# Verbs:
# Get : retrieve full raw data sets
# Find : ‘find’ specific data entries in a data set
@DiegoCaridei
DiegoCaridei / mkpsrevshell.py
Created June 25, 2021 14:25 — forked from tothi/mkpsrevshell.py
reverse PowerShell cmdline payload generator (base64 encoded)
#!/usr/bin/env python3
#
# generate reverse powershell cmdline with base64 encoded args
#
import sys
import base64
def help():
print("USAGE: %s IP PORT" % sys.argv[0])
#include <stdio.h>
#include <unistd.h>
int overflow () {
char buffer [500];
int userinput;
userinput =read(0, buffer,700);
printf("\nUser provided %d bytes. Buffer content is %s\n", userinput, buffer);
return 0;
}
@DiegoCaridei
DiegoCaridei / iosdebugdetect.cpp
Created August 7, 2019 12:59 — forked from joswr1ght/iosdebugdetect.cpp
Sample code to use ptrace() through dlsym on iOS to terminate when a debugger is attached. NOT FOOLPROOF, but it bypasses Rasticrac decryption.
// Build on OS X with:
// clang debugdetect.cpp -o debugdetect -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/ -miphoneos-version-min=7
#import <dlfcn.h>
#import <sys/types.h>
#import <stdio.h>
typedef int (*ptrace_ptr_t)(int _request, pid_t _pid, caddr_t _addr, int _data);
void disable_dbg() {
ptrace_ptr_t ptrace_ptr = (ptrace_ptr_t)dlsym(RTLD_SELF, "ptrace");
ptrace_ptr(31, 0, 0, 0); // PTRACE_DENY_ATTACH = 31
}
@DiegoCaridei
DiegoCaridei / drozer_setup.sh
Created July 29, 2019 16:07 — forked from kristovatlas/drozer_setup.sh
Instructions for setting up drozer in MacOS 10.11 "El Capitan"
#Based on https://blog.ropnop.com/installing-drozer-on-os-x-el-capitan/
#Install recent python 2 and viritualenvwrapper
brew install python
brew upgrade python
pip install virtualenvwrapper
#At this point if you try to run mkvirtualenv, you'll get an error message. To resolve, follow the instructions indicated in /usr/local/bin/virtualenvwrapper.sh. In my current copy, they are:
# 1. Create a directory to hold the virtual environments.
# (mkdir $HOME/.virtualenvs).
function Invoke-UACBypass {
<#
.SYNOPSIS
Bypasses UAC on Windows 10 by abusing the SilentCleanup task to win a race condition, allowing for a DLL hijack without a privileged file copy.
Author: Matthew Graeber (@mattifestation), Matt Nelson (@enigma0x3)
License: BSD 3-Clause
Required Dependencies: None
Optional Dependencies: None
@DiegoCaridei
DiegoCaridei / Orange-Turtle.py
Created January 17, 2019 13:52 — forked from schafon/Orange-Turtle.py
Script for Orange-Turtle - basic commands made easy for beginners
#!/usr/bin/python3
# Version 1.1
import cow_say_function
import check_install
import network_sniffer
import open_port_check
import settings
from mac_changer import *
@DiegoCaridei
DiegoCaridei / enum.sh
Created December 13, 2018 17:20 — forked from unfo/enum.sh
Linux priv esc. Might be out-dated script versions
#!/bin/bash
BLACK="\033[30m"
RED="\033[31m"
GREEN="\033[32m"
YELLOW="\033[33m"
BLUE="\033[34m"
PINK="\033[35m"
CYAN="\033[36m"
WHITE="\033[37m"

A few tips for OSCP

  1. Doing all of the exercises is important since you will discover low-hanging fruit from the labs based on the recon you do with the different tools in the exercises.
  2. Be wary of doing full /24 range port scans, especially for anything more than a few TCP ports. The machines might be in all sorts of broken states left by students etc.
  3. When starting to recon a specific machine:
  • Revert
  • Port scan
  • Try to identify services

Those steps in that order are important. You want a fresh state for the machine and you want to do just simple port scanning first because doing nmap's service scanning or nse scripts might send payloads that actually crash services. So be careful.