Skip to content

Node.js script that can detect when "curl ... | bash" is being used and serve a different file than normal

License

Notifications You must be signed in to change notification settings

MylesJohnson/Pipe-Injector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pipe Injector

Node.js script that can detect when "curl ... | bash" is being used and serve a different file than normal. This is an implementation of this article https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-server-side/

Requirements

  • Node.js v7.6.0 or higher

Usage

The first 4 lines of injector.js are the settings used to configure the program:

  • initalFile is the file sent regardless of good or bad. It must be set to a file in it that has at least a sleep inside. I've found 2 seconds to work, but other delays may be necessary.
  • goodFile is the file served if piping is not detected.
  • badFile is the file served if piping is detected.
  • Port is what port number to bind the HTTP server on
  • minStd is the minimum standard deviation of the time needed to send each "filler" packet required to send badFile

Warning

This program is created only for educational purposes only. Do not use this on anyone without their informed consent.

About

Node.js script that can detect when "curl ... | bash" is being used and serve a different file than normal

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published