-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCommandExec.asm
More file actions
38 lines (29 loc) · 816 Bytes
/
CommandExec.asm
File metadata and controls
38 lines (29 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
;
; Program To Execute Commands
;
; author : Suraj Singh Bisht
; Email : surajsinghbisht054@gmail.com
;
; section bss
SECTION .bss
; section data
SECTION .data
filename db "/bin/ping", 0h ; Decleare String
argv db "www.bitforestinfo.com", 0h ; Argument
arg_array dd filename ;
dd argv ; Array of Arguments
dd 0h ; End of Argument
environ db 0h ; Empty Argument
; section text
SECTION .text
global _start ; Linker Trigger
; Routine
_start:
mov eax, 11 ; Invoke SYS_EXECVE () - > execve(const char *filename, char *const argv[], char *const envp[])
mov ebx, filename ; EBX = File name
mov ecx, arg_array; ; ECX = array of argument addresses
mov edx, environ ; EDx= Environment
int 80h ; kernel Interpt
mov eax, 1 ; InVoke SYS_EXIT
mov ebx, 0 ; Return 0
int 80h ; Kernel Interpt