Skip to content

Instantly share code, notes, and snippets.

REM nvim --headless --listen localhost:7777
@ECHO off
@SET FILE_PATH=
FOR /F %%I IN ('wsl.exe wslpath -a -u %1') DO @SET "FILE_PATH=%%I"
C:\Python310\Scripts\nvr.exe --nostart --servername localhost:7777 -p "file://%FILE_PATH%"
@y0ug
y0ug / BootstrapWin.ps1
Last active December 3, 2022 00:14
Bootstrap windows 10 machine
# Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString("https://gist.githubusercontent.com/y0ug/0c5859de8858f9229de8fcf72a6ae691/raw/BootstrapWin.ps1"))
$kmsserver = "192.168.10.2:1688"
$gvlk = "W269N-WFGWX-YVC9B-4J6C9-T83GX" #windows10/11 pro
Set-TimeZone -Name "Romance Standard Time"
$features = @(
#"VirtualMachinePlatform"
#"Microsoft-Windows-Subsystem-Linux"
#"HypervisorPlatform"
import sys
import os
import shutil
import datetime
import json
import base64
import argparse
import logging
import requests
import random
@y0ug
y0ug / parse_reg_file.py
Created December 23, 2021 09:58
function to write/read from windows reg export
import sys
import zlib
import io
import re
from configparser import ConfigParser
import binascii
import argparse
import struct
import socket
from datetime import datetime
@y0ug
y0ug / _IAT_qiling.py
Last active December 29, 2021 03:10
Using Qiling to resolve obfuscated import on windows
# Emulate sample to resolv obfuscated import with qiling
# Just one way to do it, this method is kind of slow.
# You need to have all the required DLL in the 'rootfs'
# Classic getprocaddress by hash we hook after the call
# read EAX and resolv the name from ql.loader.import_symbols
# compute the address of the mov operand
# generate the idapython code
# python3 IAT_qiling.py sample.exe | tee addr_ida.py
# idapython is in addr_ida.py at the end
@y0ug
y0ug / emulate_win.py
Created July 9, 2020 11:59
PE x64 emulation with Triton
#!/usr/bin/env python
## -*- coding: utf-8 -*-
from __future__ import print_function
from triton import TritonContext, ARCH, CPUSIZE, MemoryAccess, OPCODE, Instruction
import os
import sys
import string
Triton = TritonContext()

Android Emulator

Packages

brew cask install adoptopenjdk8
brew cask install android-sdk
brew cask install intel-haxm

Setup

@y0ug
y0ug / pingmon.py
Last active December 22, 2015 00:28
import rrdtool
import os
import sys
import subprocess
import re
import time
import datetime
class GraphPing(object):
def __init__(self, target, reset=False):
@y0ug
y0ug / -
Created March 8, 2015 01:23
" Color
"colo evening
" Enable syntax
syntax on
" Enable smarttab
filetype plugin indent on
" Tab settings
@y0ug
y0ug / -
Created November 15, 2014 16:55
y0ug@h4ze /tmp % python irma_output_testcase_parser.py out_gdata.txt
expected_results = {
'eicar.cab': 'Virus: EICAR-Test-File (not a virus)',
'eicar.com.txt': 'Virus: EICAR-Test-File (not a virus) (Engine A)',
'eicar_niveau2.zip': 'Virus: EICAR-Test-File (not a virus)',
'eicar_lha.bin': 'Virus: EICAR-Test-File (not a virus)',
'eicar_gz.bin': 'Virus: EICAR-Test-File (not a virus)',
'eicarhqx_binhex.bin': 'Virus: Trojan.Script.135850 (Engine A)',
'eicar_mime.bin': 'Virus: EICAR-Test-File (not a virus)',
'eicar_cab.bin': 'Virus: EICAR-Test-File (not a virus)',