Giter VIP home page Giter VIP logo

code-scanner's Introduction

NPM Package Code Scanner

Authors

Cong Yu
Victoria Lu
Xiaomeng Wang

Prerequisites

Development

To read from a github repository: npm run start [owner] [repo]

args:

owner: owner of the repository repo: repository name

e.g.: npm run start wsghlby vulnerability-test will get to the root of remote repository of this project. !! Recursive reading from directories are not supported yet.

Modules

Git Log Vulnerability

This module scans the git log of the given repository, and compare between two consecutive commits to see if sensitive information has been committed.

Example output:

Git Exposure Scan:
Detected sensitive information in git commits [commit A] and [commit B]:
RSA private key: -----BEGIN RSA PRIVATE KEY----- appearances: 1
  • To debug:

Go to git-exposure.ts and trigger the call with a hard coded repo path, then run npm run scan-git to run this script independently.

Malicious Code in Dependency Scan

This module scans the dependent npm packages, and find potentially malicious code. Currently, we only focus on data exchange, powerful function and encoded string.

Example output:

Malicious Code Scan:
- Found data exchange & powerful function & encoded string in [file path]:
[source code]

You need to manually remove the scan-dependency directory after scanning.

Since it is hard to find a real malicious npm package, we provide the testing result of several examples in test-examples-result.md

Phishing Package Detection

This module scans all dependent npm packages and check if there is possible phishing package exist.

Example output:

Phishing package detection:
- The dependent package "jquey" looks similar to the popular package "jquery" with 0.833 similarity. It's possibly a phishing package.

code-scanner's People

Contributors

wsghlby avatar heliumyc avatar kk3039 avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

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.