summaryrefslogtreecommitdiff
path: root/md/writeup/linux_shellcode.md
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2021-05-28 09:23:32 +0100
committerFreeArtMan <dos21h@gmail.com>2021-05-28 09:23:32 +0100
commit0ab4ab1ef46d6696243ce5a57a4008eebfde1b20 (patch)
treefc539fcc5061aa682c35a8077f80dbc2168005fa /md/writeup/linux_shellcode.md
parentefa24b220d9633d5d7bfef632b33df180dcb0e74 (diff)
downloadmd-content-0ab4ab1ef46d6696243ce5a57a4008eebfde1b20.tar.gz
md-content-0ab4ab1ef46d6696243ce5a57a4008eebfde1b20.zip
Update last articles
Diffstat (limited to 'md/writeup/linux_shellcode.md')
-rw-r--r--md/writeup/linux_shellcode.md51
1 files changed, 51 insertions, 0 deletions
diff --git a/md/writeup/linux_shellcode.md b/md/writeup/linux_shellcode.md
new file mode 100644
index 0000000..083a817
--- /dev/null
+++ b/md/writeup/linux_shellcode.md
@@ -0,0 +1,51 @@
+title:Linux ShellCode
+keywords:linux,shellcode,c,assembler
+
+# Linux ShellCode
+First shell code written from example. Shell code is very interesting
+way how to execute some code.asm source:
+
+```asm
+use32
+xor eax, eax
+inc eax
+xor ebx, ebx
+int 80h
+```
+
+```
+fasm code.asm code.bin
+```
+bin2hex output:
+
+```
+\x31\xc0\x40\x31\xdb\xcd\x80
+```
+
+C source:
+```c
+#include <stdio.h>
+char code[] = "\x31\xc0\x40\x31\xdb\xcd\x80";
+int main()
+{
+ void (*ret)();
+ ret = (void (*)())code;
+ ret();
+ printf("Nope it not working\n");
+}
+```
+```
+gcc main.c -o main
+```
+run
+```
+./main
+```
+nothing happens. That exactly that code do exits from programm
+
+
+
+## Downloads
+linux_shell_code.zip -
+4KiB - http://archive.main.lv/files/writeup/linux_shellcode_1/linux_shell_code.zip
+