Skip to content

polarspetroll/EscapeAPI

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

Escape API

an API for escaping html, shell and path queries


Documentation

parameters

  • method escaping method
  • data string to be escaped

available methods

Method Description Type Prevention
html HTML escape string XSS
shell UNIX bourne shell escape string os command injection
path UNIX path escape string directory traversal

examples

curl "https://s.polarspetroll.repl.co/api?method=html&data=<>/>,test'"

output :

{
  "ok":true,
  "data":"&lt;&gt;/&gt;,test&#39;"
}

curl "https://s.polarspetroll.repl.co/api?method=shell&data=ls -la | cat /etc/passwd"

output:

{
  "ok":true,
  "data":"ls\\ -la\\ \\|\\ cat\\ /etc/passwd"
}

curl "https://s.polarspetroll.repl.co/api?method=path&data=../../../../../../../etc/passwd"

output:

{
  "ok":true,
  "data":"./././././././etc/passwd"
}