Skip to content

Instantly share code, notes, and snippets.

@Dracovian
Dracovian / api.php
Created Jan 9, 2018
An API made with PHP that handles simple RSA functionality such as keypair generation, encrypting, and decrypting.
View api.php
<?php
class Filter {
var $input;
function __construct($input) {
$this->input = htmlspecialchars($input);
$this->numeric = '#[0-9]#';
$this->alphabetic = '#[a-z]#i';
$this->alphanumeric = '#[a-z0-9]#i';
$this->multiplier = 512;
@Dracovian
Dracovian / obfuscator.py
Last active Jan 26, 2018
Prevent filename scrutiny by means of renaming said files with something a bit more random. Also employ a checksum verification method to catch potential file corruption or alteration when reversing the process.
View obfuscator.py
'''
'' @author: KimChoJapFan
'' @date: January 26, 2018
'''
# Import some necessary modules.
import hashlib, random, os
# Create our characterset for the random filename.
charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
@Dracovian
Dracovian / web.py
Created Feb 27, 2018
Simple web server in Python 3
View web.py
from socket import socket, AF_INET, SOCK_STREAM, SOL_SOCKET, SO_REUSEADDR
from sys import stdout
host, port, sock = 'localhost', 80, socket(AF_INET, SOCK_STREAM)
sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
sock.bind((host, port))
sock.listen(1)
stdout.write('Hosting HTTP Server on {}:{}\n'.format(host, port))
@Dracovian
Dracovian / passgen.py
Last active Mar 9, 2018
Simple Python 3 Password Generator
View passgen.py
from sys import stdout
from os import urandom
def genCharset():
lower = 'abcdefghijklmnopqrstuvwxyz'
return '0123456789{}{}!@#$%^&*'.format(lower, lower.upper())
def randomInteger(min, max):
return (ord(urandom(1)) % (max - min)) + min
@Dracovian
Dracovian / php_web.py
Created Mar 26, 2018
It was worth an attempt...
View php_web.py
'''
'' @author KimChoJapFan <https://github.com/KimChoJapFan>
'' @date March 25, 2018
'' @project WebPyPHP
'' @version 3.18r01
'''
from socket import socket, timeout, AF_INET, SOCK_STREAM, SOL_SOCKET, SO_REUSEADDR
from subprocess import run, PIPE
from os import path
@Dracovian
Dracovian / interpreter.cpp
Created Mar 30, 2018
Simplest Interpreter
View interpreter.cpp
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <regex>
#include <cmath>
#include "compiler.hpp"
@Dracovian
Dracovian / extract.bat
Created Apr 12, 2018
Simple unpacking of some repacks with exception to those that includes encryption such as the ones from R.G. Mechanics
View extract.bat
@echo off
REM Author: KimChoJapFan
REM
REM Purpose: To unpack Mr. DJ repacks.
REM
REM Benefit: To prevent shady scripts from being ran (no bitcoin miners, keyloggers, etc...).
REM
REM Downside: Can cause errors and may take longer to finish.
@Dracovian
Dracovian / run.vbs
Created Apr 12, 2018
An example script to run a couple of programs without showing a command prompt window for each running program.
View run.vbs
Dim dir : dir = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)
Set ws = WScript.CreateObject("WScript.Shell")
Dim nginx : nginx = dir & "\bin\nginx.exe"
Dim php : php = dir & "\bin\php\php-cgi.exe"
Dim nginx_start : nginx_start = nginx & " -p " & dir & "\bin -c " & dir & "\bin\conf\nginx.conf"
Dim php_start : php_start = php & " -b 127.0.0.1:9000 -c " & dir & "\bin\php\php.ini"
ws.run(nginx_start), 0, false
@Dracovian
Dracovian / conf.json
Created Apr 17, 2018
A slightly more complicated NodeJS web server
View conf.json
{
"settings": {
"port": 80,
"index": "index.html"
},
"headers": {
"host": "localhost",
"origin": "http://localhost",
"x-frame-options": "SAMEORIGIN",
"x-xss-protection": "\"1; mode=block\"",
@Dracovian
Dracovian / grabber_1.py
Created Apr 25, 2018
Simple Python 3 Proxy Grabbers
View grabber_1.py
import requests, re
class Proxy:
def __init__(self):
self.url = 'http://www.gatherproxy.com/proxylist/anonymity/?t=Elite'
def grabProxies(self, pages=1):
proxies = []
for x in range(0, pages):
resp = requests.post(self.url, data={'Type':'elite','Pageldx':x})