Code Monkey home page Code Monkey logo

validator.net's Introduction

Validator.NET - A validator for XSS and SQL injections attacks, validates phone numbers, zip codes and more.

Features

  • Detects XSS attacks by using a probability factor.
  • Detects SQL injection attacks by using a probability factor.
  • Support for normalizing data input by decoding HEX, Unicode and removing newlines.
  • Support for common input checks such as E-mails, URI’s, phone number and others.
  • Support for numerous different phone number, postal code and social security number formats. Like UK, Brazil, Spain and United States.
  • Support for common range, type and length checks.

Examples

static void Main(string[] args)
{
	int attackVector = Validator.CheckForXss("<ScRiPt lAnguage=JavaScript> alert(document.cookie); var hextest=%74%65%73%74; &lt;/sCrIpt&gt;");

	if (attackVector > 500)
	{
		// Take the appropriate action.
	}
}

Output:


For more examples, take a look at the Validator.NET Unit tests included in the project.

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.