Sponsored Content
Full Discussion: PHP TCP Shell
Top Forums Shell Programming and Scripting PHP TCP Shell Post 302933701 by Chubler_XL on Sunday 1st of February 2015 10:40:34 PM
Old 02-01-2015
I'd say there is a very good chance that SELinux is stopping Apache from executing a shell. You can imagine that this sort of thing could be quite dangerous on most systems.

You may find some audit logging info in /var/log/audit/audit.log or /var/log/messages
 

10 More Discussions You Might Find Interesting

1. Cybersecurity

Tcp/ip

!HELLO , What is the maximum number of hosts on a TCP/IP internet? plz can u help me. :rolleyes: (2 Replies)
Discussion started by: smdakram
2 Replies

2. OS X (Apple)

Error when trying to use PHP shell.

Hi, Now that I'm going to be using my Mac as a web host, I decided to use the PHP shell. However, when I type php straight in the terminal, the session freezes. Is there anything wrong that I'm doing? (3 Replies)
Discussion started by: Danny_10
3 Replies

3. IP Networking

Tcp\ip

I have written a TCP/IP client and server program. The client sends a message to the server and then the server sends a file back to the client. The client reads the buffer and stores it another file in the client side. I need to know what are the various exceptions that I need to handle in... (0 Replies)
Discussion started by: Rajeshsu
0 Replies

4. AIX

TCP/IP Inerface

Hi, Is there anyway to bring down ethernet interface using non-root ID? Appreciate if you could advice how to do that using non-root ID and what are previleges required in order to perform the tasks. Thanks (1 Reply)
Discussion started by: srllee
1 Replies

5. Shell Programming and Scripting

Shell Script from PHP not able to cp or mv or anything

Hi there, For some reason my maintenance mode shell script is not working. Both shell scripts are chmod +x'd, and owned by apache, running from php using exec(), maintenance.html and htaccessmaintenance are both owned by apache. My code is: #/bin/bash cp maintenance.html... (2 Replies)
Discussion started by: CharlesKirk
2 Replies

6. Solaris

Too much TCP retransmitted and TCP duplicate on server Oracle Solaris 10

I have problem with oracle solaris 10 running on oracle sparc T4-2 server. Os information: 5.10 Generic_150400-03 sun4v sparc sun4v Output from tcpstat.d script TCP bytes: out outRetrans in inDup inUnorder 6833763 7300 98884 0... (2 Replies)
Discussion started by: insatiable1610
2 Replies

7. Shell Programming and Scripting

Help with shell script to check the tcp network connectivity between server

Hello, I have a requirement to check the tcp network connectivity between server it's running on and the list of host's and ports combination. i have written the below code but it doesn't work, but when i execute the nc command outside the script it works fine. please help me where i am... (8 Replies)
Discussion started by: sknovice
8 Replies

8. Shell Programming and Scripting

Executing from shell , not from php

Hi, When I run command from php as www-data: cordova platform add android .. I get error without any solution in google. But when I run it from shell (also as www-data) - it works! So.. how to do to run this command from php but in shell (tty) not from php? Regards! (5 Replies)
Discussion started by: wrkilu
5 Replies

9. Shell Programming and Scripting

Running php index.php as shell in webpage

so i have a bit of a unique situation. i have an encrypted index.php file that that can't be run the normal way that a web browser would run it. if it is run the normal way, the php script will show only gibberish on the web browser, instead of the actual php code. when run from the command... (8 Replies)
Discussion started by: SkySmart
8 Replies

10. Shell Programming and Scripting

How to tell php to read shell?

.... Solved.... .. .. Hello, I've read couples of similar threads to my question and I strongly believe that I am doing something wrong. What I'm trying to do is to process data with php. It reads data from shell script. Everything goes well but at the end it does not print what it reads... (0 Replies)
Discussion started by: baris35
0 Replies
Apache::TestRunPHP(3)					User Contributed Perl Documentation				     Apache::TestRunPHP(3)

NAME
Apache::TestRunPHP - configure and run a PHP-based test suite SYNOPSIS
use Apache::TestRunPHP; Apache::TestRunPHP->new->run(@ARGV); DESCRIPTION
The "Apache::TestRunPHP" package controls the configuration and running of the test suite for PHP-based tests. It's a subclass of "Apache::TestRun" and similar in function to "Apache::TestRunPerl". Refer to the "Apache::TestRun" manpage for information on the available API. EXAMPLE
"TestRunPHP" works almost identially to "TestRunPerl", but in case you are new to "Apache-Test" here is a quick getting started guide. be sure to see the links at the end of this document for places to find additional details. because "Apache-Test" is a Perl-based testing framework we start from a "Makefile.PL", which should have the following lines (in addition to the standard "Makefile.PL" parts): use Apache::TestMM qw(test clean); use Apache::TestRunPHP (); Apache::TestMM::filter_args(); Apache::TestRunPHP->generate_script(); "generate_script()" will create a script named "t/TEST", the gateway to the Perl testing harness and what is invoked when you call "make test". "filter_args()" accepts some "Apache::Test"-specific arguments and passes them along. for example, to point to a specific "httpd" installation you would invoke "Makefile.PL" as follows $ perl Makefile.PL -httpd /my/local/apache/bin/httpd and "/my/local/apache/bin/httpd" will be propagated throughout the rest of the process. note that PHP needs to be active within Apache prior to configuring the test framework as shown above, either by virtue of PHP being compiled into the "httpd" binary statically or through an active "LoadModule" statement within the configuration located in "/my/local/apache/conf/httpd.conf". Other required modules are the (very common) mod_alias and mod_env. now, like with "Apache::TestRun" and "Apache::TestRunPerl", you can place client-side Perl test scripts under "t/", such as "t/01basic.t", and "Apache-Test" will run these scripts when you call "make test". however, what makes "Apache::TestRunPHP" unique is some added magic specifically tailored to a PHP environment. here are the mechanics. "Apache::TestRunPHP" will look for PHP test scripts in that match the following pattern t/response/TestFoo/bar.php where "Foo" and "bar" can be anything you like, and "t/response/Test*" is case sensitive. when this format is adhered to, "Apache::TestRunPHP" will create an associated Perl test script called "t/foo/bar.t", which will be executed when you call "make test". all "bar.t" does is issue a simple GET to "bar.php", leaving the actual testing to "bar.php". in essence, you can forget that "bar.t" even exists. what does "bar.php" look like? here is an example: <?php print "1..1 "; print "ok 1 " ?> if it looks odd, that's ok because it is. I could explain to you exactly what this means, but it isn't important to understand the gory details. instead, it is sufficient to understand that when "Apache::Test" calls "bar.php" it feeds the results directly to "Test::Harness", a module that comes with every Perl installation, and "Test::Harness" expects what it receives to be formated in a very specific way. by itself, all of this is pretty useless, so "Apache::Test" provides PHP testers with something much better. here is a much better example: <?php # import the Test::More emulation layer # see # http://search.cpan.org/dist/Test-Simple/lib/Test/More.pm # for Perl's documentation - these functions should behave # in the same way require 'test-more.php'; # plan() the number of tests plan(6); # call ok() for each test you plan ok ('foo' == 'foo', 'foo is equal to foo'); ok ('foo' != 'foo', 'foo is not equal to foo'); # ok() can be other things as well is ('bar', 'bar', 'bar is bar'); is ('baz', 'bar', 'baz is baz'); isnt ('bar', 'beer', 'bar is not beer'); like ('bar', '/ar$/', 'bar matches ar$'); diag("printing some debugging information"); # whoops! one too many tests. I wonder what will happen... is ('biff', 'biff', 'baz is a baz'); ?> the include library "test-more.php" is automatically generated by "Apache::TestConfigPHP" and configurations tweaked in such a a way that your PHP scripts can find it without issue. the functions provided by "test-more.php" are equivalent in name and function to those in "Test::More", a standard Perl testing library, so you can see that manpage for details on the syntax and functionality of each. at this point, we have enough in place to run some tests from PHP-land - a "Makefile.PL" to configure Apache for us, and a PHP script in "t/response/TestFoo/bar.php" to send some results out to the testing engine. issuing "make test" would start Apache, issue the request to "bar.php", generate a report, and shut down Apache. the report would look like something like this after running the tests in verbose mode (eg "make test TEST_VERBOSE=1"): t/php/bar....1..6 ok 1 - foo is equal to foo not ok 2 - foo is not equal to foo # Failed test (/src/devel/perl-php-test/t/response/TestFoo/bar.php at line 13) ok 3 - bar is bar not ok 4 - baz is baz # Failed test (/src/devel/perl-php-test/t/response/TestFoo/bar.php at line 17) # got: 'baz' # expected: 'bar' ok 5 - bar is not beer ok 6 - bar matches ar$ # printing some debugging information ok 7 - baz is a baz FAILED tests 2, 4, 7 Failed 3/6 tests, 50.00% okay Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/php/bar.t 6 3 50.00% 2 4 7 Failed 1/1 test scripts, 0.00% okay. 1/6 subtests failed, 83.33% okay. note that the actual test file that was run was "t/php/bar.t". this file is autogenerated based on the "t/response/TestFoo/bar.php" pattern of your PHP script. "t/php/bar.t" happens to be written in Perl, but you really don't need to worry about it too much. as an interesting aside, if you are using perl-5.8.3 or later you can actually create your own "t/foo.php" client-side scripts and they will be run via php (using our "php.ini"). but more on that later... SEE ALSO
the best source of information about using Apache-Test with PHP (at this time) is probably the talk given at ApacheCon 2004 (<http://xrl.us/phpperl>), as well as the code from the talk (<http://xrl.us/phpperlcode>). there is also the online tutorial <http://perl.apache.org/docs/general/testing/testing.html> which has all of the mod_perl-specific syntax and features have been ported to PHP with this class. AUTHOR
"Apache-Test" is a community effort, maintained by a group of dedicated volunteers. Questions can be asked at the test-dev <at> httpd.apache.org list For more information see: http://httpd.apache.org/test/. perl v5.18.2 2015-06-18 Apache::TestRunPHP(3)
All times are GMT -4. The time now is 01:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy