Coder Social home page Coder Social logo

crackercat / joern Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joernio/joern

0.0 0.0 0.0 69.99 MB

Open-source code analysis platform for C/C++ based on code property graphs

Home Page: https://joern.io/

License: Apache License 2.0

Scala 70.94% Shell 0.80% C 0.08% Dockerfile 0.02% JavaScript 0.01% Java 26.46% Slim 0.03% PHP 0.74% ANTLR 0.68% Assembly 0.04% HCL 0.01% Kotlin 0.04% Batchfile 0.05% SuperCollider 0.08% C++ 0.02% Python 0.01%

joern's Introduction

Joern - The Bug Hunter's Workbench

release Joern SBT Github All Releases Gitter

Joern is a platform for analyzing source code, bytecode, and binary executables. It generates code property graphs (CPGs), a graph representation of code for cross-language code analysis. Code property graphs are stored in a custom graph database. This allows code to be mined using search queries formulated in a Scala-based domain-specific query language. Joern is developed with the goal of providing a useful tool for vulnerability discovery and research in static program analysis.

Website: https://joern.io

Documentation: https://docs.joern.io/

Specification: https://cpg.joern.io

News / Changelog

  • Joern v2.0.0 upgrades from Scala2 to Scala3
  • Joern v1.2.0 removes the overflowdb.traversal.Traversal class. This change is not completely backwards compatible. See here for a detailed writeup.

Requirements

  • JDK 19 (other versions might work, but have not been properly tested)
  • optional: gcc and g++ (for auto-discovery of C/C++ system header files if included/used in your C/C++ code)

Development Requirements

Quick Installation

wget https://github.com/joernio/joern/releases/latest/download/joern-install.sh
chmod +x ./joern-install.sh
sudo ./joern-install.sh
joern

     ██╗ ██████╗ ███████╗██████╗ ███╗   ██╗
     ██║██╔═══██╗██╔════╝██╔══██╗████╗  ██║
     ██║██║   ██║█████╗  ██████╔╝██╔██╗ ██║
██   ██║██║   ██║██╔══╝  ██╔══██╗██║╚██╗██║
╚█████╔╝╚██████╔╝███████╗██║  ██║██║ ╚████║
 ╚════╝  ╚═════╝ ╚══════╝╚═╝  ╚═╝╚═╝  ╚═══╝
Version: 2.0.1
Type `help` to begin

joern>

If the installation script fails for any reason, try

./joern-install --interactive

Docker based execution

docker run --rm -it -v /tmp:/tmp -v $(pwd):/app:rw -w /app -t ghcr.io/joernio/joern joern

To run joern in server mode:

docker run --rm -it -v /tmp:/tmp -v $(pwd):/app:rw -w /app -t ghcr.io/joernio/joern joern --server

Almalinux 9 requires the CPU to support SSE4.2. For kvm64 VM use the Almalinux 8 version instead.

docker run --rm -it -v /tmp:/tmp -v $(pwd):/app:rw -w /app -t ghcr.io/joernio/joern-alma8 joern

Releases

A new release is created automatically once per day. Contributers can also manually run the release workflow if they need the release sooner.

Developers: IDE setup

Intellij IDEA

  • Download Intellij Community
  • Install and run it
  • Install the Scala Plugin - just search and install from within Intellij
  • Important: run sbt in your local joern clone and keep it open - this will allow us to use the BSP build in the next step
  • Back to Intellij: open project: select your local joern clone: select to open as BSP project (i.e. not sbt project!)
  • Await the import and indexing to complete, then you can start, e.g. Build -> build project or run a test

VSCode

  • Install VSCode and Docker
  • Install the plugin ms-vscode-remote.remote-containers
  • Open Joern project folder in VSCode Visual Studio Code detects the new files and opens a message box saying: Folder contains a Dev Container configuration file. Reopen to folder to develop in a container.
  • Select the Reopen in Container button to reopen the folder in the container created by the .devcontainer/Dockerfile file
  • Switch to scalameta.metals sidebar in VSCode, and select import build in BUILD COMMANDS
  • After import build succeeds, you are ready to start writing code for Joern

QueryDB (queries plugin)

Quick way to develop and test QueryDB:

sbt stage
./querydb-install.sh
./joern-scan --list-query-names

The last command prints all available queries - add your own in querydb, run the above commands again to see that your query got deployed. More details in the separate querydb readme

Benchmarks

Various static analysis benchmarks that measure Joern are contained under the benchmarks. The benchmarks are implemented in ScalaTest and can be run using the joern-benchmarks script. The benchmark results can be found on the benchmarks subproject's README. The currently implemented benchmarks along with the language frontends tested are:

For more instructions on how to run benchmarks individually head over to the benchmarks subproject. If you would like the benchmark results to be written to a file instead of printed to STDOUT, set the path to the environment variable JOERN_BENCHMARK_RESULT_FILE.

joern's People

Contributors

fabsx00 avatar ursachec avatar mpollmeier avatar max-leuthaeuser avatar davidbakereffendi avatar scala-steward avatar xavierpinho avatar itsacoderepo avatar ml86 avatar rahul-privado avatar glassandonehalf avatar johannescoetzee avatar pandurangpatil avatar liyw979 avatar khemrajrathore avatar ankit-privado avatar prabhu avatar karan-batavia avatar tuxology avatar bbrehm avatar hiteshbedre avatar maltek avatar dbmundada avatar evilpan avatar gacevedo avatar ferada avatar hubertp avatar bsw4p avatar ycclnn avatar cyw3 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.