Skip to content

Instantly share code, notes, and snippets.

View gozes's full-sized avatar

Juan A. Sanchez gozes

View GitHub Profile

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.

How to pass the OSCP

  1. Recon
  2. Find vuln
  3. Exploit
  4. Document it

Recon

Unicornscans in cli, nmap in msfconsole to help store loot in database.

@gozes
gozes / sshclient.py
Created June 16, 2016 19:48 — forked from grugq/sshclient.py
twisted ssh client (based on conch.py) with an embedded cmd.Cmd shell for controllng the SSH session
from twisted.internet import reactor, defer, endpoints, task, stdio
from twisted.conch.client import default, options, direct
from twisted.conch.error import ConchError
from twisted.conch.ssh import session, forwarding, channel
from twisted.conch.ssh import connection, common
from twisted.python import log, usage
import signal
import tty
import struct
import fcntl
@gozes
gozes / Logging.hs
Created April 25, 2016 11:08 — forked from queertypes/Logging.hs
Simple, context-rich logging module in Haskell
module API.Logging (
-- * Initialize
mkLog,
-- * Context, Types
Context(..),
Method(..),
Log,
-- * Logging
@gozes
gozes / keystone.h
Created April 22, 2016 17:38 — forked from aquynh/keystone.h
/* Keystone Assembler Engine (www.keystone-engine.org) */
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2016 */
#ifndef KEYSTONE_ENGINE_H
#define KEYSTONE_ENGINE_H
#ifdef __cplusplus
extern "C" {
#endif
@gozes
gozes / WinKeyLog.py
Created November 26, 2015 14:20 — forked from hugsy/WinKeyLog.py
Cheap Windows userland keylogger
"""
Simple UserLand Keylogger for Windows
Based on pyHook.
@_hugsy_
"""
import sys
from ctypes import *
try:
echo -----BEGIN CERTIFICATE----- > encoded.txt
echo Just Base64 encode your binary data
echo TVoAAA== >> encoded.txt
echo -----END CERTIFICATE----- >> encoded.txt
certutil -decode encoded.txt decoded.bin
@gozes
gozes / lib.rs
Last active August 29, 2015 14:23 — forked from ucarion/lib.rs
/Users/ulyssecarion/rust/sparsile/src/lib.rs:7:9: 13:10 error: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
/Users/ulyssecarion/rust/sparsile/src/lib.rs:7 State {
/Users/ulyssecarion/rust/sparsile/src/lib.rs:8 runState: |firstState| {
/Users/ulyssecarion/rust/sparsile/src/lib.rs:9 let (result, nextState) = (self.runState)(firstState);
/Users/ulyssecarion/rust/sparsile/src/lib.rs:10
/Users/ulyssecarion/rust/sparsile/src/lib.rs:11 (f(result).runState)(nextState)
/Users/ulyssecarion/rust/sparsile/src/lib.rs:12 }
...
/Users/ulyssecarion/rust/sparsile/src/lib.rs:6:65: 14:6 note: first, the lifetime cannot outlive the block at 6:64...
/Users/ulyssecarion/rust/sparsile/src/lib.rs:6 fn and_then<B>(&self, f: |A| -> State<S, B>) -> State<S, B> {
@gozes
gozes / rob.go
Last active August 29, 2015 14:11 — forked from Jxck/rob.go
type errWriter struct {
w io.Writer
err error
}
func (e *errWriter) Write(p []byte) {
if e.err != nil {
return
}
_, e.err = e.w.Write(p)
@gozes
gozes / news.py
Last active August 29, 2015 14:06 — forked from wirewc/news.py
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
"""This reads the news for google news."""
import feedparser,requests,json,urllib,urllib2
tech = """https://news.google.com/news/section?pz=1&cf=all&ned=us&hl=en&topic=tc&output=rss"""
archNewsUrl = """https://www.archlinux.org/feeds/news/"""
hadUrl = """http://feeds2.feedburner.com/hackaday/LgoM"""
mlvUrl= """http://makelehighvalley.com/blog/feed/"""
h76Url = """http://feeds.feedburner.com/Hive76"""
crackedUrl = """http://feeds.feedburner.com/CrackedRSS"""