first commit

This commit is contained in:
OPSXCQ 2016-12-02 17:19:11 -02:00
parent 985a5c928c
commit f40a84879c
No known key found for this signature in database
GPG Key ID: 9AD730FE9CDE5661
551 changed files with 72374 additions and 24 deletions

View File

@ -1,30 +1,20 @@
FROM tutum/lamp:latest
FROM debian:jessie
MAINTAINER Rafael <rafael@thestorm.com.br>)
MAINTAINER opsxcq <opsxcq@thestorm.com.br>
# Install DVWA
RUN \
rm -rf /app/* && \
apt-get update && \
apt-get install -y wget php5-gd unzip && \
rm -rf /var/lib/apt/lists/* && \
wget https://github.com/ethicalhack3r/DVWA/archive/v1.9.zip -O dvwa.zip && \
unzip dvwa.zip && \
cp -r DVWA-1.9/* /app/ && \
rm -rf DVWA-1.9 dvwa.zip
RUN apt-get update && \
apt-get upgrapde -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
package1 \
package2 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Fix some issues about default lamp installation
RUN \
chmod -R 777 /app/hackable/uploads/ /app/external/phpids/0.6/lib/IDS/tmp/phpids_log.txt && \
sed -i 's/allow_url_include = Off/allow_url_include = On/g' /etc/php5/apache2/php.ini && \
sed -i "s/$_DVWA[ 'recaptcha_private_key' ] = ''/$_DVWA[ 'recaptcha_private_key' ] = '6LdNNycTAAAAAGuxxzwzwVC6FPJmdNqNPqdfMoim'/g" /app/config/config.inc.php && \
sed -i "s/$_DVWA[ 'recaptcha_public_key' ] = ''/$_DVWA[ 'recaptcha_public_key' ] = '6LdNNycTAAAAANH2R31pX_dcQ5V02Og2MyV1ylTX'/g" /app/config/config.inc.php
RUN useradd --system --uid 666 -M --shell /usr/sbin/nologin vulnerable
# Configure the db access
RUN \
sed -i 's/root/admin/g' /app/config/config.inc.php && \
echo "sed -i \"s/p@ssw0rd/\$PASS/g\" /app/config/config.inc.php" >> /create_mysql_admin_user.sh
USER vulnerable
EXPOSE 80 3306
CMD ["/run.sh"]
EXPOSE 80
VOLUME /data
WORKDIR /data

20
dvwa/.htaccess Normal file
View File

@ -0,0 +1,20 @@
# Only set these if PHP 5 is loaded as an apache module
<IfModule mod_php5.c>
php_flag magic_quotes_gpc Off
#php_flag allow_url_fopen on
#php_flag allow_url_include on
</IfModule>
# Only set these if PHP 4 is loaded as an apache module
<IfModule mod_php4.c>
php_flag magic_quotes_gpc Off
#php_flag allow_url_fopen on
#php_flag allow_url_include on
</IfModule>
# Limit access to localhost
#<Limit GET POST PUT>
# order deny,allow
# deny from all
# allow from 127.0.0.1
#</Limit>

157
dvwa/CHANGELOG.md Normal file
View File

@ -0,0 +1,157 @@
DAMN VULNERABLE WEB APPLICATION
=======================
v1.9 (2015-10-05)
======
+ Added a dedicated objective (or "flag") for file include. (@g0tmi1k)
+ Added a warning to any module that requires a certain configuration. (@g0tmi1k)
+ Added comments to all source code that would be visible via DVWA modules. (@g0tmi1k)
+ Added CSRF token to pre-auth forms (login/setup/security pages). (@g0tmi1k + @Shinkurt)
+ Added HttpOnly cookie flag on impossible levels. (@g0tmi1k)
+ Added more detail to the documentation. (@g0tmi1k)
+ Added PDO to all impossible levels requiring MySQL. (@g0tmi1k)
+ Added PHPIDS options into the config file. (@g0tmi1k)
+ Added system check to setup. (@g0tmi1k)
+ Added various information to all help pages for every module. (@g0tmi1k)
+ Changed brute force medium to be harder due to sleep. (@g0tmi1k)
+ Changed file include landing page + added 3x example pages. (@g0tmi1k)
+ Changed file include medium to be harder due to more filters. (@g0tmi1k)
+ Changed HTTP REFERER check for medium level CSRF. (@g0tmi1k)
+ Changed input box for medium level with SQLi + SQLi Blind. (@g0tmi1k)
+ Changed SQLi + SQLi Blind to be $_POST rather than $_GET. (@g0tmi1k)
+ Changed SQLi Blind to be a real example of the vulnerability. (@g0tmi1k)
+ Fixed brute force and file upload impossible levels, as they were vulnerable. (@g0tmi1k + @Shinkurt)
+ Fixed bug with file fnclude page not loading. (@g0tmi1k)
+ Fixed CAPTCHA bug to read URL parameters on impossible. (@g0tmi1k)
+ Fixed CAPTCHA bug where the form wouldn't be visible. (@g0tmi1k)
+ Fixed CAPTCHA bug where the URL parameters were not being used for low + medium. (@g0tmi1k)
+ Fixed CSRF medium level bug when not on localhost. (@g0tmi1k)
+ Fixed setup bug with custom URL path. (@g0tmi1k)
+ Removed PostgreSQL DB support. (@g0tmi1k)
+ Renamed 'Command Execution' to 'Command Injection'. (@g0tmi1k)
+ Renamed 'high' level to 'impossible' and created new vectors for 'high'. (@g0tmi1k)
+ Updated README and documentation. (@g0tmi1k)
+ Various code cleanups in the core PHP files+CSS. (@g0tmi1k)
+ Various setup improvements (e.g. redirection + limited menu links). (@g0tmi1k)
v1.8 (2013-05-01)
======
+ Versioning change: Version numbers now follow Major.Minor (e.g. v1.8) removing the middle digit.
+ Moved default security level setting to the config file.
+ Fixed a bug which prevented setup when a database name other than 'dvwa' was used.
+ Added a logic challenge involving an insecure CAPTCHA (requires external internet access)
v1.0.7 (2010-09-08)
======
+ Re-designed the login page + made some other slight cosmetic changes. 06/06/2010 (@ethicalhack3r)
+ Started PostgreSQL implementation. 15/03/2010 (@ethicalhack3r)
+ A few small cosmetic changes. 15/03/2010 (@ethicalhack3r)
+ Improved the help information and look. 15/03/2010 (@ethicalhack3r)
+ Fixed a few bugs thanks to @Digininja. 15/03/2010 (@ethicalhack3r)
+ Show logged in username. 05/02/2010 (Jason Jones)
+ Added new info on RandomStorm. 04/02/2010 (@ethicalhack3r)
+ Added 'SQL Injection (Blind)'. 04/02/2010 (@ethicalhack3r)
+ Added official documentation. 21/11/2009 (@ethicalhack3r)
+ Implemented view all source functionality. 16/10/2009 (tmacuk, craig, @ethicalhack3r)
v1.0.6 (2009-10-05)
======
+ Fixed a bug where the logo would not show on first time use. 03/09/2009 (@ethicalhack3r)
+ Removed 'current password' input box for low+med CSRF security. 03/09/2009 (@ethicalhack3r)
+ Added an article which was written for OWASP Turkey. 03/10/2009 (@ethicalhack3r)
+ Added more toubleshooting information. 02/10/2009 (@ethicalhack3r)
+ Stored XSS high now sanitises output. 02/10/2009 (@ethicalhack3r)
+ Fixed a 'bug' in XSS stored low which made it not vulnerable. 02/10/2009 (@ethicalhack3r)
+ Rewritten command execution high to use a whitelist. 30/09/09 (@ethicalhack3r)
+ Fixed a command execution vulnerability in exec high. 17/09/09 (@ethicalhack3r)
+ Added some troubleshooting info for PHP 5.2.6 in readme.txt. 17/09/09 (@ethicalhack3r)
+ Added the upload directory to the upload help. 17/09/09 (@ethicalhack3r)
v1.0.5 (2009-09-03)
======
+ Made IE friendly as much as possible. 30/08/2009 (@ethicalhack3r)
+ Removed the acunetix scan report. 30/08/2009 (@ethicalhack3r)
+ Added 'Clear Log' button to PHPIDS parser. 27/08/2009 (@ethicalhack3r)
+ Implemented PHPIDS log parser. 27/08/2009 (@ethicalhack3r)
+ Implemented Stored XSS vulnerability. 27/08/2009 (@ethicalhack3r)
+ Added htaccess rule for localhost access only. 22/08/2009 (@ethicalhack3r)
+ Added CSRF. 01/08/2009 (@ethicalhack3r)
+ Implemented sessions/login. 01/08/2009 (@ethicalhack3r)
+ Complete recode. (jamesr)
+ Complete redesign. (jamesr)
+ Delimited 'dvwa' in session- minimising the risk of clash with other projects running on localhost. 01/08/2009 (jamesr)
+ Integrated PHPIDS v0.6. 01/08/2009 (jamesr)
+ Streamlined login functionality. 01/08/2009 (jamesr)
v1.0.4 (2009-06-29)
======
+ Added acunetix scan report. 24/06/2009
+ All links use http://hiderefer.com to hide referrer header. 23/06/2009
+ Updated/added 'more info' links. 23/06/2009
+ Moved change log info to CHANGELOG.txt. 22/06/2009
+ Fixed the exec.php UTF-8 output. 16/06/2009
+ Moved Help/View source buttons to footer. 12/06/2009
+ Fixed phpInfo bug. 12/06/2009
+ Made dvwa IE friendly. 11/06/2009
+ Fixed html bugs. 11/06/2009
+ Added more info to about page. 03/06/2009
+ Added pictures for the users. 03/06/2009
+ Fixed typos on the welcome page. 03/06/2009
+ Improved README.txt and fixed typos. 03/06/2009
+ Made SQL injection possible in sqli_med.php. Thanks to Teodor Lupan. 03/06/2009
v1.0.3 (2009-05-25)
======
+ Changed XAMPP link in index.php. 25/05/2009
+ Set default security to low. 25/05/2009
+ Improved output in setup.php. 25/05/2009
v1.0.2 (2009-05-24)
======
+ Removed phpinfo on higher security levels. 24/05/2009
+ Moved all vulnerable code to /source/. 24/05/2009
+ Added viewsource. 24/05/2009
v1.0.1 (2009-05-24)
======
+ Implemented different security levels. 24/05/2009
+ Changed XSS from POST to GET. 22/05/2009
+ Some changes to CSS. 22/05/2009
+ Version number now in variable in header.php. 21/05/2009
+ Added about page. 21/05/2009
+ Updated login script to use database. 21/05/2009
+ Added admin user to database. 21/05/2009
+ Combined RFI + LFI to make 'File Inclusion'. 21/05/2009
+ More realism to Local File Inclusion. 21/05/2009
+ Better error output on upload script. 21/05/2009
v1.0 (2009-05-20)
====
+ Made command execution more realistic. 20/05/2009
+ Added help buttons. 20/05/2009
+ Added .htaccess file to turn magic quotes off. 20/05/2009
+ Improved database creation with setup.php. 19/05/2009
+ Amended installation instructions in README file. 19/05/2009
+ Added GNU GPL license. 19/05/2009
+ Added a robots.txt file with disallow all. 26/01/2009
+ Removed link to www.ethicalhacker.co.uk in footer. 26/01/2009
+ Added better error output on magic quotes. 26/01/2009
Links
=====
+ Homepage: http://www.dvwa.co.uk
+ Project Home: https://github.com/RandomStorm/DVWA
_Created by the DVWA team._

623
dvwa/COPYING.txt Normal file
View File

@ -0,0 +1,623 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
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
them 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 prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. 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.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
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. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS

167
dvwa/README.md Normal file
View File

@ -0,0 +1,167 @@
![DVWA](https://www.randomstorm.com/images/tools/dvwa.png "DVWA")
# DAMN VULNERABLE WEB APPLICATION
Damn Vulnerable Web Application (DVWA) is a PHP/MySQL web application that is damn vulnerable. Its main goal is to be an aid for security professionals to test their skills and tools in a legal environment, help web developers better understand the processes of securing web applications and to aid both students & teachers to learn about web application security in a controlled class room environment.
The aim of DVWA is to **practice some of the most common web vulnerability**, with **various difficultly levels**, with a simple straightforward interface.
Please note, there are **both documented and undocumented vulnerability** with this software. This is intentional. You are encouraged to try and discover as many issues as possible.
- - -
## WARNING!
Damn Vulnerable Web Application is damn vulnerable! **Do not upload it to your hosting provider's public html folder or any Internet facing servers**, as they will be compromised. It is recommend using a virtual machine (such as [VirtualBox](https://www.virtualbox.org/) or [VMware](https://www.vmware.com/)), which is set to NAT networking mode. Inside a guest machine, you can downloading and install [XAMPP](https://www.apachefriends.org/en/xampp.html) for the web server and database.
### Disclaimer
We do not take responsibility for the way in which any one uses this application (DVWA). We have made the purposes of the application clear and it should not be used maliciously. We have given warnings and taken measures to prevent users from installing DVWA on to live web servers. If your web server is compromised via an installation of DVWA it is not our responsibility it is the responsibility of the person/s who uploaded and installed it.
- - -
## License
This file is part of Damn Vulnerable Web Application (DVWA).
Damn Vulnerable Web Application (DVWA) 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 3 of the License, or
(at your option) any later version.
Damn Vulnerable Web Application (DVWA) 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 Damn Vulnerable Web Application (DVWA). If not, see http://www.gnu.org/licenses/.
- - -
## Download
DVWA is available either as a package that will run on your own web server or as a Live CD:
+ DVWA Development Source (Latest) [Download ZIP](https://github.com/RandomStorm/DVWA/archive/master.zip) // `git clone https://github.com/RandomStorm/DVWA`
+ DVWA v1.9 Source (Stable) - \[1.3 MB\] [Download ZIP](https://github.com/RandomStorm/DVWA/archive/v1.9.zip) - Released 2015-10-05
+ DVWA v1.0.7 LiveCD - \[480 MB\] [Download ISO](http://www.dvwa.co.uk/DVWA-1.0.7.iso) - Released 2010-09-08
- - -
## Installation
### Windows + XAMPP
Installation video:
https://www.youtube.com/watch?v=GzIj07jt8rM
The easiest way to install DVWA is to download and install [XAMPP](https://www.apachefriends.org/en/xampp.html) if you do not already have a web server setup.
XAMPP is a very easy to install Apache Distribution for Linux, Solaris, Windows and Mac OS X. The package includes the Apache web server, MySQL, PHP, Perl, a FTP server and phpMyAdmin.
XAMPP can be downloaded from:
https://www.apachefriends.org/en/xampp.html
Simply unzip dvwa.zip, place the unzipped files in your public html folder, then point your browser to: http://127.0.0.1/dvwa/setup.php
### Linux Packages
If you are using a Debian based Linux distribution, you will need to install the following packages _(or their equivalent)_:
`apt-get -y install apache2 mysql-server php5 php5-mysql php-pear php5-gd`
### Database Setup
To set up the database, simply click on the `Setup DVWA` button in the main menu, then click on the `Create / Reset Database` button. This will create / reset the database for you with some data in.
If you receive an error while trying to create your database, make sure your database credentials are correct within `./config/config.inc.php`.
The variables are set to the following by default:
```
$_DVWA[ 'db_user' ] = 'root';
$_DVWA[ 'db_password' ] = 'p@ssw0rd';
$_DVWA[ 'db_database' ] = 'dvwa';
```
### Other Configuration
Depening on your Operating System as well as version of PHP, you may wish to alter the default configuration. The location of the files will be different on a per-machine basis.
Note, You are unable to use PHP v7.0 or later with DVWA.
**Folder Permissions**:
* `./hackable/uploads/` - Needs to be writable by the web service (for File Upload).
* `./external/phpids/0.6/lib/IDS/tmp/phpids_log.txt` - Needs to be writable by the web service (if you wish to use PHPIDS).
**PHP configuration**:
* `allow_url_include = on` - Allows for Remote File Inclusions (RFI) [[allow_url_include](https://secure.php.net/manual/en/filesystem.configuration.php#ini.allow-url-include)]
* `allow_url_fopen = on` - Allows for Remote File Inclusions (RFI) [[allow_url_fopen](https://secure.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen)]
* `safe_mode = off` - (If PHP <= v5.4) Allows for SQL Injection (SQLi) [[safe_mode](https://secure.php.net/manual/en/features.safe-mode.php)]
* `magic_quotes_gpc = off` - (If PHP <= v5.4) Allows for SQL Injection (SQLi) [[magic_quotes_gpc](https://secure.php.net/manual/en/security.magicquotes.php)]
* `display_errors = off` - (Optional) Hides PHP warning messages to make it less verbose [[display_errors](https://secure.php.net/manual/en/errorfunc.configuration.php#ini.display-errors)]
**File: `config/config.inc.php`**:
* `$_DVWA[ 'recaptcha_public_key' ]` & `$_DVWA[ 'recaptcha_private_key' ]` - These values need to be generated from: https://www.google.com/recaptcha/admin/create
### Default Credentials
**Default username = `admin`**
**Default password = `password`**
_...can easily be brute forced ;)_
Login URL: http://127.0.0.1/dvwa/login.php
### Troubleshooting
For the latest troubleshooting information please visit:
https://github.com/RandomStorm/DVWA/issues
+Q. SQL Injection wont work on PHP v5.2.6.
-A.If you are using PHP v5.2.6 you will need to do the following in order for SQL injection and other vulnerabilities to work.
In `.htaccess`:
Replace:
```
<IfModule mod_php5.c>
php_flag magic_quotes_gpc off
#php_flag allow_url_fopen on
#php_flag allow_url_include on
</IfModule>
```
With:
```
<IfModule mod_php5.c>
magic_quotes_gpc = Off
allow_url_fopen = On
allow_url_include = On
</IfModule>
```
+Q. Command Injection won't work.
-A. Apache may not have high enough priviledges to run commands on the web server. If you are running DVWA under Linux make sure you are logged in as root. Under Windows log in as Administrator.
+Q. My XSS payload won't run in IE.
-A. If you're running IE8 or above, IE actively filters any XSS. To disable the filter you can do so by setting the HTTP header `X-XSS-Protection: 0` or disable it from internet options. There may also be ways to bypass the filter.
- - -
## Links
Homepage: http://www.dvwa.co.uk
Project Home: https://github.com/RandomStorm/DVWA
*Created by the DVWA team*

60
dvwa/about.php Normal file
View File

@ -0,0 +1,60 @@
<?php
define( 'DVWA_WEB_PAGE_TO_ROOT', '' );
require_once DVWA_WEB_PAGE_TO_ROOT . 'dvwa/includes/dvwaPage.inc.php';
dvwaPageStartup( array( 'phpids' ) );
$page = dvwaPageNewGrab();
$page[ 'title' ] = 'About' . $page[ 'title_separator' ].$page[ 'title' ];
$page[ 'page_id' ] = 'about';
$page[ 'body' ] .= "
<div class=\"body_padded\">
<h1>About</h1>
<p>Version " . dvwaVersionGet() . " (Release date: " . dvwaReleaseDateGet() . ")</p>
<p>Damn Vulnerable Web Application (DVWA) is a PHP/MySQL web application that is damn vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, help web developers better understand the processes of securing web applications and aid teachers/students to teach/learn web application security in a class room environment</p>
<p>The official documentation for DVWA can be found <a href=\"docs/DVWA_v1.3.pdf\">here</a>.</p>
<p>DVWA is a RandomStorm OpenSource project. All material is copyright 2008-2015 RandomStorm & Ryan Dewhurst.</p>
<h2>Links</h2>
<ul>
<li>Homepage: " . dvwaExternalLinkUrlGet( 'http://www.dvwa.co.uk/' ) . "</li>
<li>Project Home: " . dvwaExternalLinkUrlGet( 'https://github.com/RandomStorm/DVWA' ) . "</li>
<li>Bug Tracker: " . dvwaExternalLinkUrlGet( 'https://github.com/RandomStorm/DVWA/issues' ) . "</li>
<li>Souce Control: " . dvwaExternalLinkUrlGet( 'https://github.com/RandomStorm/DVWA/commits/master' ) . "</li>
<li>Wiki: " . dvwaExternalLinkUrlGet( 'https://github.com/RandomStorm/DVWA/wiki' ) . "</li>
</ul>
<h2>Credits</h2>
<ul>
<li>Craig</li>
<li>Jamesr: " . dvwaExternalLinkUrlGet( 'https://www.creativenucleus.com/','www.creativenucleus.com' ) . " / " . dvwaExternalLinkUrlGet( 'http://www.designnewcastle.co.uk/','www.designnewcastle.co.uk' ) . "</li>
<li>Ryan Dewhurst: " . dvwaExternalLinkUrlGet( 'https://www.dewhurstsecurity.com/','www.dewhurstsecurity.com' ) . "</li>
<li>Tedi Heriyanto: " . dvwaExternalLinkUrlGet( 'http://tedi.heriyanto.net/','http://tedi.heriyanto.net' ) . "</li>
<li>Tom Mackenzie: " . dvwaExternalLinkUrlGet( 'https://www.tmacuk.co.uk/','www.tmacuk.co.uk' ) . "</li>
<li>RandomStorm: " . dvwaExternalLinkUrlGet( 'https://www.randomstorm.com/','www.randomstorm.com' ) . "</li>
<li>Jason Jones: " . dvwaExternalLinkUrlGet( 'http://www.linux-ninja.com/','www.linux-ninja.com' ) . "</li>
<li>Brooks Garrett: " . dvwaExternalLinkUrlGet( 'http://brooksgarrett.com/','www.brooksgarrett.com' ) . "</li>
<li>g0tmi1k: " . dvwaExternalLinkUrlGet( 'https://blog.g0tmi1k.com/','g0tmi1k.com' ) . "</li>
<li>Shinkurt: " . dvwaExternalLinkUrlGet( 'http://www.paulosyibelo.com/','www.paulosyibelo.com' ) . "</li>
</ul>
<ul>
<li>PHPIDS - Copyright (c) 2007 " . dvwaExternalLinkUrlGet( 'http://github.com/PHPIDS/PHPIDS', 'PHPIDS group' ) . "</li>
</ul>
<h2>License</h2>
<p>Damn Vulnerable Web Application (DVWA) 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 3 of the License, or
(at your option) any later version.</p>
<p>The PHPIDS library is included, in good faith, with this DVWA distribution. The operation of PHPIDS is provided without support from the DVWA team. It is licensed under <a href=\"" . DVWA_WEB_PAGE_TO_ROOT . "instructions.php?doc=PHPIDS-license\">separate terms</a> to the DVWA code.</p>
<h2>Development</h2>
<p>Everyone is welcome to contribute and help make DVWA as successful as it can be. All contributors can have their name and link (if they wish) placed in the credits section. To contribute pick an Issue from the Project Home to work on or submit a patch to the Issues list.</p>
</div>\n";
dvwaHtmlEcho( $page );
exit;
?>

View File

@ -0,0 +1,44 @@
<?php
# If you are having problems connecting to the MySQL database and all of the variables below are correct
# try changing the 'db_server' variable from localhost to 127.0.0.1. Fixes a problem due to sockets.
# Thanks to @digininja for the fix.
# Database management system to use
$DBMS = 'MySQL';
#$DBMS = 'PGSQL'; // Currently disabled
# Database variables
# WARNING: The database specified under db_database WILL BE ENTIRELY DELETED during setup.
# Please use a database dedicated to DVWA.
$_DVWA = array();
$_DVWA[ 'db_server' ] = '127.0.0.1';
$_DVWA[ 'db_database' ] = 'dvwa';
$_DVWA[ 'db_user' ] = 'root';
$_DVWA[ 'db_password' ] = 'p@ssw0rd';
# Only used with PostgreSQL/PGSQL database selection.
$_DVWA[ 'db_port '] = '5432';
# ReCAPTCHA settings
# Used for the 'Insecure CAPTCHA' module
# You'll need to generate your own keys at: https://www.google.com/recaptcha/admin/create
$_DVWA[ 'recaptcha_public_key' ] = '';
$_DVWA[ 'recaptcha_private_key' ] = '';
# Default security level
# Default value for the secuirty level with each session.
# The default is 'impossible'. You may wish to set this to either 'low', 'medium', 'high' or impossible'.
$_DVWA[ 'default_security_level' ] = 'impossible';
# Default PHPIDS status
# PHPIDS status with each session.
# The default is 'disabled'. You can set this to be either 'enabled' or 'disabled'.
$_DVWA[ 'default_phpids_level' ] = 'disabled';
# Verbose PHPIDS messages
# Enabling this will show why the WAF blocked the request on the blocked request.
# The default is 'disabled'. You can set this to be either 'true' or 'false'.
$_DVWA[ 'default_phpids_verbose' ] = 'false';
?>

BIN
dvwa/docs/DVWA_v1.3.pdf Normal file

Binary file not shown.

1
dvwa/docs/pdf.html Normal file
View File

@ -0,0 +1 @@
Damn Vulnerable Web Application (DVWA) <a href="docs/DVWA_v1.3.pdf">Official Documentation PDF v1.3</a>

25
dvwa/dvwa/css/help.css Normal file
View File

@ -0,0 +1,25 @@
body {
background-color: #e7e7e7;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
}
h1 {
font-size: 25px;
}
div#container {
}
div#code {
background-color: #ffffff;
}
div#area {
margin-left: 30px;
}
span.spoiler {
background-color: black;
color: black;
}

59
dvwa/dvwa/css/login.css Normal file
View File

@ -0,0 +1,59 @@
body {
background: #fefffe;
font: 12px/15px Arial, Helvetica, sans-serif;
line-height: 20px;
color: #6b6b6b;
}
#wrapper {
text-align: center;
margin: 0 auto;
}
#content {
display: inline-block;
padding: 20px;
width: auto;
}
#footer {
position: absolute;
width: 100%;
height: 50px;
bottom: 0px;
left: 0px;
}
label {
float: left;
text-align: right;
margin-right: 0.5em;
display: block;
overflow: hidden;
padding-right: 50px;
font-weight: bold;
}
.loginInput {
float: left;
color: #6B6B6B;
width: 320px;
background-color: #F4F4F4;
border: 1px;
border-style: solid;
border-color: #c4c4c4;
padding: 6px;
margin-bottom: 12px;
}
fieldset {
width: 350px;
padding: 10px 20px 10px 20px;
overflow: hidden;
border-style: none;
}
p {
font-size: 10px;
}

266
dvwa/dvwa/css/main.css Normal file
View File

@ -0,0 +1,266 @@
body {
margin: 0;
color: #2f2f2f;
font: 12px/15px Arial, Helvetica, sans-serif;
min-width: 981px;
height: 100%;
position: relative;
}
body.home {
background: #e7e7e7;
}
div.clear {
clear: both;
}
a {
color: #99cc33;
text-decoration: underline;
font-weight: bold;
}
a img {
border: 0;
}
a: hover {
text-decoration: none;
}
input, textarea, select {
font: 100% arial,sans-serif;
vertical-align: middle;
}
form,fieldset {
margin: 0;
padding: 0;
border-style: none;
}
em {
font-weight: bold;
font-style: normal;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 0px;
}
h1 {
font-size: 200%;
}
h2 {
font-size: 160%;
}
h3 {
font-size: 130%;
}
hr {
border-width: 0px;
color: #C3D9FF;
background-color: #C3D9FF;
height: 1px;
}
ul.menuBlocks {
list-style-type: none;
padding-left: 0px;
margin-top: 0px;
margin-bottom: 0px;
margin-left: 0px;
}
ul + ul, ul + ul.menuBlocks, ul + h1, ul + h2, ul + p {
margin-top: 20px;
}
.fixed {
font-family: Fixed, Courier, monospace;
font-size: 13px;
}
div.warning {
border: 2px solid #ff0000;
padding: 10px 20px 10px 20px;
color: #800000;
margin-top: 15px;
margin-bottom: 15px;
}
div.warning h1 {
color: #ff0000;
}
div.message {
border: 1px solid #C0C0C0;
padding: 5px;
margin: 10px 0px 10px 0px;
background-color: #f8fafa;
width: 45%;
}
div#container {
width: 900px;
height: 100%;
margin-left: auto;
margin-right: auto;
background: #f4f4f4;
font-size: 13px;
}
div#header {
padding: 10px;
overflow: hidden;
background: #2f2f2f;
border-bottom: 5px solid #A1CC33;
text-align: center;
}
div#system_info {
padding: 10px;
text-align: right;
}
div#main_body {
float: right;
width: 693px;
background: #f4f4f4;
padding-top: 20px;
padding-bottom: 10px;
font-size: 13px;
}
div.body_padded {
padding-left: 20px;
padding-right: 20px;
}
div#main_menu {
float: left;
width: 200px;
height: 100%;
background-color: #f4f4f4;
padding-top: 10px;
padding-bottom: 10px;
}
div#main_menu li {
border-width: 1px;
border-style: solid;
border-color: #D2D4D4 #6B778C #6B778C #D2D4D4;
padding: 3px 5px 3px 5px;
margin-bottom: 3px;
background-color: #bebebe;
}
div#main_menu li a {
color: #000000;
text-decoration: none;
text-decoration: none;
}
div#main_menu li.selected {
border-color: #758DAE #758DAE #758DAE #758DAE;
background-color: #99cc33;
}
div#main_menu li.selected a {
color: #F9F7ED;
}
div#main_menu li: hover {
border-color: #D2D4D4;
}
div#main_menu li: hover a {
color: #F9F7ED;
}
div#main_menu_padded {
padding: 15px;
}
div#footer {
color: #999999;
background: #2f2f2f;
padding: 10px;
text-align: center;
border-top: 5px solid #A1CC33;
}
input.popup_button {
border-width: 1px;
border-style: solid;
border-color: #D2D4D4 #6B778C #6B778C #D2D4D4;
padding: 3px 5px 3px 5px;
margin-bottom: 3px;
background-color: #C3C3C3;
float: right;
}
div.vulnerable_code_area {
background-color: #f8fafa;
border-width: 1px;
border-style: solid;
border-color: #000000;
padding: 10px 20px 10px 20px;
margin-bottom: 20px;
}
div#guestbook_comments {
width: 45%;
background-color: #f8fafa;
border-width: 1px;
border-style: solid;
border-color: #C0C0C0;
padding: 5px 10px 5px 10px;
margin-bottom: 5px;
}
div#idslog {
border: 1px solid #C0C0C0;
padding: 5px;
margin: 10px 0px 10px 0px;
background-color: #f8fafa;
}
pre {
color: red;
}
div.submenu {
border-bottom: 1px solid #000000;
margin-bottom: 15px;
padding: 4px 0px 10px 0px;
font-size: 13px;
}
span.submenu_item {
padding: 0px 10px 0px 10px;
}
span.submenu_item + span.submenu_item {
border-left: 1px dashed #000000;
font-size: 13px;
}
span.selected {
font-weight: bold;
}
span.success {
color:green;
}
span.failure {
color:red;
font-weight: bold;
}

20
dvwa/dvwa/css/source.css Normal file
View File

@ -0,0 +1,20 @@
body {
background-color: #e7e7e7;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
}
h1 {
font-size: 25px;
}
div#container {
}
div#code {
background-color: #ffffff;
}
div#area {
margin-left: 30px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
dvwa/dvwa/images/dollar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

BIN
dvwa/dvwa/images/lock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

BIN
dvwa/dvwa/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

View File

@ -0,0 +1,87 @@
<?php
/*
This file contains all of the code to setup the initial MySQL database. (setup.php)
*/
if( !@mysql_connect( $_DVWA[ 'db_server' ], $_DVWA[ 'db_user' ], $_DVWA[ 'db_password' ] ) ) {
dvwaMessagePush( "Could not connect to the database.<br/>Please check the config file." );
dvwaPageReload();
}
// Create database
$drop_db = "DROP DATABASE IF EXISTS {$_DVWA[ 'db_database' ]};";
if( !@mysql_query( $drop_db ) ) {
dvwaMessagePush( "Could not drop existing database<br />SQL: ".mysql_error() );
dvwaPageReload();
}
$create_db = "CREATE DATABASE {$_DVWA[ 'db_database' ]};";
if( !@mysql_query( $create_db ) ) {
dvwaMessagePush( "Could not create database<br />SQL: ".mysql_error() );
dvwaPageReload();
}
dvwaMessagePush( "Database has been created." );
// Create table 'users'
if( !@mysql_select_db( $_DVWA[ 'db_database' ] ) ) {
dvwaMessagePush( 'Could not connect to database.' );
dvwaPageReload();
}
$create_tb = "CREATE TABLE users (user_id int(6),first_name varchar(15),last_name varchar(15), user varchar(15), password varchar(32),avatar varchar(70), last_login TIMESTAMP, failed_login INT(3), PRIMARY KEY (user_id));";
if( !mysql_query( $create_tb ) ) {
dvwaMessagePush( "Table could not be created<br />SQL: ".mysql_error() );
dvwaPageReload();
}
dvwaMessagePush( "'users' table was created." );
// Insert some data into users
// Get the base directory for the avatar media...
$baseUrl = 'http://'.$_SERVER[ 'SERVER_NAME' ].$_SERVER[ 'PHP_SELF' ];
$stripPos = strpos( $baseUrl, 'setup.php' );
$baseUrl = substr( $baseUrl, 0, $stripPos ).'hackable/users/';
$insert = "INSERT INTO users VALUES
('1','admin','admin','admin',MD5('password'),'{$baseUrl}admin.jpg', NOW(), '0'),
('2','Gordon','Brown','gordonb',MD5('abc123'),'{$baseUrl}gordonb.jpg', NOW(), '0'),
('3','Hack','Me','1337',MD5('charley'),'{$baseUrl}1337.jpg', NOW(), '0'),
('4','Pablo','Picasso','pablo',MD5('letmein'),'{$baseUrl}pablo.jpg', NOW(), '0'),
('5','Bob','Smith','smithy',MD5('password'),'{$baseUrl}smithy.jpg', NOW(), '0');";
if( !mysql_query( $insert ) ) {
dvwaMessagePush( "Data could not be inserted into 'users' table<br />SQL: ".mysql_error() );
dvwaPageReload();
}
dvwaMessagePush( "Data inserted into 'users' table." );
// Create guestbook table
$create_tb_guestbook = "CREATE TABLE guestbook (comment_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, comment varchar(300), name varchar(100), PRIMARY KEY (comment_id));";
if( !mysql_query( $create_tb_guestbook ) ) {
dvwaMessagePush( "Table could not be created<br />SQL: ".mysql_error() );
dvwaPageReload();
}
dvwaMessagePush( "'guestbook' table was created." );
// Insert data into 'guestbook'
$insert = "INSERT INTO guestbook VALUES ('1','This is a test comment.','test');";
if( !mysql_query( $insert ) ) {
dvwaMessagePush( "Data could not be inserted into 'guestbook' table<br />SQL: ".mysql_error() );
dvwaPageReload();
}
dvwaMessagePush( "Data inserted into 'guestbook' table." );
// Done
dvwaMessagePush( "<em>Setup successful</em>!" );
if( !dvwaIsLoggedIn())
dvwaMessagePush( "Please <a href='login.php'>login</a>.<script>setTimeout(function(){window.location.href='login.php'},5000);</script>" );
dvwaPageReload();
?>

View File

@ -0,0 +1,105 @@
<?php
/*
This file contains all of the code to setup the initial PostgreSQL database. (setup.php)
*/
// Connect to server
if( !@pg_connect("host={$_DVWA[ 'db_server' ]} port={$_DVWA[ 'db_port' ]} user={$_DVWA[ 'db_user' ]} password={$_DVWA[ 'db_password' ]}") ) {
dvwaMessagePush( "Could not connect to the database.<br/>Please check the config file." );
dvwaPageReload();
}
// Create database
$drop_db = "DROP DATABASE IF EXISTS {$_DVWA[ 'db_database' ]};";
if( !@pg_query($drop_db) ) {
dvwaMessagePush( "Could not drop existing database<br />SQL: " . pg_last_error() );
dvwaPageReload();
}
$create_db = "CREATE DATABASE {$_DVWA[ 'db_database' ]};";
if( !@pg_query ( $create_db ) ) {
dvwaMessagePush( "Could not create database<br />SQL: " . pg_last_error() );
dvwaPageReload();
}
dvwaMessagePush( "Database has been created." );
// Connect to server AND connect to the database
$dbconn = @pg_connect("host={$_DVWA[ 'db_server' ]} port={$_DVWA[ 'db_port' ]} dbname={$_DVWA[ 'db_database' ]} user={$_DVWA[ 'db_user' ]} password={$_DVWA[ 'db_password' ]}");
// Create table 'users'
$drop_table = "DROP TABLE IF EXISTS users;";
if( !pg_query($drop_table) ) {
dvwaMessagePush( "Could not drop existing users table<br />SQL: " . pg_last_error() );
dvwaPageReload();
}
$create_tb = "CREATE TABLE users (user_id integer UNIQUE, first_name text, last_name text, username text, password text, avatar text, PRIMARY KEY (user_id));";
if( !pg_query( $create_tb ) ) {
dvwaMessagePush( "Table could not be created<br />SQL: " . pg_last_error() );
dvwaPageReload();
}
dvwaMessagePush( "'users' table was created." );
// Get the base directory for the avatar media...
$baseUrl = 'http://'.$_SERVER[ 'SERVER_NAME' ].$_SERVER[ 'PHP_SELF' ];
$stripPos = strpos( $baseUrl, 'dvwa/setup.php' );
$baseUrl = substr( $baseUrl, 0, $stripPos ).'dvwa/hackable/users/';
$insert = "INSERT INTO users VALUES
('1','admin','admin','admin',MD5('password'),'{$baseUrl}admin.jpg'),
('2','Gordon','Brown','gordonb',MD5('abc123'),'{$baseUrl}gordonb.jpg'),
('3','Hack','Me','1337',MD5('charley'),'{$baseUrl}1337.jpg'),
('4','Pablo','Picasso','pablo',MD5('letmein'),'{$baseUrl}pablo.jpg'),
('5','bob','smith','smithy',MD5('password'),'{$baseUrl}smithy.jpg');";
if( !pg_query( $insert ) ) {
dvwaMessagePush( "Data could not be inserted into 'users' table<br />SQL: " . pg_last_error() );
dvwaPageReload();
}
dvwaMessagePush( "Data inserted into 'users' table." );
// Create guestbook table
$drop_table = "DROP table IF EXISTS guestbook;";
if( !@pg_query($drop_table) ) {
dvwaMessagePush( "Could not drop existing users table<br />SQL: " . pg_last_error() );
dvwaPageReload();
}
$create_tb_guestbook = "CREATE TABLE guestbook (comment text, name text, comment_id SERIAL PRIMARY KEY);";
if( !pg_query( $create_tb_guestbook ) ) {
dvwaMessagePush( "guestbook table could not be created<br />SQL: " . pg_last_error() );
dvwaPageReload();
}
dvwaMessagePush( "'guestbook' table was created." );
// Insert data into 'guestbook'
$insert = "INSERT INTO guestbook (comment, name) VALUES('This is a test comment.','admin')";
if( !pg_query( $insert ) ) {
dvwaMessagePush( "Data could not be inserted into 'guestbook' table<br />SQL: " . pg_last_error() );
dvwaPageReload();
}
dvwaMessagePush( "Data inserted into 'guestbook' table." );
dvwaMessagePush( "Setup successful!" );
dvwaPageReload();
pg_close($dbconn);
?>

View File

@ -0,0 +1,562 @@
<?php
if( !defined( 'DVWA_WEB_PAGE_TO_ROOT' ) ) {
define( 'DVWA System error- WEB_PAGE_TO_ROOT undefined' );
exit;
}
session_start(); // Creates a 'Full Path Disclosure' vuln.
// Include configs
require_once DVWA_WEB_PAGE_TO_ROOT . 'config/config.inc.php';
require_once( 'dvwaPhpIds.inc.php' );
// Declare the $html variable
if( !isset( $html ) ) {
$html = "";
}
// Valid security levels
$security_levels = array('low', 'medium', 'high', 'impossible');
if( !isset( $_COOKIE[ 'security' ] ) || !in_array( $_COOKIE[ 'security' ], $security_levels ) ) {
// Set security cookie to impossible if no cookie exists
if( in_array( $_DVWA[ 'default_security_level' ], $security_levels) ) {
dvwaSecurityLevelSet( $_DVWA[ 'default_security_level' ] );
}
else {
dvwaSecurityLevelSet( 'impossible' );
}
if( $_DVWA[ 'default_phpids_level' ] == 'enabled' )
dvwaPhpIdsEnabledSet( true );
else
dvwaPhpIdsEnabledSet( false );
}
// DVWA version
function dvwaVersionGet() {
return '1.9';
}
// DVWA release date
function dvwaReleaseDateGet() {
return '2015-09-19';
}
// Start session functions --
function &dvwaSessionGrab() {
if( !isset( $_SESSION[ 'dvwa' ] ) ) {
$_SESSION[ 'dvwa' ] = array();
}
return $_SESSION[ 'dvwa' ];
}
function dvwaPageStartup( $pActions ) {
if( in_array( 'authenticated', $pActions ) ) {
if( !dvwaIsLoggedIn()) {
dvwaRedirect( DVWA_WEB_PAGE_TO_ROOT . 'login.php' );
}
}
if( in_array( 'phpids', $pActions ) ) {
if( dvwaPhpIdsIsEnabled() ) {
dvwaPhpIdsTrap();
}
}
}
function dvwaPhpIdsEnabledSet( $pEnabled ) {
$dvwaSession =& dvwaSessionGrab();
if( $pEnabled ) {
$dvwaSession[ 'php_ids' ] = 'enabled';
}
else {
unset( $dvwaSession[ 'php_ids' ] );
}
}
function dvwaPhpIdsIsEnabled() {
$dvwaSession =& dvwaSessionGrab();
return isset( $dvwaSession[ 'php_ids' ] );
}
function dvwaLogin( $pUsername ) {
$dvwaSession =& dvwaSessionGrab();
$dvwaSession[ 'username' ] = $pUsername;
}
function dvwaIsLoggedIn() {
$dvwaSession =& dvwaSessionGrab();
return isset( $dvwaSession[ 'username' ] );
}
function dvwaLogout() {
$dvwaSession =& dvwaSessionGrab();
unset( $dvwaSession[ 'username' ] );
}
function dvwaPageReload() {
dvwaRedirect( $_SERVER[ 'PHP_SELF' ] );
}
function dvwaCurrentUser() {
$dvwaSession =& dvwaSessionGrab();
return ( isset( $dvwaSession[ 'username' ]) ? $dvwaSession[ 'username' ] : '') ;
}
// -- END (Session functions)
function &dvwaPageNewGrab() {
$returnArray = array(
'title' => 'Damn Vulnerable Web Application (DVWA) v' . dvwaVersionGet() . '',
'title_separator' => ' :: ',
'body' => '',
'page_id' => '',
'help_button' => '',
'source_button' => '',
);
return $returnArray;
}
function dvwaSecurityLevelGet() {
return isset( $_COOKIE[ 'security' ] ) ? $_COOKIE[ 'security' ] : 'impossible';
}
function dvwaSecurityLevelSet( $pSecurityLevel ) {
if( $pSecurityLevel == 'impossible' ) {
$httponly = true;
}
else {
$httponly = false;
}
setcookie( session_name(), session_id(), null, '/', null, null, $httponly );
setcookie( 'security', $pSecurityLevel, NULL, NULL, NULL, NULL, $httponly );
}
// Start message functions --
function dvwaMessagePush( $pMessage ) {
$dvwaSession =& dvwaSessionGrab();
if( !isset( $dvwaSession[ 'messages' ] ) ) {
$dvwaSession[ 'messages' ] = array();
}
$dvwaSession[ 'messages' ][] = $pMessage;
}
function dvwaMessagePop() {
$dvwaSession =& dvwaSessionGrab();
if( !isset( $dvwaSession[ 'messages' ] ) || count( $dvwaSession[ 'messages' ] ) == 0 ) {
return false;
}
return array_shift( $dvwaSession[ 'messages' ] );
}
function messagesPopAllToHtml() {
$messagesHtml = '';
while( $message = dvwaMessagePop() ) { // TODO- sharpen!
$messagesHtml .= "<div class=\"message\">{$message}</div>";
}
return $messagesHtml;
}
// --END (message functions)
function dvwaHtmlEcho( $pPage ) {
$menuBlocks = array();
$menuBlocks[ 'home' ] = array();
if( dvwaIsLoggedIn() ) {
$menuBlocks[ 'home' ][] = array( 'id' => 'home', 'name' => 'Home', 'url' => '.' );
$menuBlocks[ 'home' ][] = array( 'id' => 'instructions', 'name' => 'Instructions', 'url' => 'instructions.php' );
$menuBlocks[ 'home' ][] = array( 'id' => 'setup', 'name' => 'Setup / Reset DB', 'url' => 'setup.php' );
}
else {
$menuBlocks[ 'home' ][] = array( 'id' => 'setup', 'name' => 'Setup DVWA', 'url' => 'setup.php' );
$menuBlocks[ 'home' ][] = array( 'id' => 'instructions', 'name' => 'Instructions', 'url' => 'instructions.php' );
}
if( dvwaIsLoggedIn() ) {
$menuBlocks[ 'vulnerabilities' ] = array();
$menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'brute', 'name' => 'Brute Force', 'url' => 'vulnerabilities/brute/' );
$menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'exec', 'name' => 'Command Injection', 'url' => 'vulnerabilities/exec/' );
$menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'csrf', 'name' => 'CSRF', 'url' => 'vulnerabilities/csrf/' );
$menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'fi', 'name' => 'File Inclusion', 'url' => 'vulnerabilities/fi/.?page=include.php' );
$menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'upload', 'name' => 'File Upload', 'url' => 'vulnerabilities/upload/' );
$menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'captcha', 'name' => 'Insecure CAPTCHA', 'url' => 'vulnerabilities/captcha/' );
$menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'sqli', 'name' => 'SQL Injection', 'url' => 'vulnerabilities/sqli/' );
$menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'sqli_blind', 'name' => 'SQL Injection (Blind)', 'url' => 'vulnerabilities/sqli_blind/' );
$menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'xss_r', 'name' => 'XSS (Reflected)', 'url' => 'vulnerabilities/xss_r/' );
$menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'xss_s', 'name' => 'XSS (Stored)', 'url' => 'vulnerabilities/xss_s/' );
}
$menuBlocks[ 'meta' ] = array();
if( dvwaIsLoggedIn() ) {
$menuBlocks[ 'meta' ][] = array( 'id' => 'security', 'name' => 'DVWA Security', 'url' => 'security.php' );
$menuBlocks[ 'meta' ][] = array( 'id' => 'phpinfo', 'name' => 'PHP Info', 'url' => 'phpinfo.php' );
}
$menuBlocks[ 'meta' ][] = array( 'id' => 'about', 'name' => 'About', 'url' => 'about.php' );
if( dvwaIsLoggedIn() ) {
$menuBlocks[ 'logout' ] = array();
$menuBlocks[ 'logout' ][] = array( 'id' => 'logout', 'name' => 'Logout', 'url' => 'logout.php' );
}
$menuHtml = '';
foreach( $menuBlocks as $menuBlock ) {
$menuBlockHtml = '';
foreach( $menuBlock as $menuItem ) {
$selectedClass = ( $menuItem[ 'id' ] == $pPage[ 'page_id' ] ) ? 'selected' : '';
$fixedUrl = DVWA_WEB_PAGE_TO_ROOT.$menuItem[ 'url' ];
$menuBlockHtml .= "<li onclick=\"window.location='{$fixedUrl}'\" class=\"{$selectedClass}\"><a href=\"{$fixedUrl}\">{$menuItem[ 'name' ]}</a></li>\n";
}
$menuHtml .= "<ul class=\"menuBlocks\">{$menuBlockHtml}</ul>";
}
// Get security cookie --
$securityLevelHtml = '';
switch( dvwaSecurityLevelGet() ) {
case 'low':
$securityLevelHtml = 'low';
break;
case 'medium':
$securityLevelHtml = 'medium';
break;
case 'high':
$securityLevelHtml = 'high';
break;
default:
$securityLevelHtml = 'impossible';
break;
}
// -- END (security cookie)
$phpIdsHtml = '<em>PHPIDS:</em> ' . ( dvwaPhpIdsIsEnabled() ? 'enabled' : 'disabled' );
$userInfoHtml = '<em>Username:</em> ' . ( dvwaCurrentUser() );
$messagesHtml = messagesPopAllToHtml();
if( $messagesHtml ) {
$messagesHtml = "<div class=\"body_padded\">{$messagesHtml}</div>";
}
$systemInfoHtml = "";
if( dvwaIsLoggedIn() )
$systemInfoHtml = "<div align=\"left\">{$userInfoHtml}<br /><em>Security Level:</em> {$securityLevelHtml}<br />{$phpIdsHtml}</div>";
if( $pPage[ 'source_button' ] ) {
$systemInfoHtml = dvwaButtonSourceHtmlGet( $pPage[ 'source_button' ] ) . " $systemInfoHtml";
}
if( $pPage[ 'help_button' ] ) {
$systemInfoHtml = dvwaButtonHelpHtmlGet( $pPage[ 'help_button' ] ) . " $systemInfoHtml";
}
// Send Headers + main HTML code
Header( 'Cache-Control: no-cache, must-revalidate'); // HTTP/1.1
Header( 'Content-Type: text/html;charset=utf-8' ); // TODO- proper XHTML headers...
Header( 'Expires: Tue, 23 Jun 2009 12:00:00 GMT' ); // Date in the past
echo "
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\">
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />
<title>{$pPage[ 'title' ]}</title>
<link rel=\"stylesheet\" type=\"text/css\" href=\"" . DVWA_WEB_PAGE_TO_ROOT . "dvwa/css/main.css\" />
<link rel=\"icon\" type=\"\image/ico\" href=\"" . DVWA_WEB_PAGE_TO_ROOT . "favicon.ico\" />
<script type=\"text/javascript\" src=\"" . DVWA_WEB_PAGE_TO_ROOT . "dvwa/js/dvwaPage.js\"></script>
</head>
<body class=\"home\">
<div id=\"container\">
<div id=\"header\">
<img src=\"" . DVWA_WEB_PAGE_TO_ROOT . "dvwa/images/logo.png\" alt=\"Damn Vulnerable Web Application\" />
</div>
<div id=\"main_menu\">
<div id=\"main_menu_padded\">
{$menuHtml}
</div>
</div>
<div id=\"main_body\">
{$pPage[ 'body' ]}
<br /><br />
{$messagesHtml}
</div>
<div class=\"clear\">
</div>
<div id=\"system_info\">
{$systemInfoHtml}
</div>
<div id=\"footer\">
<p>Damn Vulnerable Web Application (DVWA) v" . dvwaVersionGet() . "</p>
</div>
</div>
</body>
</html>";
}
function dvwaHelpHtmlEcho( $pPage ) {
// Send Headers
Header( 'Cache-Control: no-cache, must-revalidate'); // HTTP/1.1
Header( 'Content-Type: text/html;charset=utf-8' ); // TODO- proper XHTML headers...
Header( 'Expires: Tue, 23 Jun 2009 12:00:00 GMT' ); // Date in the past
echo "
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\">
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />
<title>{$pPage[ 'title' ]}</title>
<link rel=\"stylesheet\" type=\"text/css\" href=\"" . DVWA_WEB_PAGE_TO_ROOT . "dvwa/css/help.css\" />
<link rel=\"icon\" type=\"\image/ico\" href=\"" . DVWA_WEB_PAGE_TO_ROOT . "favicon.ico\" />
</head>
<body>
<div id=\"container\">
{$pPage[ 'body' ]}
</div>
</body>
</html>";
}
function dvwaSourceHtmlEcho( $pPage ) {
// Send Headers
Header( 'Cache-Control: no-cache, must-revalidate'); // HTTP/1.1
Header( 'Content-Type: text/html;charset=utf-8' ); // TODO- proper XHTML headers...
Header( 'Expires: Tue, 23 Jun 2009 12:00:00 GMT' ); // Date in the past
echo "
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\">
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />
<title>{$pPage[ 'title' ]}</title>
<link rel=\"stylesheet\" type=\"text/css\" href=\"" . DVWA_WEB_PAGE_TO_ROOT . "dvwa/css/source.css\" />
<link rel=\"icon\" type=\"\image/ico\" href=\"" . DVWA_WEB_PAGE_TO_ROOT . "favicon.ico\" />
</head>
<body>
<div id=\"container\">
{$pPage[ 'body' ]}
</div>
</body>
</html>";
}
// To be used on all external links --
function dvwaExternalLinkUrlGet( $pLink,$text=null ) {
if(is_null( $text )) {
return '<a href="http://hiderefer.com/?' . $pLink . '" target="_blank">' . $pLink . '</a>';
}
else {
return '<a href="http://hiderefer.com/?' . $pLink . '" target="_blank">' . $text . '</a>';
}
}
// -- END ( external links)
function dvwaButtonHelpHtmlGet( $pId ) {
$security = dvwaSecurityLevelGet();
return "<input type=\"button\" value=\"View Help\" class=\"popup_button\" onClick=\"javascript:popUp( '" . DVWA_WEB_PAGE_TO_ROOT . "vulnerabilities/view_help.php?id={$pId}&security={$security}' )\">";
}
function dvwaButtonSourceHtmlGet( $pId ) {
$security = dvwaSecurityLevelGet();
return "<input type=\"button\" value=\"View Source\" class=\"popup_button\" onClick=\"javascript:popUp( '" . DVWA_WEB_PAGE_TO_ROOT . "vulnerabilities/view_source.php?id={$pId}&security={$security}' )\">";
}
// Database Management --
if( $DBMS == 'MySQL' ) {
$DBMS = htmlspecialchars(strip_tags( $DBMS ));
$DBMS_errorFunc = 'mysql_error()';
}
elseif( $DBMS == 'PGSQL' ) {
$DBMS = htmlspecialchars(strip_tags( $DBMS ));
$DBMS_errorFunc = 'pg_last_error()';
}
else {
$DBMS = "No DBMS selected.";
$DBMS_errorFunc = '';
}
//$DBMS_connError = '
// <div align="center">
// <img src="' . DVWA_WEB_PAGE_TO_ROOT . 'dvwa/images/logo.png" />
// <pre>Unable to connect to the database.<br />' . $DBMS_errorFunc . '<br /><br /></pre>
// Click <a href="' . DVWA_WEB_PAGE_TO_ROOT . 'setup.php">here</a> to setup the database.
// </div>';
function dvwaDatabaseConnect() {
global $_DVWA;
global $DBMS;
//global $DBMS_connError;
global $db;
if( $DBMS == 'MySQL' ) {
if( !@mysql_connect( $_DVWA[ 'db_server' ], $_DVWA[ 'db_user' ], $_DVWA[ 'db_password' ] )
|| !@mysql_select_db( $_DVWA[ 'db_database' ] ) ) {
//die( $DBMS_connError );
dvwaLogout();
dvwaMessagePush( 'Unable to connect to the database.<br />' . $DBMS_errorFunc );
dvwaRedirect( DVWA_WEB_PAGE_TO_ROOT . 'setup.php' );
}
// MySQL PDO Prepared Statements (for impossible levels)
$db = new PDO('mysql:host=' . $_DVWA[ 'db_server' ].';dbname=' . $_DVWA[ 'db_database' ].';charset=utf8', $_DVWA[ 'db_user' ], $_DVWA[ 'db_password' ]);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
}
elseif( $DBMS == 'PGSQL' ) {
//$dbconn = pg_connect("host={$_DVWA[ 'db_server' ]} dbname={$_DVWA[ 'db_database' ]} user={$_DVWA[ 'db_user' ]} password={$_DVWA[ 'db_password' ])}"
//or die( $DBMS_connError );
dvwaMessagePush( 'PostgreSQL is not yet fully supported.' );
dvwaPageReload();
}
else {
die ( "Unknown {$DBMS} selected." );
}
}
// -- END (Database Management)
function dvwaRedirect( $pLocation ) {
session_commit();
header( "Location: {$pLocation}" );
exit;
}
// XSS Stored guestbook function --
function dvwaGuestbook() {
$query = "SELECT name, comment FROM guestbook";
$result = mysql_query( $query );
$guestbook = '';
while( $row = mysql_fetch_row( $result ) ) {
if( dvwaSecurityLevelGet() == 'impossible' ) {
$name = htmlspecialchars( $row[0] );
$comment = htmlspecialchars( $row[1] );
}
else {
$name = $row[0];
$comment = $row[1];
}
$guestbook .= "<div id=\"guestbook_comments\">Name: {$name}<br />" . "Message: {$comment}<br /></div>\n";
}
return $guestbook;
}
// -- END (XSS Stored guestbook)
// Token functions --
function checkToken( $user_token, $session_token, $returnURL ) { # Validate the given (CSRF) token
if( $user_token !== $session_token || !isset( $session_token ) ) {
dvwaMessagePush( 'CSRF token is incorrect' );
dvwaRedirect( $returnURL );
}
}
function generateSessionToken() { # Generate a brand new (CSRF) token
if( isset( $_SESSION[ 'session_token' ] ) ) {
destroySessionToken();
}
$_SESSION[ 'session_token' ] = md5( uniqid() );
}
function destroySessionToken() { # Destroy any session with the name 'session_token'
unset( $_SESSION[ 'session_token' ] );
}
function tokenField() { # Return a field for the (CSRF) token
return "<input type='hidden' name='user_token' value='{$_SESSION[ 'session_token' ]}' />";
}
// -- END (Token functions)
// Setup Functions --
$PHPUploadPath = realpath( getcwd() ) . "/hackable/uploads/";
$PHPIDSPath = realpath( getcwd() ) . "/external/phpids/" . dvwaPhpIdsVersionGet() . "/lib/IDS/tmp/phpids_log.txt";
$phpDisplayErrors = 'PHP function display_errors: <em>' . ( ini_get( 'display_errors' ) ? 'Enabled</em> <i>(Easy Mode!)</i>' : 'Disabled</em>' ); // Verbose error messages (e.g. full path disclosure)
$phpSafeMode = 'PHP function safe_mode: <span class="' . ( ini_get( 'safe_mode' ) ? 'failure">Enabled' : 'success">Disabled' ) . '</span>'; // DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0
$phpMagicQuotes = 'PHP function magic_quotes_gpc: <span class="' . ( ini_get( 'magic_quotes_gpc' ) ? 'failure">Enabled' : 'success">Disabled' ) . '</span>'; // DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0
$phpURLInclude = 'PHP function allow_url_include: <span class="' . ( ini_get( 'allow_url_include' ) ? 'success">Enabled' : 'failure">Disabled' ) . '</span>'; // RFI
$phpURLFopen = 'PHP function allow_url_fopen: <span class="' . ( ini_get( 'allow_url_fopen' ) ? 'success">Enabled' : 'failure">Disabled' ) . '</span>'; // RFI
$phpGD = 'PHP module php-gd: <span class="' . ( ( extension_loaded( 'gd' ) && function_exists( 'gd_info' ) ) ? 'success">Installed' : 'failure">Missing' ) . '</span>'; // File Upload
$DVWARecaptcha = 'reCAPTCHA key: <span class="' . ( ( isset( $_DVWA[ 'recaptcha_public_key' ] ) && $_DVWA[ 'recaptcha_public_key' ] != '' ) ? 'success">' . $_DVWA[ 'recaptcha_public_key' ] : 'failure">Missing' ) . '</span>';
$DVWAUploadsWrite = 'Writable folder ' . $PHPUploadPath . ': <span class="' . ( is_writable( $PHPUploadPath ) ? 'success">Yes)' : 'failure">No' ) . '</span>'; // File Upload
$DVWAPHPWrite = 'Writable file ' . $PHPIDSPath . ': <span class="' . ( is_writable( $PHPIDSPath ) ? 'success">Yes' : 'failure">No' ) . '</span>'; // PHPIDS
$DVWAOS = 'Operating system: <em>' . ( strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? 'Windows' : '*nix' ) . '</em>';
$SERVER_NAME = 'Web Server SERVER_NAME: <em>' . $_SERVER[ 'SERVER_NAME' ] . '</em>'; // CSRF
// -- END (Setup Functions)
?>

View File

@ -0,0 +1,101 @@
<?php
if( !defined( 'DVWA_WEB_PAGE_TO_ROOT' ) ) {
define( 'DVWA System error- WEB_PAGE_TO_ROOT undefined' );
exit;
}
define( 'DVWA_WEB_ROOT_TO_PHPIDS', 'external/phpids/' . dvwaPhpIdsVersionGet() . '/' );
define( 'DVWA_WEB_PAGE_TO_PHPIDS', DVWA_WEB_PAGE_TO_ROOT . DVWA_WEB_ROOT_TO_PHPIDS );
// Add PHPIDS to include path
set_include_path( get_include_path() . PATH_SEPARATOR . DVWA_WEB_PAGE_TO_PHPIDS . 'lib/' );
require_once 'IDS/Init.php';
function dvwaPhpIdsVersionGet() {
return '0.6';
}
// PHPIDS Log parsing function
function dvwaReadIdsLog() {
$file_array = file( DVWA_WEB_PAGE_TO_PHPIDS_LOG );
$data = '';
foreach( $file_array as $line_number => $line ) {
$line = explode( ",", $line );
$line = str_replace( "\"", " ", $line );
$datetime = $line[1];
$vulnerability = $line[3];
$variable = urldecode($line[4]);
$request = urldecode($line[5]);
$ip = $line[6];
$data .= "<div id=\"idslog\">\n<em>Date/Time:</em> {$datetime}<br />\n<em>Vulnerability:</em> {$vulnerability}<br />\n<em>Request:</em> " . htmlspecialchars($request) . "<br />\n<em>Variable:</em> " . htmlspecialchars($variable) . "<br />\n<em>IP:</em> {$ip}</div>";
}
return $data;
}
// Clear PHPIDS log
function dvwaClearIdsLog() {
if( isset( $_GET[ 'clear_log' ] ) ) {
$fp = fopen( DVWA_WEB_PAGE_TO_PHPIDS_LOG, w );
fclose( $fp );
dvwaMessagePush( "PHPIDS log cleared" );
dvwaPageReload();
}
}
// Main PHPIDS function
function dvwaPhpIdsTrap() {
global $_DVWA;
try {
/*
* 1. Define what to scan
* Please keep in mind what array_merge does and how this might interfer
* with your variables_order settings
*/
$request = array(
'REQUEST' => $_REQUEST,
'GET' => $_GET,
'POST' => $_POST,
'COOKIE' => $_COOKIE
);
$init = IDS_Init::init( DVWA_WEB_PAGE_TO_PHPIDS . 'lib/IDS/Config/Config.ini' );
$init->config[ 'General' ][ 'base_path' ] = DVWA_WEB_PAGE_TO_PHPIDS . 'lib/IDS/';
$init->config[ 'General' ][ 'use_base_path' ] = true;
$init->config[ 'Caching' ][ 'caching' ] = 'none';
// 2. Initiate the PHPIDS and fetch the results
$ids = new IDS_Monitor( $request, $init );
$result = $ids->run();
if( !$result->isEmpty() ) {
require_once 'IDS/Log/File.php';
require_once 'IDS/Log/Composite.php';
$compositeLog = new IDS_Log_Composite();
$compositeLog->addLogger(IDS_Log_File::getInstance($init));
$compositeLog->execute($result);
echo 'Hacking attempt detected and logged.<br />Have a nice day.';
if( $_DVWA[ 'default_phpids_verbose' ] == 'true' )
echo $result;
exit;
}
}
catch (Exception $e) {
// Something went terribly wrong - maybe the filter rules weren't found?
printf( 'An error occured: %s', $e->getMessage() );
}
}
?>

35
dvwa/dvwa/js/dvwaPage.js Normal file
View File

@ -0,0 +1,35 @@
/* Help popup */
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=300,left = 540,top = 250');");
}
/* Form validation */
function validate_required(field,alerttxt)
{
with (field) {
if (value==null||value=="") {
alert(alerttxt);return false;
}
else {
return true;
}
}
}
function validate_form(thisform) {
with (thisform) {
// Guestbook form
if (validate_required(txtName,"Name can not be empty.")==false)
{txtName.focus();return false;}
if (validate_required(mtxMessage,"Message can not be empty.")==false)
{mtxMessage.focus();return false;}
}
}

165
dvwa/external/phpids/0.6/LICENSE vendored Normal file
View File

@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
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 that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU 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 as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

18
dvwa/external/phpids/0.6/build.xml vendored Normal file
View File

@ -0,0 +1,18 @@
<project name="PHPIDS" default="info">
<target name="info"/>
<target name="docs">
<phpdoc
title="PHPIDS documentation"
destdir="docs"
quiet="true"
sourcecode="true"
output="Html:frames:default"
defaultpackagename="PHPIDS"
defaultcategoryname="PHPIDS">
<fileset dir="lib">
<include name="**/*.php"/>
</fileset>
</phpdoc>
</target>
</project>

View File

@ -0,0 +1,20 @@
PHPIDS
Requirements: PHP5, SimpleXML
Copyright (c) 2007 PHPIDS (http://php-ids.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; version 2 of the license.
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.
== IMPORTANT ==
Please read header comments in ids.php for further information on how to
install this software
== IMPORTANT ==

View File

@ -0,0 +1,269 @@
<?php
/**
* PHP IDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2007 PHPIDS (http://php-ids.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; version 2 of the license.
*
* 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.
*
* @package PHPIDS
*/
/**
* HOWTO - CakePHP with PHPIDS in ten steps
*
* 0. Install the intrusion table with the intrusions.sql
* 1. Place the phpids core files (see IDS/lib) in you vendors folder:
* vendors/
* phpids/
* IDS/
* Caching/..
* Config/..
* Filter/...
* Log/...
* tmp/... (this folder needs write access!)
* Converter.php
* Event.php
* Monitor.php
* Report.php
* default_filter.xml
*
* 2. Place the intrusion.php in your model folder
* 3. Add component ids to app_controller.php components like this:
*
* var $components = array('RequestHandler', 'Ids', ...);
*
* 4. Place the ids.php in you controllers/components folder
* 5. Add the following code to the app_controller.php - right
* beneath the function head of beforeFilter():
*
* //BOF
* $bare = isset($this->params['bare'])?$this->params['bare']:0;
* if(($bare === 0 || $this->RequestHandler->isAjax()) && DEBUG == 0 && ADMIN == 0) {
* $this->Ids->detect($this);
* }
* //EOF
*
* 6. Make sure DEBUG and ADMIN are 0 if you want to test
* 7. Customize some stuff in the Config/Config.ini if you like
* 8. Inject some XSS via URL or an arbitrary form of your webapp
* 9. Please make sure you tested the use of the PHPIDS before you go live
*
* If you have problems getting the PHPIDS to work just drop us a line via our forum
*
* http://forum.php-ids.org/
*
*/
/**
* The CakePHP IDS component
*
* @package PHPIDS
*/
class IdsComponent extends Object {
/**
* define the threshold for the ids reactions
*/
private $threshold = array(
'log' => 3,
'mail' => 9,
'warn' => 27,
'kick' => 81
);
/**
* define the email addresses for idsmail
*/
private $email = array(
'address1@what.ever',
'address2@what.ever'
);
/**
* the init object
*/
private $init = NULL;
/**
* This function includes the IDS vendor parts and runs the
* detection routines on the request array.
*
* @param object cake controller object
* @return boolean
*/
public function detect(&$controller) {
$this->controller = &$controller;
$this->name = Inflector::singularize($this->controller->name);
#set include path for IDS and store old one
$path = get_include_path();
set_include_path( VENDORS . 'phpids/');
#require the needed files
vendor('phpids/IDS/Init');
#add request url and user agent
$_REQUEST['IDS_request_uri'] = $_SERVER['REQUEST_URI'];
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$_REQUEST['IDS_user_agent'] = $_SERVER['HTTP_USER_AGENT'];
}
#init the PHPIDS and pass the REQUEST array
$this->init = IDS_Init::init();
$ids = new IDS_Monitor($this->init, $_REQUEST);
$result = $ids->run();
// Re-set include path
set_include_path($path);
if (!$result->isEmpty()) {
$this->react($result);
}
return true;
}
/**
* This function rects on the values in
* the incoming results array.
*
* Depending on the impact value certain actions are
* performed.
*
* @param IDS_Report $result
* @return boolean
*/
private function react(IDS_Report $result) {
$new = $this->controller
->Session
->read('IDS.Impact') + $result->getImpact();
$this->controller->Session->write('IDS.Impact', $new);
$impact = $this->controller->Session->read('IDS.Impact');
if ($impact >= $this->threshold['kick']) {
$this->idslog($result, 3, $impact);
$this->idsmail($result);
$this->idskick($result);
return true;
} else if ($impact >= $this->threshold['warn']) {
$this->idslog($result, 2, $impact);
$this->idsmail($result);
$this->idswarn($result);
return true;
} else if ($impact >= $this->threshold['mail']) {
$this->idslog($result, 1, $impact);
$this->idsmail($result);
return true;
} else if ($impact >= $this->threshold['log']) {
$this->idslog($result, 0, $impact);
return true;
} else {
return true;
}
}
/**
* This function writes an entry about the intrusion
* to the intrusion database
*
* @param array $results
* @return boolean
*/
private function idslog($result, $reaction = 0) {
$user = $this->controller
->Session->read('User.id') ?
$this->controller->Session->read('User.id') :
0;
$ip = ($_SERVER['SERVER_ADDR'] != '127.0.0.1') ?
$_SERVER['SERVER_ADDR'] :
(isset($_SERVER['HTTP_X_FORWARDED_FOR']) ?
$_SERVER['HTTP_X_FORWARDED_FOR'] :
'127.0.0.1');
foreach ($result as $event) {
$data = array(
'Intrusion' => array(
'name' => $event->getName(),
'value' => stripslashes($event->getValue()),
'page' => $_SERVER['REQUEST_URI'],
'userid' => $user,
'session' => session_id() ? session_id() : '0',
'ip' => $ip,
'reaction' => $reaction,
'impact' => $result->getImpact()
)
);
}
loadModel('Intrusion');
$intrusion = new Intrusion;
$saveable = array('name', 'value', 'page', 'userid', 'session', 'ip', 'reaction', 'impact');
$intrusion->save($data, false, $saveable);
return true;
}
/**
* This function sends out a mail
* about the intrusion including the intrusion details
*
* @param array $results
* @return boolean
*/
private function idsmail($result) {
vendor('phpids/IDS/Log/Email.php');
vendor('phpids/IDS/Log/Composite.php');
$compositeLog = new IDS_Log_Composite();
$compositeLog->addLogger(
IDS_Log_Email::getInstance($this->init->config['IDS_Logging']['recipient'],
$this->config['IDS_Logging']['subject'],
NULL, //optional headers
$this->init->config['IDS_Logging']['safemode'],
$this->init->config['IDS_Logging']['allowed_rate'],
$this->init->config['IDS_Basic']['tmp_path'])
);
if (!$result->isEmpty()) {
$compositeLog->execute($result);
}
return true;
}
/**
* //todo
*
*
*/
private function idswarn($result) {
return $result;
}
/**
* //todo
*
*
*/
private function idskick($result) {
return $result;
}
}

View File

@ -0,0 +1,21 @@
<?php
/**
* PHP IDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2007 PHPIDS (http://php-ids.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; version 2 of the license.
*
* 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.
*/
class Intrusion extends AppModel {
//nothing to do here - unless you want to
}

View File

@ -0,0 +1,124 @@
<?php
/**
* PHPIDS
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2007 PHPIDS group (http://php-ids.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; version 2 of the license.
*
* 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.
*/
// set the include path properly for PHPIDS
set_include_path(
get_include_path()
. PATH_SEPARATOR
. '../../lib/'
);
if (!session_id()) {
session_start();
}
require_once 'IDS/Init.php';
try {
/*
* It's pretty easy to get the PHPIDS running
* 1. Define what to scan
*
* Please keep in mind what array_merge does and how this might interfer
* with your variables_order settings
*/
$request = array(
'REQUEST' => $_REQUEST,
'GET' => $_GET,
'POST' => $_POST,
'COOKIE' => $_COOKIE
);
$init = IDS_Init::init(dirname(__FILE__) . '/../../lib/IDS/Config/Config.ini');
/**
* You can also reset the whole configuration
* array or merge in own data
*
* This usage doesn't overwrite already existing values
* $config->setConfig(array('General' => array('filter_type' => 'xml')));
*
* This does (see 2nd parameter)
* $config->setConfig(array('General' => array('filter_type' => 'xml')), true);
*
* or you can access the config directly like here:
*/
$init->config['General']['base_path'] = dirname(__FILE__) . '/../../lib/IDS/';
$init->config['General']['use_base_path'] = true;
$init->config['Caching']['caching'] = 'none';
// 2. Initiate the PHPIDS and fetch the results
$ids = new IDS_Monitor($request, $init);
$result = $ids->run();
/*
* That's it - now you can analyze the results:
*
* In the result object you will find any suspicious
* fields of the passed array enriched with additional info
*
* Note: it is moreover possible to dump this information by
* simply echoing the result object, since IDS_Report implemented
* a __toString method.
*/
if (!$result->isEmpty()) {
echo $result;
/*
* The following steps are optional to log the results
*/
require_once 'IDS/Log/File.php';
require_once 'IDS/Log/Composite.php';
$compositeLog = new IDS_Log_Composite();
$compositeLog->addLogger(IDS_Log_File::getInstance($init));
/*
* Note that you might also use different logging facilities
* such as IDS_Log_Email or IDS_Log_Database
*
* Just uncomment the following lines to test the wrappers
*/
/*
*
require_once 'IDS/Log/Email.php';
require_once 'IDS/Log/Database.php';
$compositeLog->addLogger(
IDS_Log_Email::getInstance($init),
IDS_Log_Database::getInstance($init)
);
*/
$compositeLog->execute($result);
} else {
echo '<a href="?test=%22><script>eval(window.name)</script>">No attack detected - click for an example attack</a>';
}
} catch (Exception $e) {
/*
* sth went terribly wrong - maybe the
* filter rules weren't found?
*/
printf(
'An error occured: %s',
$e->getMessage()
);
}

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Caching</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class IDS_Caching</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Caching factory</p>
<p class="description"><p>This class is used as a factory to load the correct concrete caching implementation.</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> Release: $Id:Factory.php 517 2007-09-15 15:04:13Z mario $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Group</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">since:</span> Version 0.4</li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Caching---Factory.php.html">/Caching/Factory.php</a> (line <span class="field">51</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
static <span class="method-result">object the</span>
<a href="#factory" title="details" class="method-name">factory</a>
(<span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>)
</div>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="methodfactory" id="factory"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">static method factory</span> (line <span class="line-number">62</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Factory method</p>
<ul class="tags">
<li><span class="field">return:</span> caching facility</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">object the</span>
<span class="method-name">
factory
</span>
(<span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">array</span>
<span class="var-name">$init</span><span class="var-description">: the IDS_Init object</span> </li>
<li>
<span class="var-type">string</span>
<span class="var-name">$type</span><span class="var-description">: the caching type</span> </li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:44 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,244 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Caching_Database</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class IDS_Caching_Database</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<p class="implements">
Implements interfaces:
<ul>
<li><a href="../PHPIDS/IDS_Caching_Interface.html">IDS_Caching_Interface</a></li> </ul>
</p>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Database caching wrapper</p>
<p class="description"><p>This class inhabits functionality to get and set cache via a database.</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> Release: $Id:Database.php 517 2007-09-15 15:04:13Z mario $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Groupup</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">since:</span> Version 0.4</li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Caching---Database.php.html">/Caching/Database.php</a> (line <span class="field">72</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
static <span class="method-result">object</span>
<a href="#getInstance" title="details" class="method-name">getInstance</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#__construct" title="details" class="method-name">__construct</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>)
</div>
<div class="method-definition">
<span class="method-result">mixed</span>
<a href="#getCache" title="details" class="method-name">getCache</a>
()
</div>
<div class="method-definition">
<span class="method-result">object</span>
<a href="#setCache" title="details" class="method-name">setCache</a>
(<span class="var-type"></span>&nbsp;<span class="var-name">$data</span>)
</div>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="methodgetInstance" id="getInstance"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">static method getInstance</span> (line <span class="line-number">129</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns an instance of this class</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">object</span>
<span class="method-name">
getInstance
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$type</span><span class="var-description">: caching type</span> </li>
<li>
<span class="var-type">array</span>
<span class="var-name">$init</span><span class="var-description">: the IDS_Init object</span> </li>
</ul>
</div>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">Constructor __construct</span> (line <span class="line-number">113</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor</p>
<p class="description"><p>Connects to database.</p></p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
__construct
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$type</span><span class="var-description">: caching type</span> </li>
<li>
<span class="var-type">array</span>
<span class="var-name">$init</span><span class="var-description">: the IDS_Init object</span> </li>
</ul>
</div>
<a name="methodgetCache" id="getCache"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">getCache</span> (line <span class="line-number">181</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the cached data</p>
<p class="description"><p>Note that this method returns false if either type or file cache is not set</p></p>
<ul class="tags">
<li><span class="field">return:</span> cache data or false</li>
<li><span class="field">throws:</span> PDOException if a db error occurred</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">mixed</span>
<span class="method-name">
getCache
</span>
()
</div>
<hr class="separator" />
<div class="notes">Implementation of:</div>
<dl>
<dt><a href="../PHPIDS/IDS_Caching_Interface.html#methodgetCache">IDS_Caching_Interface::getCache()</a></dt>
<dd>Interface method</dd>
</dl>
</div>
<a name="methodsetCache" id="setCache"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">setCache</span> (line <span class="line-number">146</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Writes cache data into the database</p>
<ul class="tags">
<li><span class="field">throws:</span> PDOException if a db error occurred</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">object</span>
<span class="method-name">
setCache
</span>
(<span class="var-type"></span>&nbsp;<span class="var-name">$data</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">array</span>
<span class="var-name">$data</span><span class="var-description">: the caching data</span> </li>
</ul>
<hr class="separator" />
<div class="notes">Implementation of:</div>
<dl>
<dt><a href="../PHPIDS/IDS_Caching_Interface.html#methodsetCache">IDS_Caching_Interface::setCache()</a></dt>
<dd>Interface method</dd>
</dl>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:42 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,242 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Caching_File</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class IDS_Caching_File</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<p class="implements">
Implements interfaces:
<ul>
<li><a href="../PHPIDS/IDS_Caching_Interface.html">IDS_Caching_Interface</a></li> </ul>
</p>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">File caching wrapper</p>
<p class="description"><p>This class inhabits functionality to get and set cache via a static flatfile.</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> Release: $Id:File.php 517 2007-09-15 15:04:13Z mario $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Group</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">since:</span> Version 0.4</li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Caching---File.php.html">/Caching/File.php</a> (line <span class="field">52</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
static <span class="method-result">object</span>
<a href="#getInstance" title="details" class="method-name">getInstance</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#__construct" title="details" class="method-name">__construct</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>)
</div>
<div class="method-definition">
<span class="method-result">mixed</span>
<a href="#getCache" title="details" class="method-name">getCache</a>
()
</div>
<div class="method-definition">
<span class="method-result">object</span>
<a href="#setCache" title="details" class="method-name">setCache</a>
(<span class="var-type"></span>&nbsp;<span class="var-name">$data</span>)
</div>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="methodgetInstance" id="getInstance"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">static method getInstance</span> (line <span class="line-number">113</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns an instance of this class</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">object</span>
<span class="method-name">
getInstance
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$type</span><span class="var-description">: caching type</span> </li>
<li>
<span class="var-type">array</span>
<span class="var-name">$init</span><span class="var-description">: the IDS_Init object</span> </li>
</ul>
</div>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">Constructor __construct</span> (line <span class="line-number">91</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
__construct
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$type</span><span class="var-description">: caching type</span> </li>
<li>
<span class="var-type">array</span>
<span class="var-name">$init</span><span class="var-description">: the IDS_Init object</span> </li>
</ul>
</div>
<a name="methodgetCache" id="getCache"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getCache</span> (line <span class="line-number">163</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the cached data</p>
<p class="description"><p>Note that this method returns false if either type or file cache is not set</p></p>
<ul class="tags">
<li><span class="field">return:</span> cache data or false</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">mixed</span>
<span class="method-name">
getCache
</span>
()
</div>
<hr class="separator" />
<div class="notes">Implementation of:</div>
<dl>
<dt><a href="../PHPIDS/IDS_Caching_Interface.html#methodgetCache">IDS_Caching_Interface::getCache()</a></dt>
<dd>Interface method</dd>
</dl>
</div>
<a name="methodsetCache" id="setCache"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">setCache</span> (line <span class="line-number">130</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Writes cache data into the file</p>
<ul class="tags">
<li><span class="field">throws:</span> Exception if cache file couldn't be created</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">object</span>
<span class="method-name">
setCache
</span>
(<span class="var-type"></span>&nbsp;<span class="var-name">$data</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">array</span>
<span class="var-name">$data</span><span class="var-description">: the cache data</span> </li>
</ul>
<hr class="separator" />
<div class="notes">Implementation of:</div>
<dl>
<dt><a href="../PHPIDS/IDS_Caching_Interface.html#methodsetCache">IDS_Caching_Interface::setCache()</a></dt>
<dd>Interface method</dd>
</dl>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:44 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,146 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Caching_Interface</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Interface IDS_Caching_Interface</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Caching wrapper interface</p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> SVN: $Id:Interface.php 517 2007-09-15 15:04:13Z mario $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Group</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">since:</span> Version 0.4</li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Caching---Interface.php.html">/Caching/Interface.php</a> (line <span class="field">48</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
<span class="method-result">void</span>
<a href="#getCache" title="details" class="method-name">getCache</a>
()
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#setCache" title="details" class="method-name">setCache</a>
(<span class="var-type"></span>&nbsp;<span class="var-name">$data</span>)
</div>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="methodgetCache" id="getCache"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getCache</span> (line <span class="line-number">64</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Interface method</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
getCache
</span>
()
</div>
</div>
<a name="methodsetCache" id="setCache"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">setCache</span> (line <span class="line-number">57</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Interface method</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
setCache
</span>
(<span class="var-type"></span>&nbsp;<span class="var-name">$data</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">array</span>
<span class="var-name">$data</span><span class="var-description">: the cache data</span> </li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:48 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,243 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Caching_Memcached</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class IDS_Caching_Memcached</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<p class="implements">
Implements interfaces:
<ul>
<li><a href="../PHPIDS/IDS_Caching_Interface.html">IDS_Caching_Interface</a></li> </ul>
</p>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">File caching wrapper</p>
<p class="description"><p>This class inhabits functionality to get and set cache via memcached.</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> Release: $Id:Memcached.php 517 2007-09-15 15:04:13Z mario $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Groupoup</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">since:</span> Version 0.4</li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Caching---Memcached.php.html">/Caching/Memcached.php</a> (line <span class="field">52</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
static <span class="method-result">object</span>
<a href="#getInstance" title="details" class="method-name">getInstance</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#__construct" title="details" class="method-name">__construct</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>)
</div>
<div class="method-definition">
<span class="method-result">mixed</span>
<a href="#getCache" title="details" class="method-name">getCache</a>
()
</div>
<div class="method-definition">
<span class="method-result">object</span>
<a href="#setCache" title="details" class="method-name">setCache</a>
(<span class="var-type"></span>&nbsp;<span class="var-name">$data</span>)
</div>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="methodgetInstance" id="getInstance"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">static method getInstance</span> (line <span class="line-number">124</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns an instance of this class</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">object</span>
<span class="method-name">
getInstance
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$type</span><span class="var-description">: caching type</span> </li>
<li>
<span class="var-type">array</span>
<span class="var-name">$init</span><span class="var-description">: the IDS_Init object</span> </li>
</ul>
</div>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">Constructor __construct</span> (line <span class="line-number">100</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor</p>
<ul class="tags">
<li><span class="field">throws:</span> Exception if necessary files aren't writeable</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
__construct
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$type</span><span class="var-description">: caching type</span> </li>
<li>
<span class="var-type">array</span>
<span class="var-name">$init</span><span class="var-description">: the IDS_Init object</span> </li>
</ul>
</div>
<a name="methodgetCache" id="getCache"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getCache</span> (line <span class="line-number">172</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the cached data</p>
<p class="description"><p>Note that this method returns false if either type or file cache is not set</p></p>
<ul class="tags">
<li><span class="field">return:</span> cache data or false</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">mixed</span>
<span class="method-name">
getCache
</span>
()
</div>
<hr class="separator" />
<div class="notes">Implementation of:</div>
<dl>
<dt><a href="../PHPIDS/IDS_Caching_Interface.html#methodgetCache">IDS_Caching_Interface::getCache()</a></dt>
<dd>Interface method</dd>
</dl>
</div>
<a name="methodsetCache" id="setCache"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">setCache</span> (line <span class="line-number">142</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Writes cache data</p>
<ul class="tags">
<li><span class="field">throws:</span> Exception if necessary files aren't writeable</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">object</span>
<span class="method-name">
setCache
</span>
(<span class="var-type"></span>&nbsp;<span class="var-name">$data</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">array</span>
<span class="var-name">$data</span><span class="var-description">: the caching data</span> </li>
</ul>
<hr class="separator" />
<div class="notes">Implementation of:</div>
<dl>
<dt><a href="../PHPIDS/IDS_Caching_Interface.html#methodsetCache">IDS_Caching_Interface::setCache()</a></dt>
<dd>Interface method</dd>
</dl>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:50 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,241 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Caching_Session</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class IDS_Caching_Session</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<p class="implements">
Implements interfaces:
<ul>
<li><a href="../PHPIDS/IDS_Caching_Interface.html">IDS_Caching_Interface</a></li> </ul>
</p>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">File caching wrapper</p>
<p class="description"><p>This class inhabits functionality to get and set cache via session.</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> Release: $Id:Session.php 517 2007-09-15 15:04:13Z mario $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Group</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">since:</span> Version 0.4</li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Caching---Session.php.html">/Caching/Session.php</a> (line <span class="field">52</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
static <span class="method-result">object</span>
<a href="#getInstance" title="details" class="method-name">getInstance</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#__construct" title="details" class="method-name">__construct</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>)
</div>
<div class="method-definition">
<span class="method-result">mixed</span>
<a href="#getCache" title="details" class="method-name">getCache</a>
()
</div>
<div class="method-definition">
<span class="method-result">object</span>
<a href="#setCache" title="details" class="method-name">setCache</a>
(<span class="var-type"></span>&nbsp;<span class="var-name">$data</span>)
</div>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="methodgetInstance" id="getInstance"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">static method getInstance</span> (line <span class="line-number">98</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns an instance of this class</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">object</span>
<span class="method-name">
getInstance
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$type</span><span class="var-description">: caching type</span> </li>
<li>
<span class="var-type">array</span>
<span class="var-name">$init</span><span class="var-description">: the IDS_Init object</span> </li>
</ul>
</div>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">Constructor __construct</span> (line <span class="line-number">84</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
__construct
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$init</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$type</span><span class="var-description">: caching type</span> </li>
<li>
<span class="var-type">array</span>
<span class="var-name">$init</span><span class="var-description">: the IDS_Init object</span> </li>
</ul>
</div>
<a name="methodgetCache" id="getCache"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getCache</span> (line <span class="line-number">129</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the cached data</p>
<p class="description"><p>Note that this method returns false if either type or file cache is not set</p></p>
<ul class="tags">
<li><span class="field">return:</span> cache data or false</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">mixed</span>
<span class="method-name">
getCache
</span>
()
</div>
<hr class="separator" />
<div class="notes">Implementation of:</div>
<dl>
<dt><a href="../PHPIDS/IDS_Caching_Interface.html#methodgetCache">IDS_Caching_Interface::getCache()</a></dt>
<dd>Interface method</dd>
</dl>
</div>
<a name="methodsetCache" id="setCache"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">setCache</span> (line <span class="line-number">115</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Writes cache data into the session</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">object</span>
<span class="method-name">
setCache
</span>
(<span class="var-type"></span>&nbsp;<span class="var-name">$data</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">array</span>
<span class="var-name">$data</span><span class="var-description">: the caching data</span> </li>
</ul>
<hr class="separator" />
<div class="notes">Implementation of:</div>
<dl>
<dt><a href="../PHPIDS/IDS_Caching_Interface.html#methodsetCache">IDS_Caching_Interface::setCache()</a></dt>
<dd>Interface method</dd>
</dl>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:53 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,720 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Converter</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class IDS_Converter</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS specific utility class to convert charsets manually</p>
<p class="description"><p>Note that if you make use of IDS_Converter::runAll(), existing class methods will be executed in the same order as they are implemented in the class tree!</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> Release: $Id:Converter.php 517 2007-09-15 15:04:13Z mario $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Group</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Converter.php.html">/Converter.php</a> (line <span class="field">51</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#convertConcatenations" title="details" class="method-name">convertConcatenations</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#convertEntities" title="details" class="method-name">convertEntities</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#convertFromCommented" title="details" class="method-name">convertFromCommented</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#convertFromControlChars" title="details" class="method-name">convertFromControlChars</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#convertFromJSCharcode" title="details" class="method-name">convertFromJSCharcode</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#convertFromJSUnicode" title="details" class="method-name">convertFromJSUnicode</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#convertFromNestedBase64" title="details" class="method-name">convertFromNestedBase64</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#convertFromNewLines" title="details" class="method-name">convertFromNewLines</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#convertFromOutOfRangeChars" title="details" class="method-name">convertFromOutOfRangeChars</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#convertFromProprietaryEncodings" title="details" class="method-name">convertFromProprietaryEncodings</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>, <span class="var-type"><a href="../PHPIDS/IDS_Monitor.html">IDS_Monitor</a></span>&nbsp;<span class="var-name">$monitor</span>)
</div>
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#convertFromSQLHex" title="details" class="method-name">convertFromSQLHex</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#convertFromSQLKeywords" title="details" class="method-name">convertFromSQLKeywords</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#convertFromUTF7" title="details" class="method-name">convertFromUTF7</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#convertFromXML" title="details" class="method-name">convertFromXML</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#convertJSRegexModifiers" title="details" class="method-name">convertJSRegexModifiers</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#convertQuotes" title="details" class="method-name">convertQuotes</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#runAll" title="details" class="method-name">runAll</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
static <span class="method-result">string</span>
<a href="#runCentrifuge" title="details" class="method-name">runCentrifuge</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>, [<span class="var-type"><a href="../PHPIDS/IDS_Monitor.html">IDS_Monitor</a></span>&nbsp;<span class="var-name">$monitor</span> = <span class="var-default">null</span>])
</div>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="methodconvertConcatenations" id="convertConcatenations"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">static method convertConcatenations</span> (line <span class="line-number">506</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Converts basic concatenations</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
convertConcatenations
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
</ul>
</div>
<a name="methodconvertEntities" id="convertEntities"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">static method convertEntities</span> (line <span class="line-number">229</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Converts from hex/dec entities</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
convertEntities
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
</ul>
</div>
<a name="methodconvertFromCommented" id="convertFromCommented"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">static method convertFromCommented</span> (line <span class="line-number">86</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Check for comments and erases them if available</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
convertFromCommented
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
</ul>
</div>
<a name="methodconvertFromControlChars" id="convertFromControlChars"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">static method convertFromControlChars</span> (line <span class="line-number">321</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Detects nullbytes and controls chars via ord()</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
convertFromControlChars
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
</ul>
</div>
<a name="methodconvertFromJSCharcode" id="convertFromJSCharcode"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">static method convertFromJSCharcode</span> (line <span class="line-number">134</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Checks for common charcode pattern and decodes them</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
convertFromJSCharcode
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
</ul>
</div>
<a name="methodconvertFromJSUnicode" id="convertFromJSUnicode"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">static method convertFromJSUnicode</span> (line <span class="line-number">422</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">This method converts JS unicode code points to regular characters</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
convertFromJSUnicode
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
</ul>
</div>
<a name="methodconvertFromNestedBase64" id="convertFromNestedBase64"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">static method convertFromNestedBase64</span> (line <span class="line-number">359</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">This method matches and translates base64 strings and fragments used in data URIs</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
convertFromNestedBase64
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
</ul>
</div>
<a name="methodconvertFromNewLines" id="convertFromNewLines"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">static method convertFromNewLines</span> (line <span class="line-number">116</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Strip newlines</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
convertFromNewLines
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
</ul>
</div>
<a name="methodconvertFromOutOfRangeChars" id="convertFromOutOfRangeChars"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">static method convertFromOutOfRangeChars</span> (line <span class="line-number">383</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Detects nullbytes and controls chars via ord()</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
convertFromOutOfRangeChars
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
</ul>
</div>
<a name="methodconvertFromProprietaryEncodings" id="convertFromProprietaryEncodings"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">static method convertFromProprietaryEncodings</span> (line <span class="line-number">558</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">This method collects and decodes proprietary encoding types</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
convertFromProprietaryEncodings
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>, <span class="var-type"><a href="../PHPIDS/IDS_Monitor.html">IDS_Monitor</a></span>&nbsp;<span class="var-name">$monitor</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
<li>
<span class="var-type"><a href="../PHPIDS/IDS_Monitor.html">IDS_Monitor</a></span>
<span class="var-name">$monitor</span><span class="var-description">: the monitor object</span> </li>
</ul>
</div>
<a name="methodconvertFromSQLHex" id="convertFromSQLHex"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">static method convertFromSQLHex</span> (line <span class="line-number">266</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Converts SQLHEX to plain text</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
convertFromSQLHex
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
</ul>
</div>
<a name="methodconvertFromSQLKeywords" id="convertFromSQLKeywords"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">static method convertFromSQLKeywords</span> (line <span class="line-number">291</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Converts basic SQL keywords and obfuscations</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
convertFromSQLKeywords
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
</ul>
</div>
<a name="methodconvertFromUTF7" id="convertFromUTF7"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">static method convertFromUTF7</span> (line <span class="line-number">449</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Converts relevant UTF-7 tags to UTF-8</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
convertFromUTF7
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
</ul>
</div>
<a name="methodconvertFromXML" id="convertFromXML"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">static method convertFromXML</span> (line <span class="line-number">403</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Strip XML patterns</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
convertFromXML
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
</ul>
</div>
<a name="methodconvertJSRegexModifiers" id="convertJSRegexModifiers"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">static method convertJSRegexModifiers</span> (line <span class="line-number">214</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Eliminate JS regex modifiers</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
convertJSRegexModifiers
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
</ul>
</div>
<a name="methodconvertQuotes" id="convertQuotes"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">static method convertQuotes</span> (line <span class="line-number">249</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Normalize quotes</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
convertQuotes
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
</ul>
</div>
<a name="methodrunAll" id="runAll"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">static method runAll</span> (line <span class="line-number">65</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Runs all converter functions</p>
<p class="description"><p>Note that if you make use of IDS_Converter::runAll(), existing class methods will be executed in the same order as they are implemented in the class tree!</p></p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
runAll
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
</ul>
</div>
<a name="methodrunCentrifuge" id="runCentrifuge"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">static method runCentrifuge</span> (line <span class="line-number">603</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">This method is the centrifuge prototype</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">string</span>
<span class="method-name">
runCentrifuge
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>, [<span class="var-type"><a href="../PHPIDS/IDS_Monitor.html">IDS_Monitor</a></span>&nbsp;<span class="var-name">$monitor</span> = <span class="var-default">null</span>])
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$value</span><span class="var-description">: the value to convert</span> </li>
<li>
<span class="var-type"><a href="../PHPIDS/IDS_Monitor.html">IDS_Monitor</a></span>
<span class="var-name">$monitor</span><span class="var-description">: the monitor object</span> </li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:41 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,513 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Event</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class IDS_Event</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
| <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<p class="implements">
Implements interfaces:
<ul>
<li>Countable (internal interface)</li><li>IteratorAggregate (internal interface)</li> </ul>
</p>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS event object</p>
<p class="description"><p>This class represents a certain event that occured while applying the filters to the supplied data. It aggregates a bunch of IDS_Filter implementations and is a assembled in IDS_Report.</p><p>Note that this class implements both Countable and IteratorAggregate</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> Release: $Id:Event.php 517 2007-09-15 15:04:13Z mario $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Group</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Event.php.html">/Event.php</a> (line <span class="field">53</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-var-summary"></a>
<div class="info-box">
<div class="info-box-title">Variable Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="var-summary">
<div class="var-title">
<span class="var-type">array</span>
<a href="#$filters" title="details" class="var-name">$filters</a>
</div>
<div class="var-title">
<span class="var-type">integer</span>
<a href="#$impact" title="details" class="var-name">$impact</a>
</div>
<div class="var-title">
<span class="var-type">scalar</span>
<a href="#$name" title="details" class="var-name">$name</a>
</div>
<div class="var-title">
<span class="var-type">array</span>
<a href="#$tags" title="details" class="var-name">$tags</a>
</div>
<div class="var-title">
<span class="var-type">scalar</span>
<a href="#$value" title="details" class="var-name">$value</a>
</div>
</div>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
|
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
<span class="method-result">void</span>
<a href="#__construct" title="details" class="method-name">__construct</a>
(<span class="var-type">scalar</span>&nbsp;<span class="var-name">$name</span>, <span class="var-type">scalar</span>&nbsp;<span class="var-name">$value</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$filters</span>)
</div>
<div class="method-definition">
<span class="method-result">integer</span>
<a href="#count" title="details" class="method-name">count</a>
()
</div>
<div class="method-definition">
<span class="method-result">array</span>
<a href="#getFilters" title="details" class="method-name">getFilters</a>
()
</div>
<div class="method-definition">
<span class="method-result">integer</span>
<a href="#getImpact" title="details" class="method-name">getImpact</a>
()
</div>
<div class="method-definition">
<span class="method-result">Iterator|IteratorAggregate</span>
<a href="#getIterator" title="details" class="method-name">getIterator</a>
()
</div>
<div class="method-definition">
<span class="method-result">scalar</span>
<a href="#getName" title="details" class="method-name">getName</a>
()
</div>
<div class="method-definition">
<span class="method-result">array</span>
<a href="#getTags" title="details" class="method-name">getTags</a>
()
</div>
<div class="method-definition">
<span class="method-result">scalar</span>
<a href="#getValue" title="details" class="method-name">getValue</a>
()
</div>
</div>
</div>
</div>
<a name="sec-vars"></a>
<div class="info-box">
<div class="info-box-title">Variables</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<a name="var$filters" id="$filters"><!-- --></A>
<div class="evenrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">array</span>
<span class="var-name">$filters</span>
= <span class="var-default">array()</span> (line <span class="line-number">77</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">List of filter objects</p>
<p class="description"><p>Filter objects in this array are those that matched the events value</p></p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$impact" id="$impact"><!-- --></A>
<div class="oddrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">integer</span>
<span class="var-name">$impact</span>
= <span class="var-default"> 0</span> (line <span class="line-number">86</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Calculated impact</p>
<p class="description"><p>Total impact of the event</p></p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$name" id="$name"><!-- --></A>
<div class="evenrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">scalar</span>
<span class="var-name">$name</span>
= <span class="var-default"> null</span> (line <span class="line-number">61</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Event name</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$tags" id="$tags"><!-- --></A>
<div class="oddrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">array</span>
<span class="var-name">$tags</span>
= <span class="var-default">array()</span> (line <span class="line-number">93</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Affecte tags</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$value" id="$value"><!-- --></A>
<div class="evenrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">scalar</span>
<span class="var-name">$value</span>
= <span class="var-default"> null</span> (line <span class="line-number">68</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Value of the event</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">Constructor __construct</span> (line <span class="line-number">106</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor</p>
<p class="description"><p>Fills event properties</p></p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
__construct
</span>
(<span class="var-type">scalar</span>&nbsp;<span class="var-name">$name</span>, <span class="var-type">scalar</span>&nbsp;<span class="var-name">$value</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$filters</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">scalar</span>
<span class="var-name">$name</span><span class="var-description">: the event name</span> </li>
<li>
<span class="var-type">scalar</span>
<span class="var-name">$value</span><span class="var-description">: the event value</span> </li>
<li>
<span class="var-type">array</span>
<span class="var-name">$filters</span><span class="var-description">: the corresponding filters</span> </li>
</ul>
</div>
<a name="methodcount" id="count"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">count</span> (line <span class="line-number">211</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns number of filters</p>
<p class="description"><p>To implement interface Countable this returns the number of filters appended.</p></p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">integer</span>
<span class="method-name">
count
</span>
()
</div>
<hr class="separator" />
<div class="notes">Implementation of:</div>
<dl>
<dt>Countable::count</dt>
</dl>
</div>
<a name="methodgetFilters" id="getFilters"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getFilters</span> (line <span class="line-number">198</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns list of filter objects</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">array</span>
<span class="method-name">
getFilters
</span>
()
</div>
</div>
<a name="methodgetImpact" id="getImpact"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">getImpact</span> (line <span class="line-number">162</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns calculated impact</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">integer</span>
<span class="method-name">
getImpact
</span>
()
</div>
</div>
<a name="methodgetIterator" id="getIterator"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getIterator</span> (line <span class="line-number">223</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">IteratorAggregate iterator getter</p>
<p class="description"><p>Returns an iterator to iterate over the appended filters.</p></p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">Iterator|IteratorAggregate</span>
<span class="method-name">
getIterator
</span>
()
</div>
<hr class="separator" />
<div class="notes">Implementation of:</div>
<dl>
<dt>IteratorAggregate::getIterator</dt>
</dl>
</div>
<a name="methodgetName" id="getName"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">getName</span> (line <span class="line-number">142</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns event name</p>
<p class="description"><p>The name of the event usually is the key of the variable that was considered to be malicious</p></p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">scalar</span>
<span class="method-name">
getName
</span>
()
</div>
</div>
<a name="methodgetTags" id="getTags"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getTags</span> (line <span class="line-number">179</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns affected tags</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">array</span>
<span class="method-name">
getTags
</span>
()
</div>
</div>
<a name="methodgetValue" id="getValue"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">getValue</span> (line <span class="line-number">152</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns event value</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">scalar</span>
<span class="method-name">
getValue
</span>
()
</div>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:44 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,452 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Filter</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class IDS_Filter</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
| <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS Filter object</p>
<p class="description"><p>Each object of this class serves as a container for a specific filter. The object provides methods to get information about this particular filter and also to match an arbitrary string against it.</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> Release: $Id:Filter.php 517 2007-09-15 15:04:13Z mario $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Group</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">since:</span> Version 0.4</li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Filter.php.html">/Filter.php</a> (line <span class="field">52</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-var-summary"></a>
<div class="info-box">
<div class="info-box-title">Variable Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="var-summary">
<div class="var-title">
<span class="var-type">string</span>
<a href="#$description" title="details" class="var-name">$description</a>
</div>
<div class="var-title">
<span class="var-type">integer</span>
<a href="#$impact" title="details" class="var-name">$impact</a>
</div>
<div class="var-title">
<span class="var-type">string</span>
<a href="#$rule" title="details" class="var-name">$rule</a>
</div>
<div class="var-title">
<span class="var-type">array</span>
<a href="#$tags" title="details" class="var-name">$tags</a>
</div>
</div>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
|
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
<span class="method-result">void</span>
<a href="#__construct" title="details" class="method-name">__construct</a>
(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$rule</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$description</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$tags</span>, <span class="var-type">integer</span>&nbsp;<span class="var-name">$impact</span>)
</div>
<div class="method-definition">
<span class="method-result">string</span>
<a href="#getDescription" title="details" class="method-name">getDescription</a>
()
</div>
<div class="method-definition">
<span class="method-result">integer</span>
<a href="#getId" title="details" class="method-name">getId</a>
()
</div>
<div class="method-definition">
<span class="method-result">integer</span>
<a href="#getImpact" title="details" class="method-name">getImpact</a>
()
</div>
<div class="method-definition">
<span class="method-result">string</span>
<a href="#getRule" title="details" class="method-name">getRule</a>
()
</div>
<div class="method-definition">
<span class="method-result">array</span>
<a href="#getTags" title="details" class="method-name">getTags</a>
()
</div>
<div class="method-definition">
<span class="method-result">boolean</span>
<a href="#match" title="details" class="method-name">match</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$string</span>)
</div>
</div>
</div>
</div>
<a name="sec-vars"></a>
<div class="info-box">
<div class="info-box-title">Variables</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<a name="var$description" id="$description"><!-- --></A>
<div class="oddrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">string</span>
<span class="var-name">$description</span>
= <span class="var-default"> null</span> (line <span class="line-number">81</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Filter description</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$impact" id="$impact"><!-- --></A>
<div class="evenrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">integer</span>
<span class="var-name">$impact</span>
= <span class="var-default"> 0</span> (line <span class="line-number">74</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Filter impact level</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$rule" id="$rule"><!-- --></A>
<div class="oddrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">string</span>
<span class="var-name">$rule</span>
(line <span class="line-number">60</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Filter rule</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$tags" id="$tags"><!-- --></A>
<div class="evenrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">array</span>
<span class="var-name">$tags</span>
= <span class="var-default">array()</span> (line <span class="line-number">67</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">List of tags of the filter</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">Constructor __construct</span> (line <span class="line-number">93</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
__construct
</span>
(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$rule</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$description</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$tags</span>, <span class="var-type">integer</span>&nbsp;<span class="var-name">$impact</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">mixed</span>
<span class="var-name">$rule</span><span class="var-description">: filter rule</span> </li>
<li>
<span class="var-type">string</span>
<span class="var-name">$description</span><span class="var-description">: filter description</span> </li>
<li>
<span class="var-type">array</span>
<span class="var-name">$tags</span><span class="var-description">: list of tags</span> </li>
<li>
<span class="var-type">integer</span>
<span class="var-name">$impact</span><span class="var-description">: filter impact level</span> </li>
<li>
<span class="var-type"></span>
<span class="var-name">$id</span> </li>
</ul>
</div>
<a name="methodgetDescription" id="getDescription"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">getDescription</span> (line <span class="line-number">131</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns filter description</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">string</span>
<span class="method-name">
getDescription
</span>
()
</div>
</div>
<a name="methodgetId" id="getId"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getId</span> (line <span class="line-number">174</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get filter ID</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">integer</span>
<span class="method-name">
getId
</span>
()
</div>
</div>
<a name="methodgetImpact" id="getImpact"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">getImpact</span> (line <span class="line-number">164</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get filter impact level</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">integer</span>
<span class="method-name">
getImpact
</span>
()
</div>
</div>
<a name="methodgetRule" id="getRule"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getRule</span> (line <span class="line-number">154</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns filter rule</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">string</span>
<span class="method-name">
getRule
</span>
()
</div>
</div>
<a name="methodgetTags" id="getTags"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">getTags</span> (line <span class="line-number">144</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Return list of affected tags</p>
<p class="description"><p>Each filter rule is concerned with a certain kind of attack vectors. This method returns those affected kinds.</p></p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">array</span>
<span class="method-name">
getTags
</span>
()
</div>
</div>
<a name="methodmatch" id="match"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">match</span> (line <span class="line-number">113</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Matches a string against current filter</p>
<p class="description"><p>Matches given string against the filter rule the specific object of this class represents</p></p>
<ul class="tags">
<li><span class="field">throws:</span> InvalidArgumentException if argument is no string</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">boolean</span>
<span class="method-name">
match
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$string</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$string</span><span class="var-description">: the string to match</span> </li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:45 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,419 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Filter_Storage</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class IDS_Filter_Storage</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
| <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Filter Storage</p>
<p class="description"><p>This class provides various default functions for gathering filter patterns to be used later on by the detection mechanism. You might extend this class to your requirements.</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> Release: $Id:Storage.php 517 2007-09-15 15:04:13Z mario $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Group</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Filter---Storage.php.html">/Filter/Storage.php</a> (line <span class="field">51</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-var-summary"></a>
<div class="info-box">
<div class="info-box-title">Variable Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="var-summary">
<div class="var-title">
<span class="var-type"><a href="../PHPIDS/IDS_Caching.html">object IDS_Caching</a></span>
<a href="#$cache" title="details" class="var-name">$cache</a>
</div>
<div class="var-title">
<span class="var-type">array</span>
<a href="#$cacheSettings" title="details" class="var-name">$cacheSettings</a>
</div>
<div class="var-title">
<span class="var-type">array</span>
<a href="#$filterSet" title="details" class="var-name">$filterSet</a>
</div>
<div class="var-title">
<span class="var-type">string</span>
<a href="#$source" title="details" class="var-name">$source</a>
</div>
</div>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
|
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
<span class="method-result">void</span>
<a href="#__construct" title="details" class="method-name">__construct</a>
(<span class="var-type"><a href="../PHPIDS/IDS_Init.html">IDS_Init</a></span>&nbsp;<span class="var-name">$init</span>)
</div>
<div class="method-definition">
<span class="method-result">object</span>
<a href="#addFilter" title="details" class="method-name">addFilter</a>
(<span class="var-type"><a href="../PHPIDS/IDS_Filter.html">IDS_Filter</a></span>&nbsp;<span class="var-name">$filter</span>)
</div>
<div class="method-definition">
<span class="method-result">object</span>
<a href="#getFilterFromJson" title="details" class="method-name">getFilterFromJson</a>
()
</div>
<div class="method-definition">
<span class="method-result">object</span>
<a href="#getFilterFromXML" title="details" class="method-name">getFilterFromXML</a>
()
</div>
<div class="method-definition">
<span class="method-result">array</span>
<a href="#getFilterSet" title="details" class="method-name">getFilterSet</a>
()
</div>
<div class="method-definition">
<span class="method-result">object</span>
<a href="#setFilterSet" title="details" class="method-name">setFilterSet</a>
(<span class="var-type">array</span>&nbsp;<span class="var-name">$filterSet</span>)
</div>
</div>
</div>
</div>
<a name="sec-vars"></a>
<div class="info-box">
<div class="info-box-title">Variables</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<a name="var$cache" id="$cache"><!-- --></A>
<div class="evenrow">
<div class="var-header">
<span class="var-title">
<span class="var-type"><a href="../PHPIDS/IDS_Caching.html">object IDS_Caching</a></span>
<span class="var-name">$cache</span>
= <span class="var-default"> null</span> (line <span class="line-number">73</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Cache container</p>
<ul class="tags">
<li><span class="field">var:</span> wrapper</li>
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$cacheSettings" id="$cacheSettings"><!-- --></A>
<div class="oddrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">array</span>
<span class="var-name">$cacheSettings</span>
= <span class="var-default"> null</span> (line <span class="line-number">66</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Holds caching settings</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$filterSet" id="$filterSet"><!-- --></A>
<div class="evenrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">array</span>
<span class="var-name">$filterSet</span>
= <span class="var-default">array()</span> (line <span class="line-number">80</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Filter container</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$source" id="$source"><!-- --></A>
<div class="oddrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">string</span>
<span class="var-name">$source</span>
= <span class="var-default"> null</span> (line <span class="line-number">59</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Filter source file</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">Constructor __construct</span> (line <span class="line-number">92</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor</p>
<p class="description"><p>Loads filters based on provided IDS_Init settings.</p></p>
<ul class="tags">
<li><span class="field">throws:</span> Exception if unsupported filter type is given</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
__construct
</span>
(<span class="var-type"><a href="../PHPIDS/IDS_Init.html">IDS_Init</a></span>&nbsp;<span class="var-name">$init</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">object</span>
<span class="var-name">$init</span><span class="var-description">: IDS_Init instance</span> </li>
</ul>
</div>
<a name="methodaddFilter" id="addFilter"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">addFilter</span> (line <span class="line-number">155</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Adds a filter</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">object</span>
<span class="method-name">
addFilter
</span>
(<span class="var-type"><a href="../PHPIDS/IDS_Filter.html">IDS_Filter</a></span>&nbsp;<span class="var-name">$filter</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">object</span>
<span class="var-name">$filter</span><span class="var-description">: IDS_Filter instance</span> </li>
</ul>
</div>
<a name="methodgetFilterFromJson" id="getFilterFromJson"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">getFilterFromJson</span> (line <span class="line-number">290</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Loads filters from Json file using ext/Json</p>
<p class="description"><p>This function parses the provided source file and stores the result. If caching mode is enabled the result will be cached to increase the performance.</p></p>
<ul class="tags">
<li><span class="field">throws:</span> Exception if problems with fetching the JSON data occur</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">object</span>
<span class="method-name">
getFilterFromJson
</span>
()
</div>
</div>
<a name="methodgetFilterFromXML" id="getFilterFromXML"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getFilterFromXML</span> (line <span class="line-number">190</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Loads filters from XML using SimpleXML</p>
<p class="description"><p>This function parses the provided source file and stores the result. If caching mode is enabled the result will be cached to increase the performance.</p></p>
<ul class="tags">
<li><span class="field">throws:</span> Exception if problems with fetching the XML data occur</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">object</span>
<span class="method-name">
getFilterFromXML
</span>
()
</div>
</div>
<a name="methodgetFilterSet" id="getFilterSet"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">getFilterSet</span> (line <span class="line-number">143</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns registered filters</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">array</span>
<span class="method-name">
getFilterSet
</span>
()
</div>
</div>
<a name="methodsetFilterSet" id="setFilterSet"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">setFilterSet</span> (line <span class="line-number">129</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets the filter array</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">object</span>
<span class="method-name">
setFilterSet
</span>
(<span class="var-type">array</span>&nbsp;<span class="var-name">$filterSet</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">array</span>
<span class="var-name">$filterSet</span><span class="var-description">: array containing multiple IDS_Filter instances</span> </li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:53 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,326 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Filter_Storage_Abstract</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class IDS_Filter_Storage_Abstract</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-descendents">Descendents</a>
| <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
| <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Abstract Filter Storage</p>
<p class="description"><p>Class to assure the systems API</p></p>
<ul class="tags">
<li><span class="field">author:</span> christ1an &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> $Id: Storage.php 494 2007-09-11 20:59:11Z mario $</li>
<li><span class="field">abstract:</span> </li>
</ul>
<p class="notes">
Located in <a class="field" href="_Filter---Storage---Abstract.php.html">/Filter/Storage/Abstract.php</a> (line <span class="field">31</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-descendents"></a>
<div class="info-box">
<div class="info-box-title">Direct descendents</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Descendents</span>
| <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
| <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em"><a href="../PHPIDS/IDS_Filter_Storage.html">IDS_Filter_Storage</a></td>
<td>
Filter Storage Class
</td>
</tr>
</table>
</div>
</div>
<a name="sec-var-summary"></a>
<div class="info-box">
<div class="info-box-title">Variable Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-descendents">Descendents</a> |
<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="var-summary">
<div class="var-title">
<span class="var-type">mixed</span>
<a href="#$caching" title="details" class="var-name">$caching</a>
</div>
<div class="var-title">
<span class="var-type">mixed</span>
<a href="#$filterPath" title="details" class="var-name">$filterPath</a>
</div>
</div>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-descendents">Descendents</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
|
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
<span class="method-result">void</span>
<a href="#__construct" title="details" class="method-name">__construct</a>
(<span class="var-type"><a href="../PHPIDS/IDS_Init.html">IDS_Init</a></span>&nbsp;<span class="var-name">$init</span>)
</div>
<div class="method-definition">
<span class="method-result">object</span>
<a href="#addFilter" title="details" class="method-name">addFilter</a>
(<span class="var-type"><a href="../PHPIDS/IDS_Filter.html">IDS_Filter</a></span>&nbsp;<span class="var-name">$filter</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#getFilterSet" title="details" class="method-name">getFilterSet</a>
()
</div>
<div class="method-definition">
<span class="method-result">object</span>
<a href="#setFilterSet" title="details" class="method-name">setFilterSet</a>
(<span class="var-type">array</span>&nbsp;<span class="var-name">$filterSet</span>)
</div>
</div>
</div>
</div>
<a name="sec-vars"></a>
<div class="info-box">
<div class="info-box-title">Variables</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-descendents">Descendents</a> |
<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<a name="var$caching" id="$caching"><!-- --></A>
<div class="evenrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">mixed</span>
<span class="var-name">$caching</span>
= <span class="var-default"> NULL</span> (line <span class="line-number">35</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$filterPath" id="$filterPath"><!-- --></A>
<div class="oddrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">mixed</span>
<span class="var-name">$filterPath</span>
= <span class="var-default"> NULL</span> (line <span class="line-number">33</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-descendents">Descendents</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">Constructor __construct</span> (line <span class="line-number">44</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
__construct
</span>
(<span class="var-type"><a href="../PHPIDS/IDS_Init.html">IDS_Init</a></span>&nbsp;<span class="var-name">$init</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">object</span>
<span class="var-name">$init</span> </li>
</ul>
</div>
<a name="methodaddFilter" id="addFilter"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">addFilter</span> (line <span class="line-number">96</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Adds one particular filter</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">object</span>
<span class="method-name">
addFilter
</span>
(<span class="var-type"><a href="../PHPIDS/IDS_Filter.html">IDS_Filter</a></span>&nbsp;<span class="var-name">$filter</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">object</span>
<span class="var-name">$filter</span> </li>
</ul>
</div>
<a name="methodgetFilterSet" id="getFilterSet"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">getFilterSet</span> (line <span class="line-number">85</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns array containing all filters</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
getFilterSet
</span>
()
</div>
</div>
<a name="methodsetFilterSet" id="setFilterSet"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">setFilterSet</span> (line <span class="line-number">71</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets filter array manually</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">object</span>
<span class="method-name">
setFilterSet
</span>
(<span class="var-type">array</span>&nbsp;<span class="var-name">$filterSet</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">array</span>
<span class="var-name">$filterSet</span> </li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Thu, 13 Sep 2007 22:36:58 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,413 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Init</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class IDS_Init</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
| <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Framework initiation</p>
<p class="description"><p>This class is used for the purpose to initiate the framework and inhabits functionality to parse the needed configuration file.</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> Release: $Id:Init.php 517 2007-09-15 15:04:13Z mario $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Groupup</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">since:</span> Version 0.4</li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Init.php.html">/Init.php</a> (line <span class="field">51</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-var-summary"></a>
<div class="info-box">
<div class="info-box-title">Variable Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="var-summary">
<div class="var-title">
<span class="var-type">array</span>
<a href="#$config" title="details" class="var-name">$config</a>
</div>
</div>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
|
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
static <span class="method-result">object</span>
<a href="#init" title="details" class="method-name">init</a>
([<span class="var-type">string</span>&nbsp;<span class="var-name">$configPath</span> = <span class="var-default">null</span>])
</div>
<div class="method-definition">
<span class="method-result">string</span>
<a href="#getBasePath" title="details" class="method-name">getBasePath</a>
()
</div>
<div class="method-definition">
<span class="method-result">array</span>
<a href="#getConfig" title="details" class="method-name">getConfig</a>
()
</div>
<div class="method-definition">
<span class="method-result">string</span>
<a href="#getConfigPath" title="details" class="method-name">getConfigPath</a>
()
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#setConfig" title="details" class="method-name">setConfig</a>
(<span class="var-type"></span>&nbsp;<span class="var-name">$config</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$overwrite</span> = <span class="var-default">false</span>])
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#setConfigPath" title="details" class="method-name">setConfigPath</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>)
</div>
<div class="method-definition">
<span class="method-result">array</span>
<a href="#_mergeConfig" title="details" class="method-name">_mergeConfig</a>
(<span class="var-type">array</span>&nbsp;<span class="var-name">$current</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$successor</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#__clone" title="details" class="method-name">__clone</a>
()
</div>
</div>
</div>
</div>
<a name="sec-vars"></a>
<div class="info-box">
<div class="info-box-title">Variables</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<a name="var$config" id="$config"><!-- --></A>
<div class="oddrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">array</span>
<span class="var-name">$config</span>
= <span class="var-default">array()</span> (line <span class="line-number">59</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Holds config settings</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="methodinit" id="init"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">static method init</span> (line <span class="line-number">115</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns an instance of this class. Also a PHP version check is being performed to avoid compatibility problems with PHP &lt; 5.1.6</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">object</span>
<span class="method-name">
init
</span>
([<span class="var-type">string</span>&nbsp;<span class="var-name">$configPath</span> = <span class="var-default">null</span>])
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$configPath</span><span class="var-description">: the path to the config file</span> </li>
</ul>
</div>
<a name="methodgetBasePath" id="getBasePath"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getBasePath</span> (line <span class="line-number">161</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">This method checks if a base path is given and usage is set to true.</p>
<p class="description"><p>If all that tests succeed the base path will be returned as a string - else null will be returned.</p></p>
<ul class="tags">
<li><span class="field">return:</span> the base path or null</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">string</span>
<span class="method-name">
getBasePath
</span>
()
</div>
</div>
<a name="methodgetConfig" id="getConfig"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">getConfig</span> (line <span class="line-number">220</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the config array</p>
<ul class="tags">
<li><span class="field">return:</span> the config array</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">array</span>
<span class="method-name">
getConfig
</span>
()
</div>
</div>
<a name="methodgetConfigPath" id="getConfigPath"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getConfigPath</span> (line <span class="line-number">149</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns path to configuration file</p>
<ul class="tags">
<li><span class="field">return:</span> the config path</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">string</span>
<span class="method-name">
getConfigPath
</span>
()
</div>
</div>
<a name="methodsetConfig" id="setConfig"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">setConfig</span> (line <span class="line-number">178</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Merges new settings into the exsiting ones or overwrites them</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
setConfig
</span>
(<span class="var-type"></span>&nbsp;<span class="var-name">$config</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$overwrite</span> = <span class="var-default">false</span>])
</div>
<ul class="parameters">
<li>
<span class="var-type">array</span>
<span class="var-name">$config</span><span class="var-description">: the config array</span> </li>
<li>
<span class="var-type">boolean</span>
<span class="var-name">$overwrite</span><span class="var-description">: config overwrite flag</span> </li>
</ul>
</div>
<a name="methodsetConfigPath" id="setConfigPath"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">setConfigPath</span> (line <span class="line-number">132</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets the path to the configuration file</p>
<ul class="tags">
<li><span class="field">throws:</span> Exception if file not found</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
setConfigPath
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$path</span><span class="var-description">: the path to the config</span> </li>
</ul>
</div>
<a name="method_mergeConfig" id="_mergeConfig"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">_mergeConfig</span> (line <span class="line-number">198</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Merge config hashes recursivly</p>
<p class="description"><p>The algorithm merges configuration arrays recursively. If an element is an array in both, the values will be appended. If it is a scalar in both, the value will be replaced.</p></p>
<ul class="tags">
<li><span class="field">return:</span> Merged hash</li>
<li><span class="field">access:</span> protected</li>
</ul>
<div class="method-signature">
<span class="method-result">array</span>
<span class="method-name">
_mergeConfig
</span>
(<span class="var-type">array</span>&nbsp;<span class="var-name">$current</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$successor</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">array</span>
<span class="var-name">$current</span><span class="var-description">: The legacy hash</span> </li>
<li>
<span class="var-type">array</span>
<span class="var-name">$successor</span><span class="var-description">: The hash which values count more when in doubt</span> </li>
</ul>
</div>
<a name="method__clone" id="__clone"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">__clone</span> (line <span class="line-number">103</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Permitting to clone this object</p>
<p class="description"><p>For the sake of correctness of a singleton pattern, this is necessary</p></p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
__clone
</span>
()
</div>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:48 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,243 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Log_Composite</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class IDS_Log_Composite</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
| <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Log Composite</p>
<p class="description"><p>This class implements the composite pattern to allow to work with multiple logging wrappers at once.</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> Release: $Id:Composite.php 517 2007-09-15 15:04:13Z mario $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Group</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Log---Composite.php.html">/Log/Composite.php</a> (line <span class="field">52</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-var-summary"></a>
<div class="info-box">
<div class="info-box-title">Variable Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="var-summary">
<div class="var-title">
<span class="var-type">array</span>
<a href="#$loggers" title="details" class="var-name">$loggers</a>
</div>
</div>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
|
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
<span class="method-result">void</span>
<a href="#addLogger" title="details" class="method-name">addLogger</a>
()
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#execute" title="details" class="method-name">execute</a>
(<span class="var-type"><a href="../PHPIDS/IDS_Report.html">IDS_Report</a></span>&nbsp;<span class="var-name">$data</span>)
</div>
<div class="method-definition">
<span class="method-result">boolean</span>
<a href="#removeLogger" title="details" class="method-name">removeLogger</a>
(<span class="var-type"><a href="../PHPIDS/IDS_Log_Interface.html">IDS_Log_Interface</a></span>&nbsp;<span class="var-name">$logger</span>)
</div>
</div>
</div>
</div>
<a name="sec-vars"></a>
<div class="info-box">
<div class="info-box-title">Variables</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<a name="var$loggers" id="$loggers"><!-- --></A>
<div class="evenrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">array</span>
<span class="var-name">$loggers</span>
= <span class="var-default">array()</span> (line <span class="line-number">60</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Holds registered logging wrapper</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="methodaddLogger" id="addLogger"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">addLogger</span> (line <span class="line-number">84</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Registers a new logging wrapper</p>
<p class="description"><p>Only valid IDS_Log_Interface instances passed to this function will be registered</p></p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
addLogger
</span>
()
</div>
</div>
<a name="methodexecute" id="execute"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">execute</span> (line <span class="line-number">69</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Iterates through registered loggers and executes them</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
execute
</span>
(<span class="var-type"><a href="../PHPIDS/IDS_Report.html">IDS_Report</a></span>&nbsp;<span class="var-name">$data</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">object</span>
<span class="var-name">$data</span><span class="var-description">: IDS_Report object</span> </li>
</ul>
</div>
<a name="methodremoveLogger" id="removeLogger"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">removeLogger</span> (line <span class="line-number">104</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Removes a logger</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">boolean</span>
<span class="method-name">
removeLogger
</span>
(<span class="var-type"><a href="../PHPIDS/IDS_Log_Interface.html">IDS_Log_Interface</a></span>&nbsp;<span class="var-name">$logger</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">object</span>
<span class="var-name">$logger</span><span class="var-description">: IDS_Log_Interface object</span> </li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:40 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,200 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Log_Database</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class IDS_Log_Database</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<p class="implements">
Implements interfaces:
<ul>
<li><a href="../PHPIDS/IDS_Log_Interface.html">IDS_Log_Interface</a></li> </ul>
</p>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Database logging wrapper</p>
<p class="description"><p>The database wrapper is designed to store reports into an sql database. It implements the singleton pattern and is based in PDO, supporting different database types.</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> Release: $Id:Database.php 517 2007-09-15 15:04:13Z mario $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Group</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Log---Database.php.html">/Log/Database.php</a> (line <span class="field">75</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
static <span class="method-result">object</span>
<a href="#getInstance" title="details" class="method-name">getInstance</a>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$config</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#__construct" title="details" class="method-name">__construct</a>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$config</span>)
</div>
<div class="method-definition">
<span class="method-result">boolean</span>
<a href="#execute" title="details" class="method-name">execute</a>
(<span class="var-type"><a href="../PHPIDS/IDS_Report.html">IDS_Report</a></span>&nbsp;<span class="var-name">$data</span>)
</div>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="methodgetInstance" id="getInstance"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">static method getInstance</span> (line <span class="line-number">212</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns an instance of this class</p>
<p class="description"><p>This method allows the passed argument to be either an instance of IDS_Init or an array.</p></p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">object</span>
<span class="method-name">
getInstance
</span>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$config</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">mixed</span>
<span class="var-name">$config</span><span class="var-description">: IDS_Init | array</span> </li>
</ul>
</div>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">Constructor __construct</span> (line <span class="line-number">146</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor</p>
<p class="description"><p>Prepares the SQL statement</p></p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
__construct
</span>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$config</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">mixed</span>
<span class="var-name">$config</span><span class="var-description">: IDS_Init instance | array</span> </li>
</ul>
</div>
<a name="methodexecute" id="execute"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">execute</span> (line <span class="line-number">246</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Stores given data into the database</p>
<ul class="tags">
<li><span class="field">throws:</span> Exception if db error occurred</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">boolean</span>
<span class="method-name">
execute
</span>
(<span class="var-type"><a href="../PHPIDS/IDS_Report.html">IDS_Report</a></span>&nbsp;<span class="var-name">$data</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">object</span>
<span class="var-name">$data</span><span class="var-description">: IDS_Report instance</span> </li>
</ul>
<hr class="separator" />
<div class="notes">Implementation of:</div>
<dl>
<dt><a href="../PHPIDS/IDS_Log_Interface.html#methodexecute">IDS_Log_Interface::execute()</a></dt>
<dd>Interface method</dd>
</dl>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:42 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,307 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Log_Email</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class IDS_Log_Email</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<p class="implements">
Implements interfaces:
<ul>
<li><a href="../PHPIDS/IDS_Log_Interface.html">IDS_Log_Interface</a></li> </ul>
</p>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Email logging wrapper</p>
<p class="description"><p>The Email wrapper is designed to send reports via email. It implements the singleton pattern.</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> Release: $Id:Email.php 517 2007-09-15 15:04:13Z mario $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Group</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Log---Email.php.html">/Log/Email.php</a> (line <span class="field">52</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
static <span class="method-result">object</span>
<a href="#getInstance" title="details" class="method-name">getInstance</a>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$config</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#__construct" title="details" class="method-name">__construct</a>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$config</span>)
</div>
<div class="method-definition">
<span class="method-result">boolean</span>
<a href="#execute" title="details" class="method-name">execute</a>
(<span class="var-type"><a href="../PHPIDS/IDS_Report.html">IDS_Report</a></span>&nbsp;<span class="var-name">$data</span>)
</div>
<div class="method-definition">
<span class="method-result">boolean</span>
<a href="#isSpamAttempt" title="details" class="method-name">isSpamAttempt</a>
()
</div>
<div class="method-definition">
<span class="method-result">string</span>
<a href="#prepareData" title="details" class="method-name">prepareData</a>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$data</span>)
</div>
<div class="method-definition">
<span class="method-result">boolean</span>
<a href="#send" title="details" class="method-name">send</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$data</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$headers</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$envelope</span> = <span class="var-default">null</span>])
</div>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="methodgetInstance" id="getInstance"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">static method getInstance</span> (line <span class="line-number">182</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns an instance of this class</p>
<p class="description"><p>This method allows the passed argument to be either an instance of IDS_Init or an array.</p></p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">object</span>
<span class="method-name">
getInstance
</span>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$config</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">mixed</span>
<span class="var-name">$config</span><span class="var-description">: IDS_Init | array</span> </li>
</ul>
</div>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">Constructor __construct</span> (line <span class="line-number">146</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
__construct
</span>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$config</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">mixed</span>
<span class="var-name">$config</span><span class="var-description">: IDS_Init instance | array</span> </li>
</ul>
</div>
<a name="methodexecute" id="execute"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">execute</span> (line <span class="line-number">316</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sends the report to registered recipients</p>
<ul class="tags">
<li><span class="field">throws:</span> Exception if data is no string</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">boolean</span>
<span class="method-name">
execute
</span>
(<span class="var-type"><a href="../PHPIDS/IDS_Report.html">IDS_Report</a></span>&nbsp;<span class="var-name">$data</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">object</span>
<span class="var-name">$data</span><span class="var-description">: IDS_Report instance</span> </li>
</ul>
<hr class="separator" />
<div class="notes">Implementation of:</div>
<dl>
<dt><a href="../PHPIDS/IDS_Log_Interface.html#methodexecute">IDS_Log_Interface::execute()</a></dt>
<dd>Interface method</dd>
</dl>
</div>
<a name="methodisSpamAttempt" id="isSpamAttempt"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">isSpamAttempt</span> (line <span class="line-number">210</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Detects spam attempts</p>
<p class="description"><p>To avoid mail spam through this logging class this function is used to detect such attempts based on the alert frequency.</p></p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
<div class="method-signature">
<span class="method-result">boolean</span>
<span class="method-name">
isSpamAttempt
</span>
()
</div>
</div>
<a name="methodprepareData" id="prepareData"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">prepareData</span> (line <span class="line-number">270</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Prepares data</p>
<p class="description"><p>Converts given data into a format that can be read in an email. You might edit this method to your requirements.</p></p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
<div class="method-signature">
<span class="method-result">string</span>
<span class="method-name">
prepareData
</span>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$data</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">mixed</span>
<span class="var-name">$data</span><span class="var-description">: the report data</span> </li>
</ul>
</div>
<a name="methodsend" id="send"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">send</span> (line <span class="line-number">385</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sends an email</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
<div class="method-signature">
<span class="method-result">boolean</span>
<span class="method-name">
send
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$data</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$headers</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$envelope</span> = <span class="var-default">null</span>])
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$address</span><span class="var-description">: email address</span> </li>
<li>
<span class="var-type">string</span>
<span class="var-name">$data</span><span class="var-description">: the report data</span> </li>
<li>
<span class="var-type">string</span>
<span class="var-name">$headers</span><span class="var-description">: the mail headers</span> </li>
<li>
<span class="var-type">string</span>
<span class="var-name">$envelope</span><span class="var-description">: the optional envelope string</span> </li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:43 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,234 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Log_File</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class IDS_Log_File</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<p class="implements">
Implements interfaces:
<ul>
<li><a href="../PHPIDS/IDS_Log_Interface.html">IDS_Log_Interface</a></li> </ul>
</p>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">File logging wrapper</p>
<p class="description"><p>The file wrapper is designed to store data into a flatfile. It implements the singleton pattern.</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> Release: $Id:File.php 517 2007-09-15 15:04:13Z mario $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Group</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Log---File.php.html">/Log/File.php</a> (line <span class="field">52</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
static <span class="method-result">object</span>
<a href="#getInstance" title="details" class="method-name">getInstance</a>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$config</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#__construct" title="details" class="method-name">__construct</a>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$logfile</span>)
</div>
<div class="method-definition">
<span class="method-result">mixed</span>
<a href="#execute" title="details" class="method-name">execute</a>
(<span class="var-type"><a href="../PHPIDS/IDS_Report.html">IDS_Report</a></span>&nbsp;<span class="var-name">$data</span>)
</div>
<div class="method-definition">
<span class="method-result">string</span>
<a href="#prepareData" title="details" class="method-name">prepareData</a>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$data</span>)
</div>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="methodgetInstance" id="getInstance"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">static method getInstance</span> (line <span class="line-number">110</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns an instance of this class</p>
<p class="description"><p>This method allows the passed argument to be either an instance of IDS_Init or a path to a log file. Due to the singleton pattern only one instance for each file can be initiated.</p></p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
static
<span class="method-result">object</span>
<span class="method-name">
getInstance
</span>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$config</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">mixed</span>
<span class="var-name">$config</span><span class="var-description">: IDS_Init or path to a file</span> </li>
</ul>
</div>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">Constructor __construct</span> (line <span class="line-number">86</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
__construct
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$logfile</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$logfile</span><span class="var-description">: path to the log file</span> </li>
</ul>
</div>
<a name="methodexecute" id="execute"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">execute</span> (line <span class="line-number">184</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Stores given data into a file</p>
<ul class="tags">
<li><span class="field">throws:</span> Exception if the logfile isn't writeable</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">mixed</span>
<span class="method-name">
execute
</span>
(<span class="var-type"><a href="../PHPIDS/IDS_Report.html">IDS_Report</a></span>&nbsp;<span class="var-name">$data</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">object</span>
<span class="var-name">$data</span><span class="var-description">: IDS_Report</span> </li>
</ul>
<hr class="separator" />
<div class="notes">Implementation of:</div>
<dl>
<dt><a href="../PHPIDS/IDS_Log_Interface.html#methodexecute">IDS_Log_Interface::execute()</a></dt>
<dd>Interface method</dd>
</dl>
</div>
<a name="methodprepareData" id="prepareData"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">prepareData</span> (line <span class="line-number">146</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Prepares data</p>
<p class="description"><p>Converts given data into a format that can be stored into a file. You might edit this method to your requirements.</p></p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
<div class="method-signature">
<span class="method-result">string</span>
<span class="method-name">
prepareData
</span>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$data</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">mixed</span>
<span class="var-name">$data</span><span class="var-description">: incoming report data</span> </li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:44 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,116 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Log_Interface</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Interface IDS_Log_Interface</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Interface for logging wrappers</p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> Release: $Id:Interface.php 517 2007-09-15 15:04:13Z mario $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Group</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Log---Interface.php.html">/Log/Interface.php</a> (line <span class="field">47</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
<span class="method-result">void</span>
<a href="#execute" title="details" class="method-name">execute</a>
(<span class="var-type"><a href="../PHPIDS/IDS_Report.html">IDS_Report</a></span>&nbsp;<span class="var-name">$data</span>)
</div>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="methodexecute" id="execute"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">execute</span> (line <span class="line-number">56</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Interface method</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
execute
</span>
(<span class="var-type"><a href="../PHPIDS/IDS_Report.html">IDS_Report</a></span>&nbsp;<span class="var-name">$data</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type"><a href="../PHPIDS/IDS_Report.html">IDS_Report</a></span>
<span class="var-name">$data</span><span class="var-description">: the report data</span> </li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:48 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,538 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Monitor</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class IDS_Monitor</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
| <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Monitoring engine</p>
<p class="description"><p>This class represents the core of the frameworks attack detection mechanism and provides functions to scan incoming data for malicious appearing script fragments.</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> Release: $Id:Monitor.php 949 2008-06-28 01:26:03Z christ1an $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Group</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Monitor.php.html">/Monitor.php</a> (line <span class="field">51</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-var-summary"></a>
<div class="info-box">
<div class="info-box-title">Variable Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="var-summary">
<div class="var-title">
<span class="var-type">boolean</span>
<a href="#$scanKeys" title="details" class="var-name">$scanKeys</a>
</div>
</div>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
|
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
<span class="method-result">void</span>
<a href="#__construct" title="details" class="method-name">__construct</a>
(<span class="var-type"></span>&nbsp;<span class="var-name">$request</span>, <span class="var-type"><a href="../PHPIDS/IDS_Init.html">IDS_Init</a></span>&nbsp;<span class="var-name">$init</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$tags</span> = <span class="var-default">null</span>])
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#addHtml" title="details" class="method-name">addHtml</a>
(<span class="var-type"></span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#addJson" title="details" class="method-name">addJson</a>
(<span class="var-type"></span>&nbsp;<span class="var-name">$value</span>)
</div>
<div class="method-definition">
<span class="method-result">array</span>
<a href="#getExceptions" title="details" class="method-name">getExceptions</a>
()
</div>
<div class="method-definition">
<span class="method-result">array</span>
<a href="#getHtml" title="details" class="method-name">getHtml</a>
()
</div>
<div class="method-definition">
<span class="method-result">array</span>
<a href="#getJson" title="details" class="method-name">getJson</a>
()
</div>
<div class="method-definition">
<span class="method-result"><a href="../PHPIDS/IDS_Report.html">object IDS_Report</a></span>
<a href="#getReport" title="details" class="method-name">getReport</a>
()
</div>
<div class="method-definition">
<span class="method-result">array</span>
<a href="#getStorage" title="details" class="method-name">getStorage</a>
()
</div>
<div class="method-definition">
<span class="method-result"><a href="../PHPIDS/IDS_Report.html">object IDS_Report</a></span>
<a href="#run" title="details" class="method-name">run</a>
()
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#setExceptions" title="details" class="method-name">setExceptions</a>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$exceptions</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#setHtml" title="details" class="method-name">setHtml</a>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$html</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#setJson" title="details" class="method-name">setJson</a>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$json</span>)
</div>
</div>
</div>
</div>
<a name="sec-vars"></a>
<div class="info-box">
<div class="info-box-title">Variables</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<a name="var$scanKeys" id="$scanKeys"><!-- --></A>
<div class="oddrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">boolean</span>
<span class="var-name">$scanKeys</span>
= <span class="var-default"> false</span> (line <span class="line-number">99</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Scan keys switch</p>
<p class="description"><p>Enabling this property will cause the monitor to scan both the key and the value of variables</p></p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">Constructor __construct</span> (line <span class="line-number">175</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
__construct
</span>
(<span class="var-type"></span>&nbsp;<span class="var-name">$request</span>, <span class="var-type"><a href="../PHPIDS/IDS_Init.html">IDS_Init</a></span>&nbsp;<span class="var-name">$init</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$tags</span> = <span class="var-default">null</span>])
</div>
<ul class="parameters">
<li>
<span class="var-type">array</span>
<span class="var-name">$request</span><span class="var-description">: array to scan</span> </li>
<li>
<span class="var-type">object</span>
<span class="var-name">$init</span><span class="var-description">: instance of IDS_Init</span> </li>
<li>
<span class="var-type">array</span>
<span class="var-name">$tags</span><span class="var-description">: list of tags to which filters should be applied</span> </li>
</ul>
</div>
<a name="methodaddHtml" id="addHtml"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">addHtml</span> (line <span class="line-number">589</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Adds a value to the html array</p>
<ul class="tags">
<li><span class="field">since:</span> 0.5</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
addHtml
</span>
(<span class="var-type"></span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type"></span>
<span class="var-name">$value</span> </li>
</ul>
</div>
<a name="methodaddJson" id="addJson"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">addJson</span> (line <span class="line-number">630</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Adds a value to the json array</p>
<ul class="tags">
<li><span class="field">since:</span> 0.5.3</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
addJson
</span>
(<span class="var-type"></span>&nbsp;<span class="var-name">$value</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type"></span>
<span class="var-name">$value</span> </li>
</ul>
</div>
<a name="methodgetExceptions" id="getExceptions"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getExceptions</span> (line <span class="line-number">560</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns exception array</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">array</span>
<span class="method-name">
getExceptions
</span>
()
</div>
</div>
<a name="methodgetHtml" id="getHtml"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">getHtml</span> (line <span class="line-number">601</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns html array</p>
<ul class="tags">
<li><span class="field">return:</span> the fields that contain allowed html</li>
<li><span class="field">since:</span> 0.5</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">array</span>
<span class="method-name">
getHtml
</span>
()
</div>
</div>
<a name="methodgetJson" id="getJson"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getJson</span> (line <span class="line-number">642</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns json array</p>
<ul class="tags">
<li><span class="field">return:</span> the fields that contain json</li>
<li><span class="field">since:</span> 0.5.3</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">array</span>
<span class="method-name">
getJson
</span>
()
</div>
</div>
<a name="methodgetReport" id="getReport"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">getReport</span> (line <span class="line-number">664</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns report object providing various functions to work with detected results. Also the centrifuge data is being set as property of the report object.</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result"><a href="../PHPIDS/IDS_Report.html">object IDS_Report</a></span>
<span class="method-name">
getReport
</span>
()
</div>
</div>
<a name="methodgetStorage" id="getStorage"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getStorage</span> (line <span class="line-number">652</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns storage container</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">array</span>
<span class="method-name">
getStorage
</span>
()
</div>
</div>
<a name="methodrun" id="run"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">run</span> (line <span class="line-number">233</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Starts the scan mechanism</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result"><a href="../PHPIDS/IDS_Report.html">object IDS_Report</a></span>
<span class="method-name">
run
</span>
()
</div>
</div>
<a name="methodsetExceptions" id="setExceptions"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">setExceptions</span> (line <span class="line-number">546</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets exception array</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
setExceptions
</span>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$exceptions</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">mixed</span>
<span class="var-name">$exceptions</span><span class="var-description">: the thrown exceptions</span> </li>
</ul>
</div>
<a name="methodsetHtml" id="setHtml"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">setHtml</span> (line <span class="line-number">573</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets html array</p>
<ul class="tags">
<li><span class="field">since:</span> 0.5</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
setHtml
</span>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$html</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">mixed</span>
<span class="var-name">$html</span><span class="var-description">: the fields containing html</span> </li>
</ul>
</div>
<a name="methodsetJson" id="setJson"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">setJson</span> (line <span class="line-number">614</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets json array</p>
<ul class="tags">
<li><span class="field">since:</span> 0.5.3</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
setJson
</span>
(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$json</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">mixed</span>
<span class="var-name">$json</span><span class="var-description">: the fields containing json</span> </li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:50 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,651 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs For Class IDS_Report</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="class-name">Class IDS_Report</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
| <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<p class="implements">
Implements interfaces:
<ul>
<li>Countable (internal interface)</li><li>IteratorAggregate (internal interface)</li> </ul>
</p>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS report object</p>
<p class="description"><p>The report objects collects a number of events and thereby presents the detected results. It provides a convenient API to work with the results.</p><p>Note that this class implements Countable, IteratorAggregate and a __toString() method</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">version:</span> Release: $Id:Report.php 517 2007-09-15 15:04:13Z mario $</li>
<li><span class="field">copyright:</span> 2007 The PHPIDS Group</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
<p class="notes">
Located in <a class="field" href="_Report.php.html">/Report.php</a> (line <span class="field">53</span>)
</p>
<pre></pre>
</div>
</div>
<a name="sec-var-summary"></a>
<div class="info-box">
<div class="info-box-title">Variable Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="var-summary">
<div class="var-title">
<span class="var-type">array</span>
<a href="#$centrifuge" title="details" class="var-name">$centrifuge</a>
</div>
<div class="var-title">
<span class="var-type">array</span>
<a href="#$events" title="details" class="var-name">$events</a>
</div>
<div class="var-title">
<span class="var-type">integer</span>
<a href="#$impact" title="details" class="var-name">$impact</a>
</div>
<div class="var-title">
<span class="var-type">array</span>
<a href="#$tags" title="details" class="var-name">$tags</a>
</div>
</div>
</div>
</div>
<a name="sec-method-summary"></a>
<div class="info-box">
<div class="info-box-title">Method Summary</span></div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
|
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<div class="method-summary">
<div class="method-definition">
<span class="method-result">void</span>
<a href="#__construct" title="details" class="method-name">__construct</a>
([<span class="var-type"></span>&nbsp;<span class="var-name">$events</span> = <span class="var-default">null</span>])
</div>
<div class="method-definition">
<span class="method-result">object</span>
<a href="#addEvent" title="details" class="method-name">addEvent</a>
(<span class="var-type"><a href="../PHPIDS/IDS_Event.html">IDS_Event</a></span>&nbsp;<span class="var-name">$event</span>)
</div>
<div class="method-definition">
<span class="method-result">void</span>
<a href="#clear" title="details" class="method-name">clear</a>
()
</div>
<div class="method-definition">
<span class="method-result">integer</span>
<a href="#count" title="details" class="method-name">count</a>
()
</div>
<div class="method-definition">
<span class="method-result">array/null</span>
<a href="#getCentrifuge" title="details" class="method-name">getCentrifuge</a>
()
</div>
<div class="method-definition">
<span class="method-result">mixed</span>
<a href="#getEvent" title="details" class="method-name">getEvent</a>
(<span class="var-type">scalar</span>&nbsp;<span class="var-name">$name</span>)
</div>
<div class="method-definition">
<span class="method-result">integer</span>
<a href="#getImpact" title="details" class="method-name">getImpact</a>
()
</div>
<div class="method-definition">
<span class="method-result">Iterator</span>
<a href="#getIterator" title="details" class="method-name">getIterator</a>
()
</div>
<div class="method-definition">
<span class="method-result">array</span>
<a href="#getTags" title="details" class="method-name">getTags</a>
()
</div>
<div class="method-definition">
<span class="method-result">boolean</span>
<a href="#hasEvent" title="details" class="method-name">hasEvent</a>
(<span class="var-type">scalar</span>&nbsp;<span class="var-name">$name</span>)
</div>
<div class="method-definition">
<span class="method-result">boolean</span>
<a href="#isEmpty" title="details" class="method-name">isEmpty</a>
()
</div>
<div class="method-definition">
<span class="method-result">boolean</span>
<a href="#setCentrifuge" title="details" class="method-name">setCentrifuge</a>
([<span class="var-type">array</span>&nbsp;<span class="var-name">$centrifuge</span> = <span class="var-default">array()</span>])
</div>
<div class="method-definition">
<span class="method-result">string</span>
<a href="#__toString" title="details" class="method-name">__toString</a>
()
</div>
</div>
</div>
</div>
<a name="sec-vars"></a>
<div class="info-box">
<div class="info-box-title">Variables</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
</div>
<div class="info-box-body">
<a name="var$centrifuge" id="$centrifuge"><!-- --></A>
<div class="oddrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">array</span>
<span class="var-name">$centrifuge</span>
= <span class="var-default">array()</span> (line <span class="line-number">91</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Centrifuge data</p>
<p class="description"><p>This variable - initiated as an empty array - carries all information about the centrifuge data if available</p></p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$events" id="$events"><!-- --></A>
<div class="evenrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">array</span>
<span class="var-name">$events</span>
= <span class="var-default">array()</span> (line <span class="line-number">61</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Event container</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$impact" id="$impact"><!-- --></A>
<div class="oddrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">integer</span>
<span class="var-name">$impact</span>
= <span class="var-default"> 0</span> (line <span class="line-number">81</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Impact level</p>
<p class="description"><p>The impact level is calculated on demand by adding the results of the event objects on IDS_Report-&gt;getImpact()</p></p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
<a name="var$tags" id="$tags"><!-- --></A>
<div class="evenrow">
<div class="var-header">
<span class="var-title">
<span class="var-type">array</span>
<span class="var-name">$tags</span>
= <span class="var-default">array()</span> (line <span class="line-number">71</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">List of affected tags</p>
<p class="description"><p>This list of tags is collected from the collected event objects on demand when IDS_Report-&gt;getTags() is called</p></p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
</div>
</div>
</div>
<a name="sec-methods"></a>
<div class="info-box">
<div class="info-box-title">Methods</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
</div>
<div class="info-box-body">
<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">Constructor __construct</span> (line <span class="line-number">100</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
__construct
</span>
([<span class="var-type"></span>&nbsp;<span class="var-name">$events</span> = <span class="var-default">null</span>])
</div>
<ul class="parameters">
<li>
<span class="var-type">array</span>
<span class="var-name">$events</span><span class="var-description">: the events the report should include</span> </li>
</ul>
</div>
<a name="methodaddEvent" id="addEvent"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">addEvent</span> (line <span class="line-number">116</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Adds an IDS_Event object to the report</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">object</span>
<span class="method-name">
addEvent
</span>
(<span class="var-type"><a href="../PHPIDS/IDS_Event.html">IDS_Event</a></span>&nbsp;<span class="var-name">$event</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">object</span>
<span class="var-name">$event</span><span class="var-description">: IDS_Event</span> </li>
</ul>
</div>
<a name="methodclear" id="clear"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">clear</span> (line <span class="line-number">248</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Clears calculated/collected values</p>
<ul class="tags">
<li><span class="field">access:</span> protected</li>
</ul>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
clear
</span>
()
</div>
</div>
<a name="methodcount" id="count"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">count</span> (line <span class="line-number">214</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns total amount of events</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">integer</span>
<span class="method-name">
count
</span>
()
</div>
<hr class="separator" />
<div class="notes">Implementation of:</div>
<dl>
<dt>Countable::count</dt>
</dl>
</div>
<a name="methodgetCentrifuge" id="getCentrifuge"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getCentrifuge</span> (line <span class="line-number">260</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">This method returns the centrifuge property or null if not filled with data</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">array/null</span>
<span class="method-name">
getCentrifuge
</span>
()
</div>
</div>
<a name="methodgetEvent" id="getEvent"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">getEvent</span> (line <span class="line-number">135</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get event by name</p>
<p class="description"><p>In most cases an event is identified by the key of the variable that contained maliciously appearing content</p></p>
<ul class="tags">
<li><span class="field">return:</span> IDS_Event object or false if the event does not exist</li>
<li><span class="field">throws:</span> InvalidArgumentException if argument is invalid</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">mixed</span>
<span class="method-name">
getEvent
</span>
(<span class="var-type">scalar</span>&nbsp;<span class="var-name">$name</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">scalar</span>
<span class="var-name">$name</span><span class="var-description">: the event name</span> </li>
</ul>
</div>
<a name="methodgetImpact" id="getImpact"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getImpact</span> (line <span class="line-number">179</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns total impact</p>
<p class="description"><p>Each stored IDS_Event object and its IDS_Filter sub-object are called to calculate the overall impact level of this request</p></p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">integer</span>
<span class="method-name">
getImpact
</span>
()
</div>
</div>
<a name="methodgetIterator" id="getIterator"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">getIterator</span> (line <span class="line-number">228</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Return iterator object</p>
<p class="description"><p>In order to provide the possibility to directly iterate over the IDS_Event object the IteratorAggregate is implemented. One can easily use foreach() to iterate through all stored IDS_Event objects.</p></p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">Iterator</span>
<span class="method-name">
getIterator
</span>
()
</div>
<hr class="separator" />
<div class="notes">Implementation of:</div>
<dl>
<dt>IteratorAggregate::getIterator</dt>
</dl>
</div>
<a name="methodgetTags" id="getTags"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">getTags</span> (line <span class="line-number">155</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns list of affected tags</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">array</span>
<span class="method-name">
getTags
</span>
()
</div>
</div>
<a name="methodhasEvent" id="hasEvent"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">hasEvent</span> (line <span class="line-number">200</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Checks if a specific event with given name exists</p>
<ul class="tags">
<li><span class="field">throws:</span> InvalidArgumentException if argument is illegal</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">boolean</span>
<span class="method-name">
hasEvent
</span>
(<span class="var-type">scalar</span>&nbsp;<span class="var-name">$name</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">scalar</span>
<span class="var-name">$name</span><span class="var-description">: the event name</span> </li>
</ul>
</div>
<a name="methodisEmpty" id="isEmpty"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">isEmpty</span> (line <span class="line-number">238</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Checks if any events are registered</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">boolean</span>
<span class="method-name">
isEmpty
</span>
()
</div>
</div>
<a name="methodsetCentrifuge" id="setCentrifuge"><!-- --></a>
<div class="evenrow">
<div class="method-header">
<span class="method-title">setCentrifuge</span> (line <span class="line-number">275</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">This method sets the centrifuge property</p>
<ul class="tags">
<li><span class="field">return:</span> true is arguments were valid</li>
<li><span class="field">throws:</span> InvalidArgumentException if argument is illegal</li>
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">boolean</span>
<span class="method-name">
setCentrifuge
</span>
([<span class="var-type">array</span>&nbsp;<span class="var-name">$centrifuge</span> = <span class="var-default">array()</span>])
</div>
<ul class="parameters">
<li>
<span class="var-type">array</span>
<span class="var-name">$centrifuge</span><span class="var-description">: the centrifuge data</span> </li>
</ul>
</div>
<a name="method__toString" id="__toString"><!-- --></a>
<div class="oddrow">
<div class="method-header">
<span class="method-title">__toString</span> (line <span class="line-number">289</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Directly outputs all available information</p>
<ul class="tags">
<li><span class="field">access:</span> public</li>
</ul>
<div class="method-signature">
<span class="method-result">string</span>
<span class="method-name">
__toString
</span>
()
</div>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:52 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Database.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Caching/Database.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
| <a href="#sec-includes">Includes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
| <a href="#sec-includes">Includes</a>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Caching_Database.html">IDS_Caching_Database</a>
</td>
<td>
Database caching wrapper
</td>
</tr>
</table>
</div>
</div>
<a name="sec-includes"></a>
<div class="info-box">
<div class="info-box-title">Includes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-classes">Classes</a>
| <span class="disabled">Includes</span>
</div>
<div class="info-box-body">
<a name="_IDS/Caching/Interface_php"><!-- --></a>
<div class="evenrow">
<div>
<span class="include-title">
<span class="include-type">require_once</span>
(<span class="include-name">'IDS/Caching/Interface.php'</span>)
(line <span class="line-number">34</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:42 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Factory.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Caching/Factory.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Caching.html">IDS_Caching</a>
</td>
<td>
Caching factory
</td>
</tr>
</table>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:44 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page File.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Caching/File.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
| <a href="#sec-includes">Includes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
| <a href="#sec-includes">Includes</a>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Caching_File.html">IDS_Caching_File</a>
</td>
<td>
File caching wrapper
</td>
</tr>
</table>
</div>
</div>
<a name="sec-includes"></a>
<div class="info-box">
<div class="info-box-title">Includes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-classes">Classes</a>
| <span class="disabled">Includes</span>
</div>
<div class="info-box-body">
<a name="_IDS/Caching/Interface_php"><!-- --></a>
<div class="oddrow">
<div>
<span class="include-title">
<span class="include-type">require_once</span>
(<span class="include-name">'IDS/Caching/Interface.php'</span>)
(line <span class="line-number">34</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:44 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Interface.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Caching/Interface.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Caching_Interface.html">IDS_Caching_Interface</a>
</td>
<td>
Caching wrapper interface
</td>
</tr>
</table>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:48 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Memcached.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Caching/Memcached.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
| <a href="#sec-includes">Includes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
| <a href="#sec-includes">Includes</a>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Caching_Memcached.html">IDS_Caching_Memcached</a>
</td>
<td>
File caching wrapper
</td>
</tr>
</table>
</div>
</div>
<a name="sec-includes"></a>
<div class="info-box">
<div class="info-box-title">Includes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-classes">Classes</a>
| <span class="disabled">Includes</span>
</div>
<div class="info-box-body">
<a name="_IDS/Caching/Interface_php"><!-- --></a>
<div class="oddrow">
<div>
<span class="include-title">
<span class="include-type">require_once</span>
(<span class="include-name">'IDS/Caching/Interface.php'</span>)
(line <span class="line-number">34</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:50 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Session.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Caching/Session.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
| <a href="#sec-includes">Includes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
| <a href="#sec-includes">Includes</a>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Caching_Session.html">IDS_Caching_Session</a>
</td>
<td>
File caching wrapper
</td>
</tr>
</table>
</div>
</div>
<a name="sec-includes"></a>
<div class="info-box">
<div class="info-box-title">Includes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-classes">Classes</a>
| <span class="disabled">Includes</span>
</div>
<div class="info-box-body">
<a name="_IDS/Caching/Interface_php"><!-- --></a>
<div class="oddrow">
<div>
<span class="include-title">
<span class="include-type">require_once</span>
(<span class="include-name">'IDS/Caching/Interface.php'</span>)
(line <span class="line-number">34</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:53 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Converter.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Converter.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Converter.html">IDS_Converter</a>
</td>
<td>
PHPIDS specific utility class to convert charsets manually
</td>
</tr>
</table>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:41 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Event.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Event.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Event.html">IDS_Event</a>
</td>
<td>
PHPIDS event object
</td>
</tr>
</table>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:44 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Filter.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Filter/Filter.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS Requirements: PHP5, SimpleXML</p>
<p class="description"><p>Copyright (c) 2007 PHPIDS group (http://php-ids.org)</p><p>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; version 2 of the license.</p><p>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.</p></p>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Filter.html">IDS_Filter</a>
</td>
<td>
PHPIDS Filter object
</td>
</tr>
</table>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 24 Sep 2007 20:06:51 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Abstract.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Filter/Storage/Abstract.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2007 PHPIDS (http://php-ids.org)</p><p>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; version 2 of the license.</p><p>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.</p></p>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Filter_Storage_Abstract.html">IDS_Filter_Storage_Abstract</a>
</td>
<td>
Abstract Filter Storage
</td>
</tr>
</table>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Thu, 13 Sep 2007 22:36:58 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Storage.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Filter/Storage.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Filter_Storage.html">IDS_Filter_Storage</a>
</td>
<td>
Filter Storage
</td>
</tr>
</table>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:53 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Filter.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Filter.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Filter.html">IDS_Filter</a>
</td>
<td>
PHPIDS Filter object
</td>
</tr>
</table>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:45 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Init.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Init.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Init.html">IDS_Init</a>
</td>
<td>
Framework initiation
</td>
</tr>
</table>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:48 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Composite.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Log/Composite.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
| <a href="#sec-includes">Includes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
| <a href="#sec-includes">Includes</a>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Log_Composite.html">IDS_Log_Composite</a>
</td>
<td>
Log Composite
</td>
</tr>
</table>
</div>
</div>
<a name="sec-includes"></a>
<div class="info-box">
<div class="info-box-title">Includes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-classes">Classes</a>
| <span class="disabled">Includes</span>
</div>
<div class="info-box-body">
<a name="_IDS/Log/Interface_php"><!-- --></a>
<div class="evenrow">
<div>
<span class="include-title">
<span class="include-type">require_once</span>
(<span class="include-name">'IDS/Log/Interface.php'</span>)
(line <span class="line-number">34</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:40 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Database.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Log/Database.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
| <a href="#sec-includes">Includes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
| <a href="#sec-includes">Includes</a>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Log_Database.html">IDS_Log_Database</a>
</td>
<td>
Database logging wrapper
</td>
</tr>
</table>
</div>
</div>
<a name="sec-includes"></a>
<div class="info-box">
<div class="info-box-title">Includes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-classes">Classes</a>
| <span class="disabled">Includes</span>
</div>
<div class="info-box-body">
<a name="_IDS/Log/Interface_php"><!-- --></a>
<div class="oddrow">
<div>
<span class="include-title">
<span class="include-type">require_once</span>
(<span class="include-name">'IDS/Log/Interface.php'</span>)
(line <span class="line-number">34</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:42 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Email.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Log/Email.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
| <a href="#sec-includes">Includes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
| <a href="#sec-includes">Includes</a>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Log_Email.html">IDS_Log_Email</a>
</td>
<td>
Email logging wrapper
</td>
</tr>
</table>
</div>
</div>
<a name="sec-includes"></a>
<div class="info-box">
<div class="info-box-title">Includes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-classes">Classes</a>
| <span class="disabled">Includes</span>
</div>
<div class="info-box-body">
<a name="_IDS/Log/Interface_php"><!-- --></a>
<div class="evenrow">
<div>
<span class="include-title">
<span class="include-type">require_once</span>
(<span class="include-name">'IDS/Log/Interface.php'</span>)
(line <span class="line-number">34</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:43 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page File.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Log/File.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
| <a href="#sec-includes">Includes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
| <a href="#sec-includes">Includes</a>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Log_File.html">IDS_Log_File</a>
</td>
<td>
File logging wrapper
</td>
</tr>
</table>
</div>
</div>
<a name="sec-includes"></a>
<div class="info-box">
<div class="info-box-title">Includes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-classes">Classes</a>
| <span class="disabled">Includes</span>
</div>
<div class="info-box-body">
<a name="_IDS/Log/Interface_php"><!-- --></a>
<div class="evenrow">
<div>
<span class="include-title">
<span class="include-type">require_once</span>
(<span class="include-name">'IDS/Log/Interface.php'</span>)
(line <span class="line-number">34</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:44 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Interface.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Log/Interface.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Log_Interface.html">IDS_Log_Interface</a>
</td>
<td>
Interface for logging wrappers
</td>
</tr>
</table>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:48 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Monitor.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Monitor.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Monitor.html">IDS_Monitor</a>
</td>
<td>
Monitoring engine
</td>
</tr>
</table>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:50 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page Report.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name">/Report.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-classes">Classes</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">PHPIDS</p>
<p class="description"><p>Requirements: PHP5, SimpleXML</p><p>Copyright (c) 2008 PHPIDS group (http://php-ids.org)</p><p>PHPIDS 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, version 3 of the License, or (at your option) any later version.</p><p>PHPIDS 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.</p><p>You should have received a copy of the GNU Lesser General Public License along with PHPIDS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p><p>PHP version 5.1.6+</p></p>
<ul class="tags">
<li><span class="field">author:</span> Lars Strojny &lt;<a href="mailto:lars@strojny.net">lars@strojny.net</a>&gt;</li>
<li><span class="field">author:</span> Mario Heiderich &lt;<a href="mailto:mario.heiderich@gmail.com">mario.heiderich@gmail.com</a>&gt;</li>
<li><span class="field">author:</span> Christian Matthies &lt;<a href="mailto:ch0012@gmail.com">ch0012@gmail.com</a>&gt;</li>
<li><span class="field">link:</span> <a href="http://php-ids.org/">http://php-ids.org/</a></li>
<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></li>
</ul>
</div>
</div>
<a name="sec-classes"></a>
<div class="info-box">
<div class="info-box-title">Classes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Classes</span>
</div>
<div class="info-box-body">
<table cellpadding="2" cellspacing="0" class="class-table">
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; vertical-align: top">
<a href="../PHPIDS/IDS_Report.html">IDS_Report</a>
</td>
<td>
PHPIDS report object
</td>
</tr>
</table>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:52 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</div></body>
</html>

View File

@ -0,0 +1,13 @@
<html>
<head>
<title>Generated Documentation</title>
<link rel="stylesheet" href="media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div align="center"><h1>Generated Documentation</h1></div>
<b>Welcome to default!</b><br />
<br />
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.2</a><br />
</body>
</html>

View File

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title></title>
<link rel="stylesheet" href="media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<!-- Start of Class Data -->
<H2>
</H2>
<h2>Root interface IDS_Caching_Interface</h2>
<ul>
<li><a href="PHPIDS/IDS_Caching_Interface.html">IDS_Caching_Interface</a></li></ul>
<h2>Root interface IDS_Log_Interface</h2>
<ul>
<li><a href="PHPIDS/IDS_Log_Interface.html">IDS_Log_Interface</a></li></ul>
<h2>Root class IDS_Caching</h2>
<ul>
<li><a href="PHPIDS/IDS_Caching.html">IDS_Caching</a></li></ul>
<h2>Root class IDS_Caching_Database</h2>
<ul>
<li><a href="PHPIDS/IDS_Caching_Database.html">IDS_Caching_Database</a></li></ul>
<h2>Root class IDS_Caching_File</h2>
<ul>
<li><a href="PHPIDS/IDS_Caching_File.html">IDS_Caching_File</a></li></ul>
<h2>Root class IDS_Caching_Memcached</h2>
<ul>
<li><a href="PHPIDS/IDS_Caching_Memcached.html">IDS_Caching_Memcached</a></li></ul>
<h2>Root class IDS_Caching_Session</h2>
<ul>
<li><a href="PHPIDS/IDS_Caching_Session.html">IDS_Caching_Session</a></li></ul>
<h2>Root class IDS_Converter</h2>
<ul>
<li><a href="PHPIDS/IDS_Converter.html">IDS_Converter</a></li></ul>
<h2>Root class IDS_Event</h2>
<ul>
<li><a href="PHPIDS/IDS_Event.html">IDS_Event</a></li></ul>
<h2>Root class IDS_Filter</h2>
<ul>
<li><a href="PHPIDS/IDS_Filter.html">IDS_Filter</a></li></ul>
<h2>Root class IDS_Filter_Storage</h2>
<ul>
<li><a href="PHPIDS/IDS_Filter_Storage.html">IDS_Filter_Storage</a></li></ul>
<h2>Root class IDS_Init</h2>
<ul>
<li><a href="PHPIDS/IDS_Init.html">IDS_Init</a></li></ul>
<h2>Root class IDS_Log_Composite</h2>
<ul>
<li><a href="PHPIDS/IDS_Log_Composite.html">IDS_Log_Composite</a></li></ul>
<h2>Root class IDS_Log_Database</h2>
<ul>
<li><a href="PHPIDS/IDS_Log_Database.html">IDS_Log_Database</a></li></ul>
<h2>Root class IDS_Log_Email</h2>
<ul>
<li><a href="PHPIDS/IDS_Log_Email.html">IDS_Log_Email</a></li></ul>
<h2>Root class IDS_Log_File</h2>
<ul>
<li><a href="PHPIDS/IDS_Log_File.html">IDS_Log_File</a></li></ul>
<h2>Root class IDS_Monitor</h2>
<ul>
<li><a href="PHPIDS/IDS_Monitor.html">IDS_Monitor</a></li></ul>
<h2>Root class IDS_Report</h2>
<ul>
<li><a href="PHPIDS/IDS_Report.html">IDS_Report</a></li></ul>
<p class="notes" id="credit">
Documentation generated on Mon, 22 Dec 2008 13:36:38 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
</p>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//FR"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- Generated by phpDocumentor on Mon, 22 Dec 2008 13:36:38 +0100 -->
<title>Generated Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<FRAMESET rows='120,*'>
<FRAME src='packages.html' name='left_top' frameborder="1" bordercolor="#999999">
<FRAMESET cols='25%,*'>
<FRAME src='li_PHPIDS.html' name='left_bottom' frameborder="1" bordercolor="#999999">
<FRAME src='blank.html' name='right' frameborder="1" bordercolor="#999999">
</FRAMESET>
<NOFRAMES>
<H2>Frame Alert</H2>
<P>This document is designed to be viewed using the frames feature.
If you see this message, you are using a non-frame-capable web client.</P>
</NOFRAMES>
</FRAMESET>
</HTML>

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title></title>
<link rel="stylesheet" href="media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="package-title">PHPIDS</div>
<div class="package-details">
<dl class="tree">
<dt class="folder-title">Description</dt>
<dd>
<a href='classtrees_PHPIDS.html' target='right'>Class trees</a><br />
<a href='elementindex_PHPIDS.html' target='right'>Index of elements</a><br />
</dd>
<dt class="folder-title">Interfaces</dt>
<dd><a href='PHPIDS/IDS_Caching_Interface.html' target='right'>IDS_Caching_Interface</a></dd>
<dd><a href='PHPIDS/IDS_Log_Interface.html' target='right'>IDS_Log_Interface</a></dd>
<dt class="folder-title">Classes</dt>
<dd><a href='PHPIDS/IDS_Caching.html' target='right'>IDS_Caching</a></dd>
<dd><a href='PHPIDS/IDS_Caching_Database.html' target='right'>IDS_Caching_Database</a></dd>
<dd><a href='PHPIDS/IDS_Caching_File.html' target='right'>IDS_Caching_File</a></dd>
<dd><a href='PHPIDS/IDS_Caching_Memcached.html' target='right'>IDS_Caching_Memcached</a></dd>
<dd><a href='PHPIDS/IDS_Caching_Session.html' target='right'>IDS_Caching_Session</a></dd>
<dd><a href='PHPIDS/IDS_Converter.html' target='right'>IDS_Converter</a></dd>
<dd><a href='PHPIDS/IDS_Event.html' target='right'>IDS_Event</a></dd>
<dd><a href='PHPIDS/IDS_Filter.html' target='right'>IDS_Filter</a></dd>
<dd><a href='PHPIDS/IDS_Filter_Storage.html' target='right'>IDS_Filter_Storage</a></dd>
<dd><a href='PHPIDS/IDS_Init.html' target='right'>IDS_Init</a></dd>
<dd><a href='PHPIDS/IDS_Log_Composite.html' target='right'>IDS_Log_Composite</a></dd>
<dd><a href='PHPIDS/IDS_Log_Database.html' target='right'>IDS_Log_Database</a></dd>
<dd><a href='PHPIDS/IDS_Log_Email.html' target='right'>IDS_Log_Email</a></dd>
<dd><a href='PHPIDS/IDS_Log_File.html' target='right'>IDS_Log_File</a></dd>
<dd><a href='PHPIDS/IDS_Monitor.html' target='right'>IDS_Monitor</a></dd>
<dd><a href='PHPIDS/IDS_Report.html' target='right'>IDS_Report</a></dd>
<dt class="folder-title">Files</dt>
<dd><a href='PHPIDS/_Log---Composite.php.html' target='right'>Composite.php</a></dd>
<dd><a href='PHPIDS/_Converter.php.html' target='right'>Converter.php</a></dd>
<dd><a href='PHPIDS/_Caching---Database.php.html' target='right'>Database.php</a></dd>
<dd><a href='PHPIDS/_Log---Database.php.html' target='right'>Database.php</a></dd>
<dd><a href='PHPIDS/_Log---Email.php.html' target='right'>Email.php</a></dd>
<dd><a href='PHPIDS/_Event.php.html' target='right'>Event.php</a></dd>
<dd><a href='PHPIDS/_Caching---Factory.php.html' target='right'>Factory.php</a></dd>
<dd><a href='PHPIDS/_Log---File.php.html' target='right'>File.php</a></dd>
<dd><a href='PHPIDS/_Caching---File.php.html' target='right'>File.php</a></dd>
<dd><a href='PHPIDS/_Filter.php.html' target='right'>Filter.php</a></dd>
<dd><a href='PHPIDS/_Init.php.html' target='right'>Init.php</a></dd>
<dd><a href='PHPIDS/_Caching---Interface.php.html' target='right'>Interface.php</a></dd>
<dd><a href='PHPIDS/_Log---Interface.php.html' target='right'>Interface.php</a></dd>
<dd><a href='PHPIDS/_Caching---Memcached.php.html' target='right'>Memcached.php</a></dd>
<dd><a href='PHPIDS/_Monitor.php.html' target='right'>Monitor.php</a></dd>
<dd><a href='PHPIDS/_Report.php.html' target='right'>Report.php</a></dd>
<dd><a href='PHPIDS/_Caching---Session.php.html' target='right'>Session.php</a></dd>
<dd><a href='PHPIDS/_Filter---Storage.php.html' target='right'>Storage.php</a></dd>
</dl>
</div>
<p class="notes"><a href="http://www.phpdoc.org" target="_blank">phpDocumentor v <span class="field">1.4.2</span></a></p>
</BODY>
</HTML>

View File

@ -0,0 +1,32 @@
body
{
background-color: #CCCCFF;
margin: 0px;
padding: 0px;
}
/* Banner (top bar) classes */
.banner { }
.banner-menu
{
clear: both;
padding: .5em;
border-top: 2px solid #6666AA;
}
.banner-title
{
text-align: right;
font-size: 20pt;
font-weight: bold;
margin: .2em;
}
.package-selector
{
background-color: #AAAADD;
border: 1px solid black;
color: yellow;
}

View File

@ -0,0 +1,144 @@
a { color: #336699; text-decoration: none; }
a:hover { color: #6699CC; text-decoration: underline; }
a:active { color: #6699CC; text-decoration: underline; }
body { background : #FFFFFF; }
body, table { font-family: Georgia, Times New Roman, Times, serif; font-size: 10pt }
p, li { line-height: 140% }
a img { border: 0px; }
dd { margin-left: 0px; padding-left: 1em; }
/* Page layout/boxes */
.info-box {}
.info-box-title { margin: 1em 0em 0em 0em; padding: .25em; font-weight: normal; font-size: 14pt; border: 2px solid #999999; background-color: #CCCCFF }
.info-box-body { border: 1px solid #999999; padding: .5em; }
.nav-bar { font-size: 8pt; white-space: nowrap; text-align: right; padding: .2em; margin: 0em 0em 1em 0em; }
.oddrow { background-color: #F8F8F8; border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em}
.evenrow { border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em}
.page-body { max-width: 800px; margin: auto; }
.tree dl { margin: 0px }
/* Index formatting classes */
.index-item-body { margin-top: .5em; margin-bottom: .5em}
.index-item-description { margin-top: .25em }
.index-item-details { font-weight: normal; font-style: italic; font-size: 8pt }
.index-letter-section { background-color: #EEEEEE; border: 1px dotted #999999; padding: .5em; margin-bottom: 1em}
.index-letter-title { font-size: 12pt; font-weight: bold }
.index-letter-menu { text-align: center; margin: 1em }
.index-letter { font-size: 12pt }
/* Docbook classes */
.description {}
.short-description { font-weight: bold; color: #666666; }
.tags { padding-left: 0em; margin-left: 3em; color: #666666; list-style-type: square; }
.parameters { padding-left: 0em; margin-left: 3em; font-style: italic; list-style-type: square; }
.redefinitions { font-size: 8pt; padding-left: 0em; margin-left: 2em; }
.package { }
.package-title { font-weight: bold; font-size: 14pt; border-bottom: 1px solid black }
.package-details { font-size: 85%; }
.sub-package { font-weight: bold; font-size: 120% }
.tutorial { border-width: thin; border-color: #0066ff }
.tutorial-nav-box { width: 100%; border: 1px solid #999999; background-color: #F8F8F8; }
.nav-button-disabled { color: #999999; }
.nav-button:active,
.nav-button:focus,
.nav-button:hover { background-color: #DDDDDD; outline: 1px solid #999999; text-decoration: none }
.folder-title { font-style: italic }
/* Generic formatting */
.field { font-weight: bold; }
.detail { font-size: 8pt; }
.notes { font-style: italic; font-size: 8pt; }
.separator { background-color: #999999; height: 2px; }
.warning { color: #FF6600; }
.disabled { font-style: italic; color: #999999; }
/* Code elements */
.line-number { }
.class-table { width: 100%; }
.class-table-header { border-bottom: 1px dotted #666666; text-align: left}
.class-name { color: #000000; font-weight: bold; }
.method-summary { padding-left: 1em; font-size: 8pt }
.method-header { }
.method-definition { margin-bottom: .3em }
.method-title { font-weight: bold; }
.method-name { font-weight: bold; }
.method-signature { font-size: 85%; color: #666666; margin: .5em 0em }
.method-result { font-style: italic; }
.var-summary { padding-left: 1em; font-size: 8pt; }
.var-header { }
.var-title { margin-bottom: .3em }
.var-type { font-style: italic; }
.var-name { font-weight: bold; }
.var-default {}
.var-description { font-weight: normal; color: #000000; }
.include-title { }
.include-type { font-style: italic; }
.include-name { font-weight: bold; }
.const-title { }
.const-name { font-weight: bold; }
/* Syntax highlighting */
.src-code { border: 1px solid #336699; padding: 1em; background-color: #EEEEEE; }
.src-line { font-family: 'Courier New', Courier, monospace; font-weight: normal; }
.src-comm { color: green; }
.src-id { }
.src-inc { color: #0000FF; }
.src-key { color: #0000FF; }
.src-num { color: #CC0000; }
.src-str { color: #66cccc; }
.src-sym { font-weight: bold; }
.src-var { }
.src-php { font-weight: bold; }
.src-doc { color: #009999 }
.src-doc-close-template { color: #0000FF }
.src-doc-coretag { color: #0099FF; font-weight: bold }
.src-doc-inlinetag { color: #0099FF }
.src-doc-internal { color: #6699cc }
.src-doc-tag { color: #0080CC }
.src-doc-template { color: #0000FF }
.src-doc-type { font-style: italic }
.src-doc-var { font-style: italic }
.tute-tag { color: #009999 }
.tute-attribute-name { color: #0000FF }
.tute-attribute-value { color: #0099FF }
.tute-entity { font-weight: bold; }
.tute-comment { font-style: italic }
.tute-inline-tag { color: #636311; font-weight: bold }
/* tutorial */
.authors { }
.author { font-style: italic; font-weight: bold }
.author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal }
.example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; }
*[class="example"] { line-height : 0.5em }
.listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap; }
*[class="listing"] { line-height : 0.5em }
.release-info { font-size: 85%; font-style: italic; margin: 1em 0em }
.ref-title-box { }
.ref-title { }
.ref-purpose { font-style: italic; color: #666666 }
.ref-synopsis { }
.title { font-weight: bold; margin: 1em 0em 0em 0em; padding: .25em; border: 2px solid #999999; background-color: #CCCCFF }
.cmd-synopsis { margin: 1em 0em }
.cmd-title { font-weight: bold }
.toc { margin-left: 2em; padding-left: 0em }

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title></title>
<link rel="stylesheet" href="media/stylesheet.css" />
<link rel="stylesheet" href="media/banner.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="banner">
<div class="banner-title">PHPIDS</div>
<div class="banner-menu">
<table cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td>
</td>
<td style="width: 2em">&nbsp;</td>
<td style="text-align: right">
<a href="li_PHPIDS.html" target="left_bottom">PHPIDS</a>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,286 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
require_once 'IDS/Caching/Interface.php';
/**
* Needed SQL:
*
#create the database
CREATE DATABASE IF NOT EXISTS `phpids` DEFAULT CHARACTER
SET utf8 COLLATE utf8_general_ci;
DROP TABLE IF EXISTS `cache`;
#now select the created datbase and create the table
CREATE TABLE `cache` (
`type` VARCHAR( 32 ) NOT null ,
`data` TEXT NOT null ,
`created` DATETIME NOT null ,
`modified` DATETIME NOT null
) ENGINE = MYISAM ;
*/
/**
* Database caching wrapper
*
* This class inhabits functionality to get and set cache via a database.
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Groupup
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @version Release: $Id:Database.php 517 2007-09-15 15:04:13Z mario $
* @link http://php-ids.org/
* @since Version 0.4
*/
class IDS_Caching_Database implements IDS_Caching_Interface
{
/**
* Caching type
*
* @var string
*/
private $type = null;
/**
* Cache configuration
*
* @var array
*/
private $config = null;
/**
* DBH
*
* @var object
*/
private $handle = null;
/**
* Holds an instance of this class
*
* @var object
*/
private static $cachingInstance = null;
/**
* Constructor
*
* Connects to database.
*
* @param string $type caching type
* @param array $init the IDS_Init object
*
* @return void
*/
public function __construct($type, $init)
{
$this->type = $type;
$this->config = $init->config['Caching'];
$this->handle = $this->_connect();
}
/**
* Returns an instance of this class
*
* @param string $type caching type
* @param array $init the IDS_Init object
*
* @return object $this
*/
public static function getInstance($type, $init)
{
if (!self::$cachingInstance) {
self::$cachingInstance = new IDS_Caching_Database($type, $init);
}
return self::$cachingInstance;
}
/**
* Writes cache data into the database
*
* @param array $data the caching data
*
* @throws PDOException if a db error occurred
* @return object $this
*/
public function setCache(array $data)
{
$handle = $this->handle;
$rows = $handle->query('SELECT created FROM `' .
$handle->quote($this->config['table']).'`');
if (!$rows || $rows->rowCount() === 0) {
$this->_write($handle, $data);
} else {
foreach ($rows as $row) {
if ((time()-strtotime($row['created'])) >
$this->config['expiration_time']) {
$this->_write($handle, $data);
}
}
}
return $this;
}
/**
* Returns the cached data
*
* Note that this method returns false if either type or file cache is
* not set
*
* @throws PDOException if a db error occurred
* @return mixed cache data or false
*/
public function getCache()
{
try{
$handle = $this->handle;
$result = $handle->prepare('SELECT * FROM ' .
$handle->quote($this->config['table']) .
' where type=?');
$result->execute(array($this->type));
foreach ($result as $row) {
return unserialize($row['data']);
}
} catch (PDOException $e) {
die('PDOException: ' . $e->getMessage());
}
return false;
}
/**
* Connect to database and return a handle
*
* @return object dbh
* @throws PDOException if a db error occurred
*/
private function _connect()
{
// validate connection parameters
if (!$this->config['wrapper']
|| !$this->config['user']
|| !$this->config['password']
|| !$this->config['table']) {
throw new Exception('
Insufficient connection parameters'
);
}
// try to connect
try {
$handle = new PDO(
$this->config['wrapper'],
$this->config['user'],
$this->config['password']
);
} catch (PDOException $e) {
die('PDOException: ' . $e->getMessage());
}
return $handle;
}
/**
* Write the cache data to the table
*
* @param object $handle the database handle
* @param array $data the caching data
*
* @return object dbh
* @throws PDOException if a db error occurred
*/
private function _write($handle, $data)
{
try {
$handle->query('TRUNCATE ' .
$this->config['table'].'');
$statement = $handle->prepare('
INSERT INTO `' .
$this->config['table'].'` (
type,
data,
created,
modified
)
VALUES (
:type,
:data,
now(),
now()
)
');
$statement->bindParam('type',
$handle->quote($this->type));
$statement->bindParam('data', serialize($data));
if (!$statement->execute()) {
throw new PDOException($statement->errorCode());
}
} catch (PDOException $e) {
die('PDOException: ' . $e->getMessage());
}
}
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

View File

@ -0,0 +1,94 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
/**
* Caching factory
*
* This class is used as a factory to load the correct concrete caching
* implementation.
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Group
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @version Release: $Id:Factory.php 517 2007-09-15 15:04:13Z mario $
* @link http://php-ids.org/
* @since Version 0.4
*/
class IDS_Caching
{
/**
* Factory method
*
* @param array $init the IDS_Init object
* @param string $type the caching type
*
* @return object the caching facility
*/
public static function factory($init, $type)
{
$object = false;
$wrapper = preg_replace(
'/\W+/m',
null,
ucfirst($init->config['Caching']['caching'])
);
$class = 'IDS_Caching_' . $wrapper;
$path = dirname(__FILE__) . DIRECTORY_SEPARATOR .
$wrapper . '.php';
if (file_exists($path)) {
include_once $path;
if (class_exists($class)) {
$object = call_user_func(array($class, 'getInstance'),
$type, $init);
}
}
return $object;
}
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

View File

@ -0,0 +1,183 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
require_once 'IDS/Caching/Interface.php';
/**
* File caching wrapper
*
* This class inhabits functionality to get and set cache via a static flatfile.
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Group
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @version Release: $Id:File.php 517 2007-09-15 15:04:13Z mario $
* @link http://php-ids.org/
* @since Version 0.4
*/
class IDS_Caching_File implements IDS_Caching_Interface
{
/**
* Caching type
*
* @var string
*/
private $type = null;
/**
* Cache configuration
*
* @var array
*/
private $config = null;
/**
* Path to cache file
*
* @var string
*/
private $path = null;
/**
* Holds an instance of this class
*
* @var object
*/
private static $cachingInstance = null;
/**
* Constructor
*
* @param string $type caching type
* @param array $init the IDS_Init object
*
* @return void
*/
public function __construct($type, $init)
{
$this->type = $type;
$this->config = $init->config['Caching'];
$this->path = $init->getBasePath() . $this->config['path'];
if (file_exists($this->path) && !is_writable($this->path)) {
throw new Exception('Make sure all files in ' .
htmlspecialchars($this->path, ENT_QUOTES, 'UTF-8') .
'are writeable!');
}
}
/**
* Returns an instance of this class
*
* @param string $type caching type
* @param array $init the IDS_Init object
*
* @return object $this
*/
public static function getInstance($type, $init)
{
if (!self::$cachingInstance) {
self::$cachingInstance = new IDS_Caching_File($type, $init);
}
return self::$cachingInstance;
}
/**
* Writes cache data into the file
*
* @param array $data the cache data
*
* @throws Exception if cache file couldn't be created
* @return object $this
*/
public function setCache(array $data)
{
if (!is_writable(preg_replace('/[\/][^\/]+\.[^\/]++$/', null,
$this->path))) {
throw new Exception('Temp directory ' .
htmlspecialchars($this->path, ENT_QUOTES, 'UTF-8') .
' seems not writable');
}
if ((!file_exists($this->path) || (time()-filectime($this->path)) >
$this->config['expiration_time'])) {
$handle = @fopen($this->path, 'w+');
if (!$handle) {
throw new Exception("Cache file couldn't be created");
}
fwrite($handle, serialize($data));
fclose($handle);
}
return $this;
}
/**
* Returns the cached data
*
* Note that this method returns false if either type or file cache is
* not set
*
* @return mixed cache data or false
*/
public function getCache()
{
// make sure filters are parsed again if cache expired
if (file_exists($this->path) && (time()-filectime($this->path)) <
$this->config['expiration_time']) {
$data = unserialize(file_get_contents($this->path));
return $data;
}
return false;
}
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

View File

@ -0,0 +1,73 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
/**
* Caching wrapper interface
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Group
* @version SVN: $Id:Interface.php 517 2007-09-15 15:04:13Z mario $
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @since Version 0.4
* @link http://php-ids.org/
*/
interface IDS_Caching_Interface
{
/**
* Interface method
*
* @param array $data the cache data
*
* @return void
*/
public function setCache(array $data);
/**
* Interface method
*
* @return void
*/
public function getCache();
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

View File

@ -0,0 +1,228 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
require_once 'IDS/Caching/Interface.php';
/**
* File caching wrapper
*
* This class inhabits functionality to get and set cache via memcached.
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Groupoup
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @version Release: $Id:Memcached.php 517 2007-09-15 15:04:13Z mario $
* @link http://php-ids.org/
* @since Version 0.4
*/
class IDS_Caching_Memcached implements IDS_Caching_Interface
{
/**
* Caching type
*
* @var string
*/
private $type = null;
/**
* Cache configuration
*
* @var array
*/
private $config = null;
/**
* Path to memcache timestamp file
*
* @var string
*/
private $path = null;
/**
* Flag if the filter storage has been found in memcached
*
* @var boolean
*/
private $isCached = false;
/**
* Memcache object
*
* @var object
*/
private $memcache = null;
/**
* Holds an instance of this class
*
* @var object
*/
private static $cachingInstance = null;
/**
* Constructor
*
* @param string $type caching type
* @param array $init the IDS_Init object
*
* @throws Exception if necessary files aren't writeable
* @return void
*/
public function __construct($type, $init)
{
$this->type = $type;
$this->config = $init->config['Caching'];
$this->path = $init->getBasePath() . $this->config['path'];
$this->_connect();
if (file_exists($this->path) && !is_writable($this->path)) {
throw new Exception('Make sure all files in ' .
htmlspecialchars($this->path, ENT_QUOTES, 'UTF-8') .
' are writeable!');
}
}
/**
* Returns an instance of this class
*
* @param string $type caching type
* @param array $init the IDS_Init object
*
* @return object $this
*/
public static function getInstance($type, $init)
{
if (!self::$cachingInstance) {
self::$cachingInstance = new IDS_Caching_Memcached($type, $init);
}
return self::$cachingInstance;
}
/**
* Writes cache data
*
* @param array $data the caching data
*
* @throws Exception if necessary files aren't writeable
* @return object $this
*/
public function setCache(array $data)
{
if (!file_exists($this->path)) {
$handle = fopen($this->path, 'w');
fclose($handle);
}
if (!is_writable($this->path)) {
throw new Exception('Make sure all files in ' .
htmlspecialchars($this->path, ENT_QUOTES, 'UTF-8') .
' are writeable!');
}
if(!$this->isCached) {
$this->memcache->set(
$this->config['key_prefix'] . '.storage',
$data, false, $this->config['expiration_time']
);
}
return $this;
}
/**
* Returns the cached data
*
* Note that this method returns false if either type or file cache is
* not set
*
* @return mixed cache data or false
*/
public function getCache()
{
$data = $this->memcache->get(
$this->config['key_prefix'] .
'.storage'
);
$this->isCached = !empty($data);
return $data;
}
/**
* Connect to the memcached server
*
* @throws Exception if connection parameters are insufficient
* @return void
*/
private function _connect()
{
if ($this->config['host'] && $this->config['port']) {
// establish the memcache connection
$this->memcache = new Memcache;
$this->memcache->pconnect($this->config['host'],
$this->config['port']);
$this->path = $this->config['tmp_path'];
if(isset($init->config['General']['base_path'])
&& $init->config['General']['base_path']
&& isset($init->config['General']['use_base_path'])
&& $init->config['General']['use_base_path']) {
$this->source = $init->config['General']['base_path'] . $this->path;
}
} else {
throw new Exception('Insufficient connection parameters');
}
}
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

View File

@ -0,0 +1,146 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
require_once 'IDS/Caching/Interface.php';
/**
* File caching wrapper
*
* This class inhabits functionality to get and set cache via session.
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Group
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @version Release: $Id:Session.php 517 2007-09-15 15:04:13Z mario $
* @link http://php-ids.org/
* @since Version 0.4
*/
class IDS_Caching_Session implements IDS_Caching_Interface
{
/**
* Caching type
*
* @var string
*/
private $type = null;
/**
* Cache configuration
*
* @var array
*/
private $config = null;
/**
* Holds an instance of this class
*
* @var object
*/
private static $cachingInstance = null;
/**
* Constructor
*
* @param string $type caching type
* @param array $init the IDS_Init object
*
* @return void
*/
public function __construct($type, $init)
{
$this->type = $type;
$this->config = $init->config['Caching'];
}
/**
* Returns an instance of this class
*
* @param string $type caching type
* @param array $init the IDS_Init object
*
* @return object $this
*/
public static function getInstance($type, $init)
{
if (!self::$cachingInstance) {
self::$cachingInstance = new IDS_Caching_Session($type, $init);
}
return self::$cachingInstance;
}
/**
* Writes cache data into the session
*
* @param array $data the caching data
*
* @return object $this
*/
public function setCache(array $data)
{
$_SESSION['PHPIDS'][$this->type] = $data;
return $this;
}
/**
* Returns the cached data
*
* Note that this method returns false if either type or file cache is not set
*
* @return mixed cache data or false
*/
public function getCache()
{
if ($this->type && $_SESSION['PHPIDS'][$this->type]) {
return $_SESSION['PHPIDS'][$this->type];
}
return false;
}
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

View File

@ -0,0 +1,89 @@
; PHPIDS Config.ini
; General configuration settings
; !!!DO NOT PLACE THIS FILE INSIDE THE WEB-ROOT IF DATABASE CONNECTION DATA WAS ADDED!!!
[General]
; basic settings - customize to make the PHPIDS work at all
filter_type = xml
base_path = /full/path/to/IDS/
use_base_path = false
filter_path = default_filter.xml
tmp_path = tmp
scan_keys = false
; in case you want to use a different HTMLPurifier source, specify it here
; By default, those files are used that are being shipped with PHPIDS
HTML_Purifier_Path = IDS/vendors/htmlpurifier/HTMLPurifier.auto.php
HTML_Purifier_Cache = IDS/vendors/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer
; define which fields contain html and need preparation before
; hitting the PHPIDS rules (new in PHPIDS 0.5)
html[] = __wysiwyg
; define which fields contain JSON data and should be treated as such
; for fewer false positives (new in PHPIDS 0.5.3)
json[] = __jsondata
; define which fields shouldn't be monitored (a[b]=c should be referenced via a.b)
exceptions[] = __utmz
exceptions[] = __utmc
; PHPIDS should run with PHP 5.1.2 but this is untested - set
; this value to force compatibilty with minor versions
min_php_version = 5.1.6
; If you use the PHPIDS logger you can define specific configuration here
[Logging]
; file logging
path = tmp/phpids_log.txt
; email logging
; note that enabling safemode you can prevent spam attempts,
; see documentation
recipients[] = test@test.com.invalid
subject = "PHPIDS detected an intrusion attempt!"
header = "From: <PHPIDS> info@php-ids.org"
envelope = ""
safemode = true
urlencode = true
allowed_rate = 15
; database logging
wrapper = "mysql:host=localhost;port=3306;dbname=phpids"
user = phpids_user
password = 123456
table = intrusions
; If you would like to use other methods than file caching you can configure them here
[Caching]
; caching: session|file|database|memcached|none
caching = file
expiration_time = 600
; file cache
path = tmp/default_filter.cache
; database cache
wrapper = "mysql:host=localhost;port=3306;dbname=phpids"
user = phpids_user
password = 123456
table = cache
; memcached
;host = localhost
;port = 11211
;key_prefix = PHPIDS
;tmp_path = tmp/memcache.timestamp

View File

@ -0,0 +1,721 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
/**
* PHPIDS specific utility class to convert charsets manually
*
* Note that if you make use of IDS_Converter::runAll(), existing class
* methods will be executed in the same order as they are implemented in the
* class tree!
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Group
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @version Release: $Id:Converter.php 517 2007-09-15 15:04:13Z mario $
* @link http://php-ids.org/
*/
class IDS_Converter
{
/**
* Runs all converter functions
*
* Note that if you make use of IDS_Converter::runAll(), existing class
* methods will be executed in the same order as they are implemented in the
* class tree!
*
* @param string $value the value to convert
*
* @static
* @return string
*/
public static function runAll($value)
{
foreach (get_class_methods(__CLASS__) as $method) {
if (strpos($method, 'run') === 0) {
continue;
}
$value = self::$method($value);
}
return $value;
}
/**
* Check for comments and erases them if available
*
* @param string $value the value to convert
*
* @static
* @return string
*/
public static function convertFromCommented($value)
{
// check for existing comments
if (preg_match('/(?:\<!-|-->|\/\*|\*\/|\/\/\W*\w+\s*$)|' .
'(?:--[^-]*-)/ms', $value)) {
$pattern = array(
'/(?:(?:<!)(?:(?:--(?:[^-]*(?:-[^-]+)*)--\s*)*)(?:>))/ms',
'/(?:(?:\/\*\/*[^\/\*]*)+\*\/)/ms',
'/(?:--[^-]*-)/ms'
);
$converted = preg_replace($pattern, ';', $value);
$value .= "\n" . $converted;
}
// deal with x509 false alerts
$value = preg_replace('/(\w+)\/\/(\w+)/m', '$1/$2', $value);
$value = preg_replace('/(\w+)\/\+(\w+)/m', '$1/$2', $value);
//make sure inline comments are detected and converted correctly
$value = preg_replace('/(<\w+)\/+(\w+=?)/m', '$1/$2', $value);
$value = preg_replace('/[^\\\:]\/\/(.*)$/m', '/**/$1', $value);
return $value;
}
/**
* Strip newlines
*
* @param string $value the value to convert
*
* @static
* @return string
*/
public static function convertFromNewLines($value)
{
//check for inline linebreaks
$search = array('\r', '\n', '\f', '\t', '\v');
$value = str_replace($search, ';', $value);
//convert real linebreaks
return preg_replace('/(?:\n|\r|\v)/m', ' ', $value);
}
/**
* Checks for common charcode pattern and decodes them
*
* @param string $value the value to convert
*
* @static
* @return string
*/
public static function convertFromJSCharcode($value)
{
$matches = array();
// check if value matches typical charCode pattern
if (preg_match_all('/(?:[\d+-=\/\* ]+(?:\s?,\s?[\d+-=\/\* ]+)){4,}/ms',
$value, $matches)) {
$converted = '';
$string = implode(',', $matches[0]);
$string = preg_replace('/\s/', '', $string);
$string = preg_replace('/\w+=/', '', $string);
$charcode = explode(',', $string);
foreach ($charcode as $char) {
$char = preg_replace('/\W0/s', '', $char);
if (preg_match_all('/\d*[+-\/\* ]\d+/', $char, $matches)) {
$match = preg_split('/(\W?\d+)/',
(implode('', $matches[0])),
null,
PREG_SPLIT_DELIM_CAPTURE);
if (array_sum($match) >= 20 && array_sum($match) <= 127) {
$converted .= chr(array_sum($match));
}
} elseif (!empty($char) && $char >= 20 && $char <= 127) {
$converted .= chr($char);
}
}
$value .= "\n" . $converted;
}
// check for octal charcode pattern
if (preg_match_all('/(?:(?:[\\\]+\d+[ \t]*){8,})/ims', $value, $matches)) {
$converted = '';
$charcode = explode('\\', preg_replace('/\s/', '', implode(',',
$matches[0])));
foreach ($charcode as $char) {
if (!empty($char)) {
if (octdec($char) >= 20 && octdec($char) <= 127) {
$converted .= chr(octdec($char));
}
}
}
$value .= "\n" . $converted;
}
// check for hexadecimal charcode pattern
if (preg_match_all('/(?:(?:[\\\]+\w+\s*){8,})/ims', $value, $matches)) {
$converted = '';
$charcode = explode('\\', preg_replace('/[ux]/', '', implode(',',
$matches[0])));
foreach ($charcode as $char) {
if (!empty($char)) {
if (hexdec($char) >= 20 && hexdec($char) <= 127) {
$converted .= chr(hexdec($char));
}
}
}
$value .= "\n" . $converted;
}
return $value;
}
/**
* Eliminate JS regex modifiers
*
* @param string $value the value to convert
*
* @static
* @return string
*/
public static function convertJSRegexModifiers($value)
{
$value = preg_replace('/\/[gim]/', '/', $value);
return $value;
}
/**
* Converts from hex/dec entities
*
* @param string $value the value to convert
*
* @static
* @return string
*/
public static function convertEntities($value)
{
$converted = null;
//deal with double encoded payload
$value = preg_replace('/&amp;/', '&', $value);
if (preg_match('/&#x?[\w]+/ms', $value)) {
$converted = preg_replace('/(&#x?[\w]{2}\d?);?/ms', '$1;', $value);
$converted = html_entity_decode($converted, ENT_QUOTES, 'UTF-8');
$value .= "\n" . str_replace(';;', ';', $converted);
}
return $value;
}
/**
* Normalize quotes
*
* @param string $value the value to convert
*
* @static
* @return string
*/
public static function convertQuotes($value)
{
// normalize different quotes to "
$pattern = array('\'', '`', '´', '', '');
$value = str_replace($pattern, '"', $value);
return $value;
}
/**
* Converts SQLHEX to plain text
*
* @param string $value the value to convert
*
* @static
* @return string
*/
public static function convertFromSQLHex($value)
{
$matches = array();
if(preg_match_all('/(?:0x[a-f\d]{2,}[a-f\d]*)+/im', $value, $matches)) {
foreach($matches[0] as $match) {
$converted = '';
foreach(str_split($match, 2) as $hex_index) {
if(preg_match('/[a-f\d]{2,3}/i', $hex_index)) {
$converted .= chr(hexdec($hex_index));
}
}
$value = str_replace($match, $converted, $value);
}
}
// take care of hex encoded ctrl chars
$value = preg_replace('/0x\d+/m', 1, $value);
return $value;
}
/**
* Converts basic SQL keywords and obfuscations
*
* @param string $value the value to convert
*
* @static
* @return string
*/
public static function convertFromSQLKeywords($value)
{
$pattern = array('/(?:IS\s+null)|(LIKE\s+null)|' .
'(?:(?:^|\W)IN[+\s]*\([\s\d"]+[^()]*\))/ims');
$value = preg_replace($pattern, '"=0', $value);
$value = preg_replace('/null[,\s]/ims', ',0', $value);
$value = preg_replace('/,null/ims', ',0', $value);
$value = preg_replace('/(?:between|mod)/ims', 'or', $value);
$value = preg_replace('/(?:and\s+\d+\.?\d*)/ims', '', $value);
$value = preg_replace('/(?:\s+and\s+)/ims', ' or ', $value);
$pattern = array('/[^\w,(]NULL|\\\N|TRUE|FALSE|UTC_TIME|' .
'LOCALTIME(?:STAMP)?|CURRENT_\w+|BINARY|' .
'(?:(?:ASCII|SOUNDEX|' .
'MD5|R?LIKE)[+\s]*\([^()]+\))|(?:-+\d)/ims');
$value = preg_replace($pattern, 0, $value);
$pattern = array('/(?:NOT\s+BETWEEN)|(?:IS\s+NOT)|(?:NOT\s+IN)|' .
'(?:XOR|\WDIV\W|\WNOT\W|<>|RLIKE(?:\s+BINARY)?)|' .
'(?:REGEXP\s+BINARY)|' .
'(?:SOUNDS\s+LIKE)/ims');
$value = preg_replace($pattern, '!', $value);
$value = preg_replace('/"\s+\d/', '"', $value);
$value = preg_replace('/\/(?:\d+|null)/', null, $value);
return $value;
}
/**
* Detects nullbytes and controls chars via ord()
*
* @param string $value the value to convert
*
* @static
* @return string
*/
public static function convertFromControlChars($value)
{
// critical ctrl values
$search = array(chr(0), chr(1), chr(2),
chr(3), chr(4), chr(5),
chr(6), chr(7), chr(8),
chr(11), chr(12), chr(14),
chr(15), chr(16), chr(17),
chr(18), chr(19));
$value = str_replace($search, '%00', $value);
$urlencoded = urlencode($value);
//take care for malicious unicode characters
$value = urldecode(preg_replace('/(?:%E(?:2|3)%8(?:0|1)%(?:A|8|9)' .
'\w|%EF%BB%BF|%EF%BF%BD)|(?:&#(?:65|8)\d{3};?)/i', null,
$urlencoded));
$value = preg_replace('/(?:&[#x]*(200|820|200|820|zwn?j|lrm|rlm)\w?;?)/i', null,
$value);
$value = preg_replace('/(?:&#(?:65|8)\d{3};?)|' .
'(?:&#(?:56|7)3\d{2};?)|' .
'(?:&#x(?:fe|20)\w{2};?)|' .
'(?:&#x(?:d[c-f])\w{2};?)/i', null,
$value);
return $value;
}
/**
* This method matches and translates base64 strings and fragments
* used in data URIs
*
* @param string $value the value to convert
*
* @static
* @return string
*/
public static function convertFromNestedBase64($value)
{
$matches = array();
preg_match_all('/(?:^|[,&?])\s*([a-z0-9]{30,}=*)(?:\W|$)/im',
$value,
$matches);
foreach ($matches[1] as $item) {
if (isset($item) && !preg_match('/[a-f0-9]{32}/i', $item)) {
$value = str_replace($item, base64_decode($item), $value);
}
}
return $value;
}
/**
* Detects nullbytes and controls chars via ord()
*
* @param string $value the value to convert
*
* @static
* @return string
*/
public static function convertFromOutOfRangeChars($value)
{
$values = str_split($value);
foreach ($values as $item) {
if (ord($item) >= 127) {
$value = str_replace($item, 'U', $value);
}
}
return $value;
}
/**
* Strip XML patterns
*
* @param string $value the value to convert
*
* @static
* @return string
*/
public static function convertFromXML($value)
{
$converted = strip_tags($value);
if ($converted && ($converted != $value)) {
return $value . "\n" . $converted;
}
return $value;
}
/**
* This method converts JS unicode code points to
* regular characters
*
* @param string $value the value to convert
*
* @static
* @return string
*/
public static function convertFromJSUnicode($value)
{
$matches = array();
preg_match_all('/\\\u[0-9a-f]{4}/ims', $value, $matches);
if (!empty($matches[0])) {
foreach ($matches[0] as $match) {
$value = str_replace($match,
chr(hexdec(substr($match, 2, 4))),
$value);
}
$value .= "\n\u0001";
}
return $value;
}
/**
* Converts relevant UTF-7 tags to UTF-8
*
* @param string $value the value to convert
*
* @static
* @return string
*/
public static function convertFromUTF7($value)
{
if(preg_match('/\+A\w+-/m', $value)) {
if (function_exists('mb_convert_encoding')) {
if(version_compare(PHP_VERSION, '5.2.8', '<')) {
$tmp_chars = str_split($value);
$value = '';
foreach($tmp_chars as $char) {
if(ord($char) <= 127) {
$value .= $char;
}
}
}
$value .= "\n" . mb_convert_encoding($value, 'UTF-8', 'UTF-7');
} else {
//list of all critical UTF7 codepoints
$schemes = array(
'+ACI-' => '"',
'+ADw-' => '<',
'+AD4-' => '>',
'+AFs-' => '[',
'+AF0-' => ']',
'+AHs-' => '{',
'+AH0-' => '}',
'+AFw-' => '\\',
'+ADs-' => ';',
'+ACM-' => '#',
'+ACY-' => '&',
'+ACU-' => '%',
'+ACQ-' => '$',
'+AD0-' => '=',
'+AGA-' => '`',
'+ALQ-' => '"',
'+IBg-' => '"',
'+IBk-' => '"',
'+AHw-' => '|',
'+ACo-' => '*',
'+AF4-' => '^',
'+ACIAPg-' => '">',
'+ACIAPgA8-' => '">'
);
$value = str_ireplace(array_keys($schemes),
array_values($schemes), $value);
}
}
return $value;
}
/**
* Converts basic concatenations
*
* @param string $value the value to convert
*
* @static
* @return string
*/
public static function convertFromConcatenated($value)
{
//normalize remaining backslashes
if ($value != preg_replace('/(\w)\\\/', "$1", $value)) {
$value .= preg_replace('/(\w)\\\/', "$1", $value);
}
$compare = stripslashes($value);
$pattern = array('/(?:<\/\w+>\+<\w+>)/s',
'/(?:":\d+[^"[]+")/s',
'/(?:"?"\+\w+\+")/s',
'/(?:"\s*;[^"]+")|(?:";[^"]+:\s*")/s',
'/(?:"\s*(?:;|\+).{8,18}:\s*")/s',
'/(?:";\w+=)|(?:!""&&")|(?:~)/s',
'/(?:"?"\+""?\+?"?)|(?:;\w+=")|(?:"[|&]{2,})/s',
'/(?:"\s*\W+")/s',
'/(?:";\w\s*\+=\s*\w?\s*")/s',
'/(?:"[|&;]+\s*[^|&\n]*[|&]+\s*"?)/s',
'/(?:";\s*\w+\W+\w*\s*[|&]*")/s',
'/(?:"\s*"\s*\.)/s',
'/(?:\s*new\s+\w+\s*[+",])/',
'/(?:(?:^|\s+)(?:do|else)\s+)/',
'/(?:[{(]\s*new\s+\w+\s*[)}])/',
'/(?:(this|self)\.)/',
'/(?:undefined)/',
'/(?:in\s+)/');
// strip out concatenations
$converted = preg_replace($pattern, null, $compare);
//strip object traversal
$converted = preg_replace('/\w(\.\w\()/', "$1", $converted);
// normalize obfuscated method calls
$converted = preg_replace('/\)\s*\+/', ")", $converted);
//convert JS special numbers
$converted = preg_replace('/(?:\(*[.\d]e[+-]*[^a-z\W]+\)*)' .
'|(?:NaN|Infinity)\W/ms', 1, $converted);
if ($converted && ($compare != $converted)) {
$value .= "\n" . $converted;
}
return $value;
}
/**
* This method collects and decodes proprietary encoding types
*
* @param string $value the value to convert
* @param IDS_Monitor $monitor the monitor object
*
* @static
* @return string
*/
public static function convertFromProprietaryEncodings($value) {
//Xajax error reportings
$value = preg_replace('/<!\[CDATA\[(\W+)\]\]>/im', '$1', $value);
//strip false alert triggering apostrophes
$value = preg_replace('/(\w)\"(s)/m', '$1$2', $value);
//strip quotes within typical search patterns
$value = preg_replace('/^"([^"=\\!><~]+)"$/', '$1', $value);
//OpenID login tokens
$value = preg_replace('/{[\w-]{8,9}\}(?:\{[\w=]{8}\}){2}/', null, $value);
//convert Content and \sdo\s to null
$value = preg_replace('/Content|\Wdo\s/', null, $value);
//strip emoticons
$value = preg_replace(
'/(?:\s[:;]-[)\/PD]+)|(?:\s;[)PD]+)|(?:\s:[)PD]+)|-\.-|\^\^/m',
null,
$value
);
//normalize separation char repetion
$value = preg_replace('/([.+~=*_\-])\1{2,}/m', '$1', $value);
//normalize multiple single quotes
$value = preg_replace('/"{2,}/m', '"', $value);
//normalize ampersand listings
$value = preg_replace('/(\w\s)&\s(\w)/', '$1$2', $value);
//normalize JS backspace linebreaks
$value = preg_replace('/^\/|\/$|,\/\n|\/,/', null, $value);
return $value;
}
/**
* This method is the centrifuge prototype
*
* @param string $value the value to convert
* @param IDS_Monitor $monitor the monitor object
*
* @static
* @return string
*/
public static function runCentrifuge($value, IDS_Monitor $monitor = null)
{
$threshold = 3.49;
$unserialized = false;
if(preg_match('/^\w:\d+:\{/', $value)) {
$unserialized = @unserialize($value);
}
if (strlen($value) > 25 && !$unserialized) {
//strip padding
$tmp_value = preg_replace('/\s{4}/m', null, $value);
$tmp_value = preg_replace(
'/\s{4}|[\p{L}\d\+\-,.%]{8,}/m',
'aaa',
$tmp_value
);
// Check for the attack char ratio
$tmp_value = preg_replace('/([*.!?+-])\1{1,}/m', '$1', $tmp_value);
$tmp_value = preg_replace('/"[\p{L}\d\s]+"/m', null, $tmp_value);
$stripped_length = strlen(preg_replace('/[\d\s\p{L}.:,%&\/><\-)]+/m',
null, $tmp_value));
$overall_length = strlen(
preg_replace('/([\d\s\p{L}:,]{3,})+/m', 'aaa',
preg_replace('/\s{2,}/m', null, $tmp_value))
);
if ($stripped_length != 0
&& $overall_length/$stripped_length <= $threshold) {
$monitor->centrifuge['ratio'] =
$overall_length/$stripped_length;
$monitor->centrifuge['threshold'] =
$threshold;
$value .= "\n$[!!!]";
}
}
if (strlen($value) > 40) {
// Replace all non-special chars
$converted = preg_replace('/[\w\s\p{L},.!]/', null, $value);
// Split string into an array, unify and sort
$array = str_split($converted);
$array = array_unique($array);
asort($array);
// Normalize certain tokens
$schemes = array(
'~' => '+',
'^' => '+',
'|' => '+',
'*' => '+',
'%' => '+',
'&' => '+',
'/' => '+'
);
$converted = implode($array);
$converted = str_replace(array_keys($schemes),
array_values($schemes), $converted);
$converted = preg_replace('/[+-]\s*\d+/', '+', $converted);
$converted = preg_replace('/[()[\]{}]/', '(', $converted);
$converted = preg_replace('/[!?:=]/', ':', $converted);
$converted = preg_replace('/[^:(+]/', null, stripslashes($converted));
// Sort again and implode
$array = str_split($converted);
asort($array);
$converted = implode($array);
if (preg_match('/(?:\({2,}\+{2,}:{2,})|(?:\({2,}\+{2,}:+)|' .
'(?:\({3,}\++:{2,})/', $converted)) {
$monitor->centrifuge['converted'] = $converted;
return $value . "\n" . $converted;
}
}
return $value;
}
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

View File

@ -0,0 +1,235 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
/**
* PHPIDS event object
*
* This class represents a certain event that occured while applying the filters
* to the supplied data. It aggregates a bunch of IDS_Filter implementations and
* is a assembled in IDS_Report.
*
* Note that this class implements both Countable and IteratorAggregate
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Group
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @version Release: $Id:Event.php 517 2007-09-15 15:04:13Z mario $
* @link http://php-ids.org/
*/
class IDS_Event implements Countable, IteratorAggregate
{
/**
* Event name
*
* @var scalar
*/
protected $name = null;
/**
* Value of the event
*
* @var scalar
*/
protected $value = null;
/**
* List of filter objects
*
* Filter objects in this array are those that matched the events value
*
* @var array
*/
protected $filters = array();
/**
* Calculated impact
*
* Total impact of the event
*
* @var integer
*/
protected $impact = 0;
/**
* Affecte tags
*
* @var array
*/
protected $tags = array();
/**
* Constructor
*
* Fills event properties
*
* @param scalar $name the event name
* @param scalar $value the event value
* @param array $filters the corresponding filters
*
* @return void
*/
public function __construct($name, $value, Array $filters)
{
if (!is_scalar($name)) {
throw new InvalidArgumentException(
'Expected $name to be a scalar,' . gettype($name) . ' given'
);
}
if (!is_scalar($value)) {
throw new InvalidArgumentException('
Expected $value to be a scalar,' . gettype($value) . ' given'
);
}
$this->name = $name;
$this->value = $value;
foreach ($filters as $filter) {
if (!$filter instanceof IDS_Filter) {
throw new InvalidArgumentException(
'Filter must be derived from IDS_Filter'
);
}
$this->filters[] = $filter;
}
}
/**
* Returns event name
*
* The name of the event usually is the key of the variable that was
* considered to be malicious
*
* @return scalar
*/
public function getName()
{
return $this->name;
}
/**
* Returns event value
*
* @return scalar
*/
public function getValue()
{
return $this->value;
}
/**
* Returns calculated impact
*
* @return integer
*/
public function getImpact()
{
if (!$this->impact) {
$this->impact = 0;
foreach ($this->filters as $filter) {
$this->impact += $filter->getImpact();
}
}
return $this->impact;
}
/**
* Returns affected tags
*
* @return array
*/
public function getTags()
{
$filters = $this->getFilters();
foreach ($filters as $filter) {
$this->tags = array_merge($this->tags,
$filter->getTags());
}
$this->tags = array_values(array_unique($this->tags));
return $this->tags;
}
/**
* Returns list of filter objects
*
* @return array
*/
public function getFilters()
{
return $this->filters;
}
/**
* Returns number of filters
*
* To implement interface Countable this returns the number of filters
* appended.
*
* @return integer
*/
public function count()
{
return count($this->getFilters());
}
/**
* IteratorAggregate iterator getter
*
* Returns an iterator to iterate over the appended filters.
*
* @return Iterator|IteratorAggregate
*/
public function getIterator()
{
return new ArrayObject($this->getFilters());
}
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

View File

@ -0,0 +1,186 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
/**
* PHPIDS Filter object
*
* Each object of this class serves as a container for a specific filter. The
* object provides methods to get information about this particular filter and
* also to match an arbitrary string against it.
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Group
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @version Release: $Id:Filter.php 517 2007-09-15 15:04:13Z mario $
* @link http://php-ids.org/
* @since Version 0.4
*/
class IDS_Filter
{
/**
* Filter rule
*
* @var string
*/
protected $rule;
/**
* List of tags of the filter
*
* @var array
*/
protected $tags = array();
/**
* Filter impact level
*
* @var integer
*/
protected $impact = 0;
/**
* Filter description
*
* @var string
*/
protected $description = null;
/**
* Constructor
*
* @param mixed $rule filter rule
* @param string $description filter description
* @param array $tags list of tags
* @param integer $impact filter impact level
*
* @return void
*/
public function __construct($id, $rule, $description, array $tags, $impact)
{
$this->id = $id;
$this->rule = $rule;
$this->tags = $tags;
$this->impact = $impact;
$this->description = $description;
}
/**
* Matches a string against current filter
*
* Matches given string against the filter rule the specific object of this
* class represents
*
* @param string $string the string to match
*
* @throws InvalidArgumentException if argument is no string
* @return boolean
*/
public function match($string)
{
if (!is_string($string)) {
throw new InvalidArgumentException('
Invalid argument. Expected a string, received ' . gettype($string)
);
}
return (bool) preg_match(
'/' . $this->getRule() . '/ms', strtolower($string)
);
}
/**
* Returns filter description
*
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* Return list of affected tags
*
* Each filter rule is concerned with a certain kind of attack vectors.
* This method returns those affected kinds.
*
* @return array
*/
public function getTags()
{
return $this->tags;
}
/**
* Returns filter rule
*
* @return string
*/
public function getRule()
{
return $this->rule;
}
/**
* Get filter impact level
*
* @return integer
*/
public function getImpact()
{
return $this->impact;
}
/**
* Get filter ID
*
* @return integer
*/
public function getId()
{
return $this->id;
}
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

View File

@ -0,0 +1,381 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
/**
* Filter Storage
*
* This class provides various default functions for gathering filter patterns
* to be used later on by the detection mechanism. You might extend this class
* to your requirements.
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Group
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @version Release: $Id:Storage.php 517 2007-09-15 15:04:13Z mario $
* @link http://php-ids.org/
*/
class IDS_Filter_Storage
{
/**
* Filter source file
*
* @var string
*/
protected $source = null;
/**
* Holds caching settings
*
* @var array
*/
protected $cacheSettings = null;
/**
* Cache container
*
* @var object IDS_Caching wrapper
*/
protected $cache = null;
/**
* Filter container
*
* @var array
*/
protected $filterSet = array();
/**
* Constructor
*
* Loads filters based on provided IDS_Init settings.
*
* @param object $init IDS_Init instance
*
* @throws Exception if unsupported filter type is given
* @return void
*/
public final function __construct(IDS_Init $init)
{
if ($init->config) {
$caching = isset($init->config['Caching']['caching']) ?
$init->config['Caching']['caching'] : 'none';
$type = $init->config['General']['filter_type'];
$this->source = $init->getBasePath()
. $init->config['General']['filter_path'];
if ($caching && $caching != 'none') {
$this->cacheSettings = $init->config['Caching'];
include_once 'IDS/Caching/Factory.php';
$this->cache = IDS_Caching::factory($init, 'storage');
}
switch ($type) {
case 'xml' :
$this->getFilterFromXML();
break;
case 'json' :
$this->getFilterFromJson();
break;
default :
throw new Exception('Unsupported filter type.');
}
}
}
/**
* Sets the filter array
*
* @param array $filterSet array containing multiple IDS_Filter instances
*
* @return object $this
*/
public final function setFilterSet($filterSet)
{
foreach ($filterSet as $filter) {
$this->addFilter($filter);
}
return $this;
}
/**
* Returns registered filters
*
* @return array
*/
public final function getFilterSet()
{
return $this->filterSet;
}
/**
* Adds a filter
*
* @param object $filter IDS_Filter instance
*
* @return object $this
*/
public final function addFilter(IDS_Filter $filter)
{
$this->filterSet[] = $filter;
return $this;
}
/**
* Checks if any filters are cached
*
* @return mixed $filters cached filters or false
*/
private function _isCached()
{
$filters = false;
if ($this->cacheSettings) {
if ($this->cache) {
$filters = $this->cache->getCache();
}
}
return $filters;
}
/**
* Loads filters from XML using SimpleXML
*
* This function parses the provided source file and stores the result.
* If caching mode is enabled the result will be cached to increase
* the performance.
*
* @throws Exception if problems with fetching the XML data occur
* @return object $this
*/
public function getFilterFromXML()
{
if (extension_loaded('SimpleXML')) {
/*
* See if filters are already available in the cache
*/
$filters = $this->_isCached();
/*
* If they aren't, parse the source file
*/
if (!$filters) {
if (file_exists($this->source)) {
if (LIBXML_VERSION >= 20621) {
$filters = simplexml_load_file($this->source,
null,
LIBXML_COMPACT);
} else {
$filters = simplexml_load_file($this->source);
}
}
}
/*
* In case we still don't have any filters loaded and exception
* will be thrown
*/
if (empty($filters)) {
throw new Exception(
'XML data could not be loaded.' .
' Make sure you specified the correct path.'
);
}
/*
* Now the storage will be filled with IDS_Filter objects
*/
$data = array();
$nocache = $filters instanceof SimpleXMLElement;
$filters = $nocache ? $filters->filter : $filters;
include_once 'IDS/Filter.php';
foreach ($filters as $filter) {
$id = $nocache ? (string) $filter->id :
$filter['id'];
$rule = $nocache ? (string) $filter->rule :
$filter['rule'];
$impact = $nocache ? (string) $filter->impact :
$filter['impact'];
$tags = $nocache ? array_values((array) $filter->tags) :
$filter['tags'];
$description = $nocache ? (string) $filter->description :
$filter['description'];
$this->addFilter(new IDS_Filter($id,
$rule,
$description,
(array) $tags[0],
(int) $impact));
$data[] = array(
'id' => $id,
'rule' => $rule,
'impact' => $impact,
'tags' => $tags,
'description' => $description
);
}
/*
* If caching is enabled, the fetched data will be cached
*/
if ($this->cacheSettings) {
$this->cache->setCache($data);
}
} else {
throw new Exception(
'SimpleXML not loaded.'
);
}
return $this;
}
/**
* Loads filters from Json file using ext/Json
*
* This function parses the provided source file and stores the result.
* If caching mode is enabled the result will be cached to increase
* the performance.
*
* @throws Exception if problems with fetching the JSON data occur
* @return object $this
*/
public function getFilterFromJson()
{
if (extension_loaded('Json')) {
/*
* See if filters are already available in the cache
*/
$filters = $this->_isCached();
/*
* If they aren't, parse the source file
*/
if (!$filters) {
if (file_exists($this->source)) {
$filters = json_decode(file_get_contents($this->source));
} else {
throw new Exception(
'JSON data could not be loaded.' .
' Make sure you specified the correct path.'
);
}
}
if (!$filters) {
throw new Exception(
'JSON data could not be loaded.' .
' Make sure you specified the correct path.'
);
}
/*
* Now the storage will be filled with IDS_Filter objects
*/
$data = array();
$nocache = !is_array($filters);
$filters = $nocache ? $filters->filters->filter : $filters;
include_once 'IDS/Filter.php';
foreach ($filters as $filter) {
$id = $nocache ? (string) $filter->id :
$filter['id'];
$rule = $nocache ? (string) $filter->rule :
$filter['rule'];
$impact = $nocache ? (string) $filter->impact :
$filter['impact'];
$tags = $nocache ? array_values((array) $filter->tags) :
$filter['tags'];
$description = $nocache ? (string) $filter->description :
$filter['description'];
$this->addFilter(new IDS_Filter($id,
$rule,
$description,
(array) $tags[0],
(int) $impact));
$data[] = array(
'id' => $id,
'rule' => $rule,
'impact' => $impact,
'tags' => $tags,
'description' => $description
);
}
/*
* If caching is enabled, the fetched data will be cached
*/
if ($this->cacheSettings) {
$this->cache->setCache($data);
}
} else {
throw new Exception(
'ext/json not loaded.'
);
}
return $this;
}
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

View File

@ -0,0 +1,232 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
/**
* Framework initiation
*
* This class is used for the purpose to initiate the framework and inhabits
* functionality to parse the needed configuration file.
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Groupup
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @version Release: $Id:Init.php 517 2007-09-15 15:04:13Z mario $
* @link http://php-ids.org/
* @since Version 0.4
*/
class IDS_Init
{
/**
* Holds config settings
*
* @var array
*/
public $config = array();
/**
* Instance of this class depending on the supplied config file
*
* @var array
* @static
*/
private static $instances = array();
/**
* Path to the config file
*
* @var string
*/
private $configPath = null;
/**
* Constructor
*
* Includes needed classes and parses the configuration file
*
* @param string $configPath the path to the config file
*
* @return object $this
*/
private function __construct($configPath = null)
{
include_once 'IDS/Monitor.php';
include_once 'IDS/Filter/Storage.php';
if ($configPath) {
$this->setConfigPath($configPath);
$this->config = parse_ini_file($this->configPath, true);
}
}
/**
* Permitting to clone this object
*
* For the sake of correctness of a singleton pattern, this is necessary
*
* @return void
*/
public final function __clone()
{
}
/**
* Returns an instance of this class. Also a PHP version check
* is being performed to avoid compatibility problems with PHP < 5.1.6
*
* @param string $configPath the path to the config file
*
* @return object
*/
public static function init($configPath = null)
{
if (!isset(self::$instances[$configPath])) {
self::$instances[$configPath] = new IDS_Init($configPath);
}
return self::$instances[$configPath];
}
/**
* Sets the path to the configuration file
*
* @param string $path the path to the config
*
* @throws Exception if file not found
* @return void
*/
public function setConfigPath($path)
{
if (file_exists($path)) {
$this->configPath = $path;
} else {
throw new Exception(
'Configuration file could not be found at ' .
htmlspecialchars($path, ENT_QUOTES, 'UTF-8')
);
}
}
/**
* Returns path to configuration file
*
* @return string the config path
*/
public function getConfigPath()
{
return $this->configPath;
}
/**
* This method checks if a base path is given and usage is set to true.
* If all that tests succeed the base path will be returned as a string -
* else null will be returned.
*
* @return string the base path or null
*/
public function getBasePath() {
return ((isset($this->config['General']['base_path'])
&& $this->config['General']['base_path']
&& isset($this->config['General']['use_base_path'])
&& $this->config['General']['use_base_path'])
? $this->config['General']['base_path'] : null);
}
/**
* Merges new settings into the exsiting ones or overwrites them
*
* @param array $config the config array
* @param boolean $overwrite config overwrite flag
*
* @return void
*/
public function setConfig(array $config, $overwrite = false)
{
if ($overwrite) {
$this->config = $this->_mergeConfig($this->config, $config);
} else {
$this->config = $this->_mergeConfig($config, $this->config);
}
}
/**
* Merge config hashes recursivly
*
* The algorithm merges configuration arrays recursively. If an element is
* an array in both, the values will be appended. If it is a scalar in both,
* the value will be replaced.
*
* @param array $current The legacy hash
* @param array $successor The hash which values count more when in doubt
* @return array Merged hash
*/
protected function _mergeConfig($current, $successor)
{
if (is_array($current) and is_array($successor)) {
foreach ($successor as $key => $value) {
if (isset($current[$key])
and is_array($value)
and is_array($current[$key])) {
$current[$key] = $this->_mergeConfig($current[$key], $value);
} else {
$current[$key] = $successor[$key];
}
}
}
return $current;
}
/**
* Returns the config array
*
* @return array the config array
*/
public function getConfig()
{
return $this->config;
}
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

View File

@ -0,0 +1,136 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
require_once 'IDS/Log/Interface.php';
/**
* Log Composite
*
* This class implements the composite pattern to allow to work with multiple
* logging wrappers at once.
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Group
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @version Release: $Id:Composite.php 517 2007-09-15 15:04:13Z mario $
* @link http://php-ids.org/
*/
class IDS_Log_Composite
{
/**
* Holds registered logging wrapper
*
* @var array
*/
public $loggers = array();
/**
* Iterates through registered loggers and executes them
*
* @param object $data IDS_Report object
*
* @return void
*/
public function execute(IDS_Report $data)
{
// make sure request uri is set right on IIS
if (!isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'], 1);
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING']) {
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}
}
// make sure server address is set right on IIS
if (isset($_SERVER['LOCAL_ADDR'])) {
$_SERVER['SERVER_ADDR'] = $_SERVER['LOCAL_ADDR'];
}
foreach ($this->loggers as $logger) {
$logger->execute($data);
}
}
/**
* Registers a new logging wrapper
*
* Only valid IDS_Log_Interface instances passed to this function will be
* registered
*
* @return void
*/
public function addLogger()
{
$args = func_get_args();
foreach ($args as $class) {
if (!in_array($class, $this->loggers) &&
($class instanceof IDS_Log_Interface)) {
$this->loggers[] = $class;
}
}
}
/**
* Removes a logger
*
* @param object $logger IDS_Log_Interface object
*
* @return boolean
*/
public function removeLogger(IDS_Log_Interface $logger)
{
$key = array_search($logger, $this->loggers);
if (isset($this->loggers[$key])) {
unset($this->loggers[$key]);
return true;
}
return false;
}
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

View File

@ -0,0 +1,285 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
require_once 'IDS/Log/Interface.php';
/*
* Needed SQL:
*
CREATE DATABASE IF NOT EXISTS `phpids` DEFAULT CHARACTER
SET utf8 COLLATE utf8_general_ci;
DROP TABLE IF EXISTS `intrusions`;
CREATE TABLE IF NOT EXISTS `intrusions` (
`id` int(11) unsigned NOT null auto_increment,
`name` varchar(128) NOT null,
`value` text NOT null,
`page` varchar(255) NOT null,
`ip` varchar(15) NOT null,
`impact` int(11) unsigned NOT null,
`origin` varchar(15) NOT null,
`created` datetime NOT null,
PRIMARY KEY (`id`)
) ENGINE=MyISAM ;
*
*
*
*/
/**
* Database logging wrapper
*
* The database wrapper is designed to store reports into an sql database. It
* implements the singleton pattern and is based in PDO, supporting
* different database types.
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Group
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @version Release: $Id:Database.php 517 2007-09-15 15:04:13Z mario $
* @link http://php-ids.org/
*/
class IDS_Log_Database implements IDS_Log_Interface
{
/**
* Database wrapper
*
* @var string
*/
private $wrapper = null;
/**
* Database user
*
* @var string
*/
private $user = null;
/**
* Database password
*
* @var string
*/
private $password = null;
/**
* Database table
*
* @var string
*/
private $table = null;
/**
* Database handle
*
* @var object PDO instance
*/
private $handle = null;
/**
* Prepared SQL statement
*
* @var string
*/
private $statement = null;
/**
* Holds current remote address
*
* @var string
*/
private $ip = 'local/unknown';
/**
* Instance container
*
* Due to the singleton pattern this class allows to initiate only one instance
* for each database wrapper.
*
* @var array
*/
private static $instances = array();
/**
* Constructor
*
* Prepares the SQL statement
*
* @param mixed $config IDS_Init instance | array
*
* @return void
*/
protected function __construct($config)
{
if ($config instanceof IDS_Init) {
$this->wrapper = $config->config['Logging']['wrapper'];
$this->user = $config->config['Logging']['user'];
$this->password = $config->config['Logging']['password'];
$this->table = $config->config['Logging']['table'];
} elseif (is_array($config)) {
$this->wrapper = $config['wrapper'];
$this->user = $config['user'];
$this->password = $config['password'];
$this->table = $config['table'];
}
// determine correct IP address
if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1') {
$this->ip = $_SERVER['REMOTE_ADDR'];
} elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$this->ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
try {
$this->handle = new PDO(
$this->wrapper,
$this->user,
$this->password
);
$this->statement = $this->handle->prepare('
INSERT INTO ' . $this->table . ' (
name,
value,
page,
ip,
impact,
origin,
created
)
VALUES (
:name,
:value,
:page,
:ip,
:impact,
:origin,
now()
)
');
} catch (PDOException $e) {
die('PDOException: ' . $e->getMessage());
}
}
/**
* Returns an instance of this class
*
* This method allows the passed argument to be either an instance of IDS_Init or
* an array.
*
* @param mixed $config IDS_Init | array
*
* @return object $this
*/
public static function getInstance($config)
{
if ($config instanceof IDS_Init) {
$wrapper = $config->config['Logging']['wrapper'];
} elseif (is_array($config)) {
$wrapper = $config['wrapper'];
}
if (!isset(self::$instances[$wrapper])) {
self::$instances[$wrapper] = new IDS_Log_Database($config);
}
return self::$instances[$wrapper];
}
/**
* Permitting to clone this object
*
* For the sake of correctness of a singleton pattern, this is necessary
*
* @return void
*/
private function __clone()
{
}
/**
* Stores given data into the database
*
* @param object $data IDS_Report instance
*
* @throws Exception if db error occurred
* @return boolean
*/
public function execute(IDS_Report $data)
{
if (!isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'], 1);
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING']) {
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}
}
foreach ($data as $event) {
$page = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
$ip = $this->ip;
$this->statement->bindParam('name', $event->getName());
$this->statement->bindParam('value', $event->getValue());
$this->statement->bindParam('page', $page);
$this->statement->bindParam('ip', $ip);
$this->statement->bindParam('impact', $data->getImpact());
$this->statement->bindParam('origin', $_SERVER['SERVER_ADDR']);
if (!$this->statement->execute()) {
$info = $this->statement->errorInfo();
throw new Exception(
$this->statement->errorCode() . ', ' . $info[1] . ', ' . $info[2]
);
}
}
return true;
}
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

View File

@ -0,0 +1,401 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
require_once 'IDS/Log/Interface.php';
/**
* Email logging wrapper
*
* The Email wrapper is designed to send reports via email. It implements the
* singleton pattern.
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Group
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @version Release: $Id:Email.php 517 2007-09-15 15:04:13Z mario $
* @link http://php-ids.org/
*/
class IDS_Log_Email implements IDS_Log_Interface
{
/**
* Recipient container
*
* @var array
*/
private $recipients = array();
/**
* Mail subject
*
* @var string
*/
private $subject = null;
/**
* Additional mail headers
*
* @var string
*/
private $headers = null;
/**
* Safemode switch
*
* Using this switch it is possible to enable safemode, which is a spam
* protection based on the alert frequency.
*
* @var boolean
*/
private $safemode = true;
/**
* Urlencode for result strings
*
* This switch is true by default. Setting it to false removes
* the 'better safe than sorry' urlencoding for the result string in
* the report mails. Enhances readability but maybe XSSes email clients.
*
* @var boolean
*/
private $urlencode = true;
/**
* Send rate
*
* If safemode is enabled, this property defines how often reports will be
* sent out. Default value is 15, which means that a mail will be sent on
* condition that the last email has not been sent earlier than 15 seconds ago.
*
* @var integer
*/
private $allowed_rate = 15;
/**
* PHPIDS temp directory
*
* When safemod is enabled, a path to a temp directory is needed to
* store some information. Default is IDS/tmp/
*
* @var string
*/
private $tmp_path = 'IDS/tmp/';
/**
* File prefix for tmp files
*
* @var string
*/
private $file_prefix = 'PHPIDS_Log_Email_';
/**
* Holds current remote address
*
* @var string
*/
private $ip = 'local/unknown';
/**
* Instance container
*
* @var array
*/
private static $instance = array();
/**
* Constructor
*
* @param mixed $config IDS_Init instance | array
*
* @return void
*/
protected function __construct($config)
{
if ($config instanceof IDS_Init) {
$this->recipients = $config->config['Logging']['recipients'];
$this->subject = $config->config['Logging']['subject'];
$this->headers = $config->config['Logging']['header'];
$this->envelope = $config->config['Logging']['envelope'];
$this->safemode = $config->config['Logging']['safemode'];
$this->urlencode = $config->config['Logging']['urlencode'];
$this->allowed_rate = $config->config['Logging']['allowed_rate'];
$this->tmp_path = $config->getBasePath()
. $config->config['General']['tmp_path'];
} elseif (is_array($config)) {
$this->recipients[] = $config['recipients'];
$this->subject = $config['subject'];
$this->additionalHeaders = $config['header'];
}
// determine correct IP address and concat them if necessary
$this->ip = $_SERVER['REMOTE_ADDR'] .
(isset($_SERVER['HTTP_X_FORWARDED_FOR']) ?
' (' . $_SERVER['HTTP_X_FORWARDED_FOR'] . ')' : '');
}
/**
* Returns an instance of this class
*
* This method allows the passed argument to be either an instance of
* IDS_Init or an array.
*
* @param mixed $config IDS_Init | array
*
* @return object $this
*/
public static function getInstance($config)
{
if (!self::$instance) {
self::$instance = new IDS_Log_Email($config);
}
return self::$instance;
}
/**
* Permitting to clone this object
*
* For the sake of correctness of a singleton pattern, this is necessary
*
* @return void
*/
private function __clone()
{
}
/**
* Detects spam attempts
*
* To avoid mail spam through this logging class this function is used
* to detect such attempts based on the alert frequency.
*
* @return boolean
*/
protected function isSpamAttempt()
{
/*
* loop through all files in the tmp directory and
* delete garbage files
*/
$dir = $this->tmp_path;
$numPrefixChars = strlen($this->file_prefix);
$files = scandir($dir);
foreach ($files as $file) {
if (is_file($dir . $file)) {
if (substr($file, 0, $numPrefixChars) == $this->file_prefix) {
$lastModified = filemtime($dir . $file);
if ((
time() - $lastModified) > 3600) {
unlink($dir . $file);
}
}
}
}
/*
* end deleting garbage files
*/
$remoteAddr = $this->ip;
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$filename = $this->file_prefix . md5($remoteAddr.$userAgent) . '.tmp';
$file = $dir . DIRECTORY_SEPARATOR . $filename;
if (!file_exists($file)) {
$handle = fopen($file, 'w');
fwrite($handle, time());
fclose($handle);
return false;
}
$lastAttack = file_get_contents($file);
$difference = time() - $lastAttack;
if ($difference > $this->allowed_rate) {
unlink($file);
} else {
return true;
}
return false;
}
/**
* Prepares data
*
* Converts given data into a format that can be read in an email.
* You might edit this method to your requirements.
*
* @param mixed $data the report data
*
* @return string
*/
protected function prepareData($data)
{
$format = "The following attack has been detected by PHPIDS\n\n";
$format .= "IP: %s \n";
$format .= "Date: %s \n";
$format .= "Impact: %d \n";
$format .= "Affected tags: %s \n";
$attackedParameters = '';
foreach ($data as $event) {
$attackedParameters .= $event->getName() . '=' .
((!isset($this->urlencode) ||$this->urlencode)
? urlencode($event->getValue())
: $event->getValue()) . ", ";
}
$format .= "Affected parameters: %s \n";
$format .= "Request URI: %s \n";
$format .= "Origin: %s \n";
return sprintf($format,
$this->ip,
date('c'),
$data->getImpact(),
join(' ', $data->getTags()),
trim($attackedParameters),
urlencode($_SERVER['REQUEST_URI']),
$_SERVER['SERVER_ADDR']);
}
/**
* Sends the report to registered recipients
*
* @param object $data IDS_Report instance
*
* @throws Exception if data is no string
* @return boolean
*/
public function execute(IDS_Report $data)
{
if ($this->safemode) {
if ($this->isSpamAttempt()) {
return false;
}
}
/*
* In case the data has been modified before it might
* be necessary to convert it to string since it's pretty
* senseless to send array or object via e-mail
*/
$data = $this->prepareData($data);
if (is_string($data)) {
$data = trim($data);
// if headers are passed as array, we need to make a string of it
if (is_array($this->headers)) {
$headers = "";
foreach ($this->headers as $header) {
$headers .= $header . "\r\n";
}
} else {
$headers = $this->headers;
}
if (!empty($this->recipients)) {
if (is_array($this->recipients)) {
foreach ($this->recipients as $address) {
$this->send(
$address,
$data,
$headers,
$this->envelope
);
}
} else {
$this->send(
$this->recipients,
$data,
$headers,
$this->envelope
);
}
}
} else {
throw new Exception(
'Please make sure that data returned by
IDS_Log_Email::prepareData() is a string.'
);
}
return true;
}
/**
* Sends an email
*
* @param string $address email address
* @param string $data the report data
* @param string $headers the mail headers
* @param string $envelope the optional envelope string
*
* @return boolean
*/
protected function send($address, $data, $headers, $envelope = null)
{
if (!$envelope || strpos(ini_get('sendmail_path'),' -f') !== false) {
return mail($address,
$this->subject,
$data,
$headers);
} else {
return mail($address,
$this->subject,
$data,
$headers,
'-f' . $envelope);
}
}
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

View File

@ -0,0 +1,229 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
require_once 'IDS/Log/Interface.php';
/**
* File logging wrapper
*
* The file wrapper is designed to store data into a flatfile. It implements the
* singleton pattern.
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Group
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @version Release: $Id:File.php 517 2007-09-15 15:04:13Z mario $
* @link http://php-ids.org/
*/
class IDS_Log_File implements IDS_Log_Interface
{
/**
* Path to the log file
*
* @var string
*/
private $logfile = null;
/**
* Instance container
*
* Due to the singleton pattern this class allows to initiate only one
* instance for each file.
*
* @var array
*/
private static $instances = array();
/**
* Holds current remote address
*
* @var string
*/
private $ip = 'local/unknown';
/**
* Constructor
*
* @param string $logfile path to the log file
*
* @return void
*/
protected function __construct($logfile)
{
// determine correct IP address
if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1') {
$this->ip = $_SERVER['REMOTE_ADDR'];
} elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$this->ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
$this->logfile = $logfile;
}
/**
* Returns an instance of this class
*
* This method allows the passed argument to be either an instance of
* IDS_Init or a path to a log file. Due to the singleton pattern only one
* instance for each file can be initiated.
*
* @param mixed $config IDS_Init or path to a file
*
* @return object $this
*/
public static function getInstance($config)
{
if ($config instanceof IDS_Init) {
$logfile = $config->getBasePath() . $config->config['Logging']['path'];
} elseif (is_string($config)) {
$logfile = $config;
}
if (!isset(self::$instances[$logfile])) {
self::$instances[$logfile] = new IDS_Log_File($logfile);
}
return self::$instances[$logfile];
}
/**
* Permitting to clone this object
*
* For the sake of correctness of a singleton pattern, this is necessary
*
* @return void
*/
private function __clone()
{
}
/**
* Prepares data
*
* Converts given data into a format that can be stored into a file.
* You might edit this method to your requirements.
*
* @param mixed $data incoming report data
*
* @return string
*/
protected function prepareData($data)
{
$format = '"%s",%s,%d,"%s","%s","%s","%s"';
$attackedParameters = '';
foreach ($data as $event) {
$attackedParameters .= $event->getName() . '=' .
rawurlencode($event->getValue()) . ' ';
}
$dataString = sprintf($format,
$this->ip,
date('c'),
$data->getImpact(),
join(' ', $data->getTags()),
trim($attackedParameters),
urlencode($_SERVER['REQUEST_URI']),
$_SERVER['SERVER_ADDR']);
return $dataString;
}
/**
* Stores given data into a file
*
* @param object $data IDS_Report
*
* @throws Exception if the logfile isn't writeable
* @return mixed
*/
public function execute(IDS_Report $data)
{
/*
* In case the data has been modified before it might be necessary
* to convert it to string since we can't store array or object
* into a file
*/
$data = $this->prepareData($data);
if (is_string($data)) {
if (file_exists($this->logfile)) {
$data = trim($data);
if (!empty($data)) {
if (is_writable($this->logfile)) {
$handle = fopen($this->logfile, 'a');
fwrite($handle, trim($data) . "\n");
fclose($handle);
} else {
throw new Exception(
'Please make sure that ' . $this->logfile .
' is writeable.'
);
}
}
} else {
throw new Exception(
'Given file does not exist. Please make sure the
logfile is present in the given directory.'
);
}
} else {
throw new Exception(
'Please make sure that data returned by
IDS_Log_File::prepareData() is a string.'
);
}
return true;
}
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

View File

@ -0,0 +1,65 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
/**
* Interface for logging wrappers
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Group
* @version Release: $Id:Interface.php 517 2007-09-15 15:04:13Z mario $
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
interface IDS_Log_Interface
{
/**
* Interface method
*
* @param IDS_Report $data the report data
*
* @return void
*/
public function execute(IDS_Report $data);
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

View File

@ -0,0 +1,681 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
/**
* Monitoring engine
*
* This class represents the core of the frameworks attack detection mechanism
* and provides functions to scan incoming data for malicious appearing script
* fragments.
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Group
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @version Release: $Id:Monitor.php 949 2008-06-28 01:26:03Z christ1an $
* @link http://php-ids.org/
*/
class IDS_Monitor
{
/**
* Tags to define what to search for
*
* Accepted values are xss, csrf, sqli, dt, id, lfi, rfe, spam, dos
*
* @var array
*/
private $tags = null;
/**
* Request array
*
* Array containing raw data to search in
*
* @var array
*/
private $request = null;
/**
* Container for filter rules
*
* Holds an instance of IDS_Filter_Storage
*
* @var object
*/
private $storage = null;
/**
* Results
*
* Holds an instance of IDS_Report which itself provides an API to
* access the detected results
*
* @var object
*/
private $report = null;
/**
* Scan keys switch
*
* Enabling this property will cause the monitor to scan both the key and
* the value of variables
*
* @var boolean
*/
public $scanKeys = false;
/**
* Exception container
*
* Using this array it is possible to define variables that must not be
* scanned. Per default, utmz google analytics parameters are permitted.
*
* @var array
*/
private $exceptions = array();
/**
* Html container
*
* Using this array it is possible to define variables that legally
* contain html and have to be prepared before hitting the rules to
* avoid too many false alerts
*
* @var array
*/
private $html = array();
/**
* JSON container
*
* Using this array it is possible to define variables that contain
* JSON data - and should be treated as such
*
* @var array
*/
private $json = array();
/**
* Holds HTMLPurifier object
*
* @var object
*/
private $htmlpurifier = NULL;
/**
* Path to HTMLPurifier source
*
* This path might be changed in case one wishes to make use of a
* different HTMLPurifier source file e.g. if already used in the
* application PHPIDS is protecting
*
* @var string
*/
private $pathToHTMLPurifier = '';
/**
* HTMLPurifier cache directory
*
* @var string
*/
private $HTMLPurifierCache = '';
/**
* This property holds the tmp JSON string from the
* _jsonDecodeValues() callback
*
* @var string
*/
private $tmpJsonString = '';
/**
* Constructor
*
* @param array $request array to scan
* @param object $init instance of IDS_Init
* @param array $tags list of tags to which filters should be applied
*
* @return void
*/
public function __construct(array $request, IDS_Init $init, array $tags = null)
{
$version = isset($init->config['General']['min_php_version'])
? $init->config['General']['min_php_version'] : '5.1.6';
if (version_compare(PHP_VERSION, $version, '<')) {
throw new Exception(
'PHP version has to be equal or higher than ' . $version . ' or
PHP version couldn\'t be determined'
);
}
if (!empty($request)) {
$this->storage = new IDS_Filter_Storage($init);
$this->request = $request;
$this->tags = $tags;
$this->scanKeys = $init->config['General']['scan_keys'];
$this->exceptions = isset($init->config['General']['exceptions'])
? $init->config['General']['exceptions'] : false;
$this->html = isset($init->config['General']['html'])
? $init->config['General']['html'] : false;
$this->json = isset($init->config['General']['json'])
? $init->config['General']['json'] : false;
if(isset($init->config['General']['HTML_Purifier_Path'])
&& isset($init->config['General']['HTML_Purifier_Cache'])) {
$this->pathToHTMLPurifier =
$init->config['General']['HTML_Purifier_Path'];
$this->HTMLPurifierCache =
$init->config['General']['HTML_Purifier_Cache'];
}
}
if (!is_writeable($init->getBasePath()
. $init->config['General']['tmp_path'])) {
throw new Exception(
'Please make sure the ' .
htmlspecialchars($init->getBasePath() .
$init->config['General']['tmp_path'], ENT_QUOTES, 'UTF-8') .
' folder is writable'
);
}
include_once 'IDS/Report.php';
$this->report = new IDS_Report;
}
/**
* Starts the scan mechanism
*
* @return object IDS_Report
*/
public function run()
{
if (!empty($this->request)) {
foreach ($this->request as $key => $value) {
$this->_iterate($key, $value);
}
}
return $this->getReport();
}
/**
* Iterates through given data and delegates it to IDS_Monitor::_detect() in
* order to check for malicious appearing fragments
*
* @param mixed $key the former array key
* @param mixed $value the former array value
*
* @return void
*/
private function _iterate($key, $value)
{
if (!is_array($value)) {
if (is_string($value)) {
if ($filter = $this->_detect($key, $value)) {
include_once 'IDS/Event.php';
$this->report->addEvent(
new IDS_Event(
$key,
$value,
$filter
)
);
}
}
} else {
foreach ($value as $subKey => $subValue) {
$this->_iterate($key . '.' . $subKey, $subValue);
}
}
}
/**
* Checks whether given value matches any of the supplied filter patterns
*
* @param mixed $key the key of the value to scan
* @param mixed $value the value to scan
*
* @return bool|array false or array of filter(s) that matched the value
*/
private function _detect($key, $value)
{
// to increase performance, only start detection if value
// isn't alphanumeric
if (!$value || !preg_match('/[^\w\s\/@!?,\.]+|(?:\.\/)|(?:@@\w+)/', $value)) {
return false;
}
// check if this field is part of the exceptions
if (is_array($this->exceptions)
&& in_array($key, $this->exceptions, true)) {
return false;
}
// check for magic quotes and remove them if necessary
if (function_exists('get_magic_quotes_gpc')
&& get_magic_quotes_gpc()) {
$value = stripslashes($value);
}
// if html monitoring is enabled for this field - then do it!
if (is_array($this->html) && in_array($key, $this->html, true)) {
list($key, $value) = $this->_purifyValues($key, $value);
}
// check if json monitoring is enabled for this field
if (is_array($this->json) && in_array($key, $this->json, true)) {
list($key, $value) = $this->_jsonDecodeValues($key, $value);
}
// use the converter
include_once 'IDS/Converter.php';
$value = IDS_Converter::runAll($value);
$value = IDS_Converter::runCentrifuge($value, $this);
// scan keys if activated via config
$key = $this->scanKeys ? IDS_Converter::runAll($key)
: $key;
$key = $this->scanKeys ? IDS_Converter::runCentrifuge($key, $this)
: $key;
$filters = array();
$filterSet = $this->storage->getFilterSet();
foreach ($filterSet as $filter) {
/*
* in case we have a tag array specified the IDS will only
* use those filters that are meant to detect any of the
* defined tags
*/
if (is_array($this->tags)) {
if (array_intersect($this->tags, $filter->getTags())) {
if ($this->_match($key, $value, $filter)) {
$filters[] = $filter;
}
}
} else {
if ($this->_match($key, $value, $filter)) {
$filters[] = $filter;
}
}
}
return empty($filters) ? false : $filters;
}
/**
* Purifies given key and value variables using HTMLPurifier
*
* This function is needed whenever there is variables for which HTML
* might be allowed like e.g. WYSIWYG post bodies. It will dectect malicious
* code fragments and leaves harmless parts untouched.
*
* @param mixed $key
* @param mixed $value
* @since 0.5
*
* @return array
*/
private function _purifyValues($key, $value) {
include_once $this->pathToHTMLPurifier;
if (!is_writeable($this->HTMLPurifierCache)) {
throw new Exception(
$this->HTMLPurifierCache . ' must be writeable');
}
if (class_exists('HTMLPurifier')) {
$config = HTMLPurifier_Config::createDefault();
$config->set('Attr', 'EnableID', true);
$config->set('Cache', 'SerializerPath', $this->HTMLPurifierCache);
$config->set('Output', 'Newline', "\n");
$this->htmlpurifier = new HTMLPurifier($config);
} else {
throw new Exception(
'HTMLPurifier class could not be found - ' .
'make sure the purifier files are valid and' .
' the path is correct'
);
}
$purified_value = $this->htmlpurifier->purify($value);
$purified_key = $this->htmlpurifier->purify($key);
$redux_value = strip_tags($value);
$redux_key = strip_tags($key);
if ($value != $purified_value || $redux_value) {
$value = $this->_diff($value, $purified_value, $redux_value);
} else {
$value = NULL;
}
if ($key != $purified_key) {
$key = $this->_diff($key, $purified_key, $redux_key);
} else {
$key = NULL;
}
return array($key, $value);
}
/**
* This method calculates the difference between the original
* and the purified markup strings.
*
* @param string $original the original markup
* @param string $purified the purified markup
* @param string $redux the string without html
* @since 0.5
*
* @return string the difference between the strings
*/
private function _diff($original, $purified, $redux)
{
/*
* deal with over-sensitive alt-attribute addition of the purifier
* and other common html formatting problems
*/
$purified = preg_replace('/\s+alt="[^"]*"/m', null, $purified);
$purified = preg_replace('/=?\s*"\s*"/m', null, $purified);
$original = preg_replace('/=?\s*"\s*"/m', null, $original);
$original = preg_replace('/\s+alt=?/m', null, $original);
// check which string is longer
$length = (strlen($original) - strlen($purified));
/*
* Calculate the difference between the original html input
* and the purified string.
*/
if ($length > 0) {
$array_2 = str_split($original);
$array_1 = str_split($purified);
} else {
$array_1 = str_split($original);
$array_2 = str_split($purified);
}
foreach ($array_2 as $key => $value) {
if ($value !== $array_1[$key]) {
$array_1 = array_reverse($array_1);
$array_1[] = $value;
$array_1 = array_reverse($array_1);
}
}
// return the diff - ready to hit the converter and the rules
$diff = trim(join('', array_reverse(
(array_slice($array_1, 0, $length)))));
// clean up spaces between tag delimiters
$diff = preg_replace('/>\s*</m', '><', $diff);
// correct over-sensitively stripped bad html elements
$diff = preg_replace('/[^<](iframe|script|embed|object' .
'|applet|base|img|style)/m', '<$1', $diff);
if ($original == $purified && !$redux) {
return null;
}
return $diff . $redux;
}
/**
* This method prepares incoming JSON data for the PHPIDS detection
* process. It utilizes _jsonConcatContents() as callback and returns a
* string version of the JSON data structures.
*
* @param mixed $key
* @param mixed $value
* @since 0.5.3
*
* @return array
*/
private function _jsonDecodeValues($key, $value) {
$tmp_key = json_decode($key);
$tmp_value = json_decode($value);
if($tmp_value && is_array($tmp_value) || is_object($tmp_value)) {
array_walk_recursive($tmp_value, array($this, '_jsonConcatContents'));
$value = $this->tmpJsonString;
}
if($tmp_key && is_array($tmp_key) || is_object($tmp_key)) {
array_walk_recursive($tmp_key, array($this, '_jsonConcatContents'));
$key = $this->tmpJsonString;
}
return array($key, $value);
}
/**
* This is the callback used in _jsonDecodeValues(). The method
* concatenates key and value and stores them in $this->tmpJsonString.
*
* @param mixed $key
* @param mixed $value
* @since 0.5.3
*
* @return void
*/
private function _jsonConcatContents($key, $value) {
$this->tmpJsonString .= $key . " " . $value . "\n";
}
/**
* Matches given value and/or key against given filter
*
* @param mixed $key the key to optionally scan
* @param mixed $value the value to scan
* @param object $filter the filter object
*
* @return boolean
*/
private function _match($key, $value, $filter)
{
if ($this->scanKeys) {
if ($filter->match($key)) {
return true;
}
}
if ($filter->match($value)) {
return true;
}
return false;
}
/**
* Sets exception array
*
* @param mixed $exceptions the thrown exceptions
*
* @return void
*/
public function setExceptions($exceptions)
{
if (!is_array($exceptions)) {
$exceptions = array($exceptions);
}
$this->exceptions = $exceptions;
}
/**
* Returns exception array
*
* @return array
*/
public function getExceptions()
{
return $this->exceptions;
}
/**
* Sets html array
*
* @param mixed $html the fields containing html
* @since 0.5
*
* @return void
*/
public function setHtml($html)
{
if (!is_array($html)) {
$html = array($html);
}
$this->html = $html;
}
/**
* Adds a value to the html array
*
* @since 0.5
*
* @return void
*/
public function addHtml($value)
{
$this->html[] = $value;
}
/**
* Returns html array
*
* @since 0.5
*
* @return array the fields that contain allowed html
*/
public function getHtml()
{
return $this->html;
}
/**
* Sets json array
*
* @param mixed $json the fields containing json
* @since 0.5.3
*
* @return void
*/
public function setJson($json)
{
if (!is_array($json)) {
$json = array($json);
}
$this->json = $json;
}
/**
* Adds a value to the json array
*
* @since 0.5.3
*
* @return void
*/
public function addJson($value)
{
$this->json[] = $value;
}
/**
* Returns json array
*
* @since 0.5.3
*
* @return array the fields that contain json
*/
public function getJson()
{
return $this->json;
}
/**
* Returns storage container
*
* @return array
*/
public function getStorage()
{
return $this->storage;
}
/**
* Returns report object providing various functions to work with
* detected results. Also the centrifuge data is being set as property
* of the report object.
*
* @return object IDS_Report
*/
public function getReport()
{
if (isset($this->centrifuge) && $this->centrifuge) {
$this->report->setCentrifuge($this->centrifuge);
}
return $this->report;
}
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

View File

@ -0,0 +1,341 @@
<?php
/**
* PHPIDS
*
* Requirements: PHP5, SimpleXML
*
* Copyright (c) 2008 PHPIDS group (http://php-ids.org)
*
* PHPIDS 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, version 3 of the License, or
* (at your option) any later version.
*
* PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5.1.6+
*
* @category Security
* @package PHPIDS
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Christian Matthies <ch0012@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @link http://php-ids.org/
*/
/**
* PHPIDS report object
*
* The report objects collects a number of events and thereby presents the
* detected results. It provides a convenient API to work with the results.
*
* Note that this class implements Countable, IteratorAggregate and
* a __toString() method
*
* @category Security
* @package PHPIDS
* @author Christian Matthies <ch0012@gmail.com>
* @author Mario Heiderich <mario.heiderich@gmail.com>
* @author Lars Strojny <lars@strojny.net>
* @copyright 2007 The PHPIDS Group
* @license http://www.gnu.org/licenses/lgpl.html LGPL
* @version Release: $Id:Report.php 517 2007-09-15 15:04:13Z mario $
* @link http://php-ids.org/
*/
class IDS_Report implements Countable, IteratorAggregate
{
/**
* Event container
*
* @var array
*/
protected $events = array();
/**
* List of affected tags
*
* This list of tags is collected from the collected event objects on
* demand when IDS_Report->getTags() is called
*
* @var array
*/
protected $tags = array();
/**
* Impact level
*
* The impact level is calculated on demand by adding the results of the
* event objects on IDS_Report->getImpact()
*
* @var integer
*/
protected $impact = 0;
/**
* Centrifuge data
*
* This variable - initiated as an empty array - carries all information
* about the centrifuge data if available
*
* @var array
*/
protected $centrifuge = array();
/**
* Constructor
*
* @param array $events the events the report should include
*
* @return void
*/
public function __construct(array $events = null)
{
if ($events) {
foreach ($events as $event) {
$this->addEvent($event);
}
}
}
/**
* Adds an IDS_Event object to the report
*
* @param object $event IDS_Event
*
* @return object $this
*/
public function addEvent(IDS_Event $event)
{
$this->clear();
$this->events[$event->getName()] = $event;
return $this;
}
/**
* Get event by name
*
* In most cases an event is identified by the key of the variable that
* contained maliciously appearing content
*
* @param scalar $name the event name
*
* @throws InvalidArgumentException if argument is invalid
* @return mixed IDS_Event object or false if the event does not exist
*/
public function getEvent($name)
{
if (!is_scalar($name)) {
throw new InvalidArgumentException(
'Invalid argument type given'
);
}
if ($this->hasEvent($name)) {
return $this->events[$name];
}
return false;
}
/**
* Returns list of affected tags
*
* @return array
*/
public function getTags()
{
if (!$this->tags) {
$this->tags = array();
foreach ($this->events as $event) {
$this->tags = array_merge($this->tags,
$event->getTags());
}
$this->tags = array_values(array_unique($this->tags));
}
return $this->tags;
}
/**
* Returns total impact
*
* Each stored IDS_Event object and its IDS_Filter sub-object are called
* to calculate the overall impact level of this request
*
* @return integer
*/
public function getImpact()
{
if (!$this->impact) {
$this->impact = 0;
foreach ($this->events as $event) {
$this->impact += $event->getImpact();
}
}
return $this->impact;
}
/**
* Checks if a specific event with given name exists
*
* @param scalar $name the event name
*
* @throws InvalidArgumentException if argument is illegal
*
* @return boolean
*/
public function hasEvent($name)
{
if (!is_scalar($name)) {
throw new InvalidArgumentException('Invalid argument given');
}
return isset($this->events[$name]);
}
/**
* Returns total amount of events
*
* @return integer
*/
public function count()
{
return count($this->events);
}
/**
* Return iterator object
*
* In order to provide the possibility to directly iterate over the
* IDS_Event object the IteratorAggregate is implemented. One can easily
* use foreach() to iterate through all stored IDS_Event objects.
*
* @return Iterator
*/
public function getIterator()
{
return new ArrayObject($this->events);
}
/**
* Checks if any events are registered
*
* @return boolean
*/
public function isEmpty()
{
return empty($this->events);
}
/**
* Clears calculated/collected values
*
* @return void
*/
protected function clear()
{
$this->impact = 0;
$this->tags = array();
}
/**
* This method returns the centrifuge property or null if not
* filled with data
*
* @return array/null
*/
public function getCentrifuge()
{
return ($this->centrifuge && count($this->centrifuge) > 0)
? $this->centrifuge : null;
}
/**
* This method sets the centrifuge property
*
* @param array $centrifuge the centrifuge data
*
* @throws InvalidArgumentException if argument is illegal
*
* @return boolean true is arguments were valid
*/
public function setCentrifuge($centrifuge = array())
{
if (is_array($centrifuge) && $centrifuge) {
$this->centrifuge = $centrifuge;
return true;
}
throw new InvalidArgumentException('Invalid argument given');
}
/**
* Directly outputs all available information
*
* @return string
*/
public function __toString()
{
if (!$this->isEmpty()) {
$output = '';
$output .= 'Total impact: ' . $this->getImpact() . "<br/>\n";
$output .= 'Affected tags: ' . join(', ', $this->getTags()) .
"<br/>\n";
foreach ($this->events as $event) {
$output .= "<br/>\nVariable: " .
htmlspecialchars($event->getName()) . ' | Value: ' .
htmlspecialchars($event->getValue()) . "<br/>\n";
$output .= 'Impact: ' . $event->getImpact() . ' | Tags: ' .
join(', ', $event->getTags()) . "<br/>\n";
foreach ($event as $filter) {
$output .= 'Description: ' . $filter->getDescription() .
' | ';
$output .= 'Tags: ' . join(', ', $filter->getTags()) .
' | ';
$output .= 'ID: ' . $filter->getId() .
"<br/>\n";
}
}
$output .= '<br/>';
if ($centrifuge = $this->getCentrifuge()) {
$output .= 'Centrifuge detection data';
$output .= '<br/> Threshold: ' .
((isset($centrifuge['threshold'])&&$centrifuge['threshold']) ?
$centrifuge['threshold'] : '---');
$output .= '<br/> Ratio: ' .
((isset($centrifuge['ratio'])&&$centrifuge['ratio']) ?
$centrifuge['ratio'] : '---');
if(isset($centrifuge['converted'])) {
$output .= '<br/> Converted: ' . $centrifuge['converted'];
}
$output .= "<br/><br/>\n";
}
}
return isset($output) ? $output : '';
}
}
/**
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 expandtab
*/

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More