PHP Classes
elePHPant
Icontem

Find Needle: Locate and display file lists with given content

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-05-19 (28 days ago) RSS 2.0 feedNot yet rated by the usersTotal: Not yet counted Not yet ranked
Version License PHP version Categories
find-needle 1GNU General Publi...5HTML, PHP 5, Files and Folders, Searc...
Description Author

This package can Locate and display file lists with given content.

It can traverse given directories and locate files that have a given content string.

The class can also display the list of files found.

  Performance   Level  
Name: Soltermann Paul <contact>
Classes: 2 packages by
Country: Switzerland Switzerland

Details
 ###################### chk4needle #######################
 ####                                                 ####
 ####    Author : Paul Soltermann,                    ####
 ####    eMail  : ps@g2p.ch   web: www.g2p.ch/myRGi/  ####
 ####    Date   : 2017-05-12                          ####
 ####    Updated:                                     ####
 ####                                                 ####
 #########################################################
 readme for chk4needle

Preamble

The first time I was shocked when a php file was moved to quarantaene by my AV software shortly after downloading from ISP server to my local Windows system. I have found the cause and corrected immediately ... Later I received a strange error message about an e-mail that could not be delivered to the destination. A email and a destination I had never heard of. I have react sensitive now and have checked the logfile on my ISP server. The result was shocking: Someone with an IP address that is pointing to an ISP in St. Petersburg accessed to a program in my library which has been inactive for a long time ... accessed not just once but many times in one day. We have to be careful with emails unintentional sent by the own server, we can be held responsible, even when we didn't knew anything.

The legend that there is no virus danger on Linux system was brocken compleatly and i need finde a solution for: 1. Change PW on mysql-server and for ftp-access 2. Determine the size of damage (affected programs) 3. Remove unused and outdated programs. 4. Overwork active programs. 5. Keep a clean local and online library

In order to cover point 2 to 5 i have created a little utility that can run on the web server, local or online and hope it will also be useful for others: chk4needle.php as an example for use of findneedle.php

Installation on Linux webserver

create directory somwhere in your directory tree which is accessable for the webserver you may start with check on your local webserver /var/www/html/tools/check/ or similar download needle.zip extract the downloaded file in this new directory

following files should be present: x chk4needle.php (example) x findneedle.php (class file) x heaps.jpg x favicon.jpg x needle_(01,02,03,04).jpg

make sure directory is readable for webuser open chk4needle.php in FF webbrowser.

Operating

open ../tools/check/chk4needle.php edit the entries for: x needle (see most dangerious needle in needle_01.jpg) x base directory , for me it is: /var/www/ /var/www/html/programme/ etc as example for local server or /home/httpd/vhosts/g2p.ch/httpdocs/myRGi/ as example for ISP server x text-filetyp: chose php or txt or enter an other textfile type in program code.

hit "go" then "show sresults" (see needle_02.jpg) and watch "show scanned directories" (see needle_03.jpg)

a hint for remove unused and outdated programs; (see needle_04.jpg)

Other uses

Search and check for outdated php functions such as "split" in your program library Enter 'split' in the needle field in this case.

future steps

x run utility as cronjob with email anoncement in case of existing events. x exclude list for frindly needles x write results to a logfile

Screenshots  
  • needle_04
  • needle_03.jpg
  • needle_02.jpg
  • needle_01.jpg
  Files folder image Files  
File Role Description
Accessible without login Plain text file readme Doc. how to use
Accessible without login Plain text file chk4needle.php Example example
Accessible without login Image file flavicon Icon icon
Plain text file findneedle.php Class class

 Version Control Unique User Downloads  
 0%
Total:0
This week:0