Skip to content

Instantly share code, notes, and snippets.

@mouseroot
mouseroot / winapp.py
Created August 1, 2013 05:40
Win32 CreateWindow example in python
from ctypes import *
from ctypes.wintypes import *
WNDPROCTYPE = WINFUNCTYPE(c_int, HWND, c_uint, WPARAM, LPARAM)
WS_EX_APPWINDOW = 0x40000
WS_OVERLAPPEDWINDOW = 0xcf0000
WS_CAPTION = 0xc00000
@mouseroot
mouseroot / psychwiki.py
Created February 25, 2020 00:30
Psychonaut Wiki API
# This is the API we need to POST too..
# https://api.psychonautwiki.org/
#
import requests
import json
#We ask for input, displaying "Which Psych?"
query = input("Which Psych?")
@mouseroot
mouseroot / Overview
Created December 21, 2012 17:41
Cracking WPA/WPA2
apt-get install aircrack-ng
apt-get install macchanger
ifconfig <interface> down
macchanger -s 00:00:13:37:00:00 <interface>
airmon-ng start <interface>
ifconfig <interface> up
airodump-ng <interface>
...let it populate
^c
@mouseroot
mouseroot / ip_routing_win7.txt
Created April 30, 2013 16:41
Enable IP Routing in Windows 7
1. Open regedit
2. Navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\"
3. Change IPEnableRouter to 1
4. Run services->Routing and Remote->start
(reboot may be nessesary)
@mouseroot
mouseroot / bot.py
Created October 13, 2021 02:39
Simplex Chat Bot
#Bot Skeleton
import sys
class Bot:
"""Bot"""
def __init__(self,name) -> None:
self.name = name
self.memory = {}
self.running = True
self.words = []
import os
def GetPID(processName):
procs = [proc_fd for proc_fd in os.listdir("/proc/") if proc_fd.isdigit()]
for proc_fd in procs:
try:
status_fd = open("/proc/{0}/status".format(proc_fd),"r").readlines()
for line in status_fd:
if "Name:" in line:
name = line.replace("Name:\t","").replace("\n","")
@mouseroot
mouseroot / nasm_message.py
Last active March 9, 2020 23:49
Build and Assemble a program to print a message, using python (self contained script)
import subprocess
asm_code = """
.global _start
.text
_start:
mov $1,%rax
mov $1,%rdi
mov $msg, %rsi
@mouseroot
mouseroot / TreeNode.java
Created September 21, 2012 03:50
TreeNode class
private static class TreeNode
{
//Customer information
int id;
String name;
TreeNode left;
TreeNode right;
//Our constructor takes the id and first and last name
@mouseroot
mouseroot / downloader.py
Created August 21, 2018 23:58
Python downloader w/ Requests
import requests
import sys
def download_file(url, filename):
with open(filename, "wb") as file:
print(f"Downloading {filename}")
response = requests.get(url, stream=True)
length = response.headers.get("Content-Length")
@mouseroot
mouseroot / echo_path.py
Created August 15, 2018 20:45
Python 3+ one-liner to print the environment variables
python -c "import os;print(os.getenv('path').replace(';','\n'))"
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Program Files\nodejs\
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
C:\Users\Jon\AppData\Local\Programs\Python\Python37-32\Scripts
C:\Users\Jon\AppData\Roaming\npm
C:\Python27\