Skip to content

Instantly share code, notes, and snippets.

View opensylar's full-sized avatar
💭
Play Hard

oPensyLar opensylar

💭
Play Hard
  • RE Freelancer
  • GMT-4 timezone
View GitHub Profile
@opensylar
opensylar / qjson_example.cpp
Created August 24, 2018 16:04
Example generation JSON string
QString CParserJson::GenResponse(int flag, bool state)
{
QString ret;
QVariantMap jsonRoot;
QVariantMap jsonElements;
QVariantMap jsonType;
@opensylar
opensylar / FindDMAAddy.c
Created February 1, 2021 22:22
find DMA Addr on C
DWORD GetProcId(const wchar_t* procName)
{
DWORD procId = 0;
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (hSnap != INVALID_HANDLE_VALUE)
{
PROCESSENTRY32 procEntry;
procEntry.dwSize = sizeof(procEntry);
@opensylar
opensylar / play-paladin-karos-server.c
Created February 1, 2021 22:42
playing Paladin on Karos server
This is how you can play a Paladin(wich is not available) right now in Karos.
BTW is sad that they want bug testers for the open beta and then they ban ppl for finding bugs, anyhow here it is, you can patch now.
Our Modified Function
Code:
VOID (__stdcall* pPaladin)();
__declspec(naked) VOID myPaladin(ULONG bPointer)
@opensylar
opensylar / get-image-base.c
Created February 1, 2021 22:45
get ImageBase
image base address
Code:
NtCurrentPeb()->ImageBaseAddress
or
@opensylar
opensylar / wmi-test.py
Last active February 3, 2021 19:05
Before ran: pip install wmi
import wmi
def wmi_remote():
host = "you_ip_server"
usr = "you_user_doamin"
pwd = "you_password"
conn = wmi.WMI(host, user=usr, password=pwd)
for class_name in conn.Win32_Process.properties.keys():
print(class_name)
@opensylar
opensylar / process-top.py
Last active February 5, 2021 19:17
Print (Python dictionary format) 0x4 process top CPU usage (Linux - SSH support)
import paramiko
import time
def parse_df(raw_df):
pass
def parse_connections(raw_conns):
pass
@opensylar
opensylar / yara-rules-joiner.py
Last active February 14, 2021 01:24
YARA rules joiner - c&p from hackplayers
#!/usr/bin/env python
# encoding: utf-8
import os
import shutil
def get_rules_from_git():
shutil.rmtree("./rules")
os.system("git clone https://github.com/Yara-Rules/rules.git")
@opensylar
opensylar / smtp-relay-test.py
Created February 22, 2021 04:48
python smtp relay sender snippet
import smtplib
relay_srv_port = 25
relay_srv_hst = "exhange.intranet"
msg = "Test mail to SMTP relay"
sender = "you-sender@you-server"
recv = "to-recv@other-server.com"
smtpObj = smtplib.SMTP(relay_srv_hst, relay_srv_port)
smtpObj.sendmail(sender, recv, msg)
@opensylar
opensylar / ad-host-dns-name-resolver.py
Created March 7, 2021 04:21
You need install pyad before
from pyad import adcomputer
def fn1():
computer = adcomputer.ADComputer.from_cn("STEVEMASTER")
print(computer.get_attribute('msRADIUSFramedIPAddress'))
print(computer.get_attribute('networkAddress'))
fn1()
@opensylar
opensylar / ping-test.py
Created March 8, 2021 15:00
python ping test
import subprocess
def run_ping2(hst):
array_program = ["ping", "-n", "1", hst]
h = subprocess.Popen(array_program, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
return h.communicate()
def parse_output_ping(output_string):
output_string = output_string.decode("utf-8")