Skip to content

Instantly share code, notes, and snippets.

View dimkr's full-sized avatar
💪
Defeating complex problems

Dima Krasner dimkr

💪
Defeating complex problems
View GitHub Profile
@dimkr
dimkr / gist:576e0c1bd765f5929b6d67143bd4a167
Last active June 6, 2020 10:20
Go+VSCode+Heroku+Kubernetes+GCP Dev Setup on on arm64 Crostini
#!/bin/sh -xe
# install 32-bit libraries
sudo apt update || :
sudo apt install -y --no-install-recommends libc6-armhf-cross libstdc++6-armhf-cross libgcc1-armhf-cross
sudo ln -s ../usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3 /lib/ld-linux-armhf.so.3
# install 32-bit Heroku CLI
echo "export LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib" >> ~/.bashrc
echo "export PATH=\$PATH:/usr/local/heroku/bin" >> ~/.bashrc
@dimkr
dimkr / gist:4df8675778ed75a6b414
Created February 13, 2016 12:25
/etc/udev/rules.d/75-randomize-mac.rules
ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="CURRENT, REAL MAC ADDRESS GOES HERE", RUN+="/bin/bash -c '/bin/ip link set dev %k address `/usr/bin/printf %02x $(($RANDOM % 255))`:`/usr/bin/printf %02x $(($RANDOM % 255))`:`/usr/bin/printf %02x $(($RANDOM % 255))`:`/usr/bin/printf %02x $(($RANDOM % 255))`:`/usr/bin/printf %02x $(($RANDOM % 255))`:`/usr/bin/printf %02x $(($RANDOM % 255))`'"
@dimkr
dimkr / gist:89c081935cbafaa70156
Last active February 1, 2016 20:52
How to replace a dependency shared object of an ELF executable
/*
* Copyright (c) 2016 Dima Krasner
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@dimkr
dimkr / gist:90e71a2186afd031ccfd
Created June 1, 2015 20:04
How to build a standalone logind 204
#!/bin/sh
wget http://www.freedesktop.org/software/systemd/systemd-204.tar.xz
tar -xJvf systemd-204.tar.xz
cd systemd-204/src/login
gperf < logind-gperf.gperf > logind-gperf.c
gcc -std=gnu99 -Wall -pedantic \
-o logind \
-march=i486 -mtune=i686 -Os -fomit-frame-pointer -ffunction-sections -fdata-sections -fmerge-all-constants \
@dimkr
dimkr / gist:daa3f550b815c84b5804
Created September 26, 2014 13:49
Chinese SSH brute force malware caught by my honeypot
split -5000 results22.txt temp_22_
ls temp_22_* | while read name; do
echo Start $name
mv -f $name mfu.txt
./brutessh 500
sync
split -10000 vuln.txt temp_bios_
ls temp_bios_* | while read name; do