{"id":21594714,"url":"https://github.com/ispras/futag","last_synced_at":"2025-04-10T23:42:14.381Z","repository":{"id":43930384,"uuid":"452684351","full_name":"ispras/Futag","owner":"ispras","description":"FUTAG (FUzzing Target Automated Generator) - автоматический генератор фаззинг-оберток для библиотек","archived":false,"fork":false,"pushed_at":"2025-04-07T05:46:18.000Z","size":226420,"stargazers_count":51,"open_issues_count":10,"forks_count":10,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-10T23:42:09.205Z","etag":null,"topics":["addresssanitizer","automated-testing","code-generator","crash","fuzzing","llvm","static-analysis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ispras.png","metadata":{"files":{"readme":"README.en.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-27T13:01:07.000Z","updated_at":"2025-04-07T05:42:39.000Z","dependencies_parsed_at":"2025-04-07T06:36:27.313Z","dependency_job_id":null,"html_url":"https://github.com/ispras/Futag","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ispras%2FFutag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ispras%2FFutag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ispras%2FFutag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ispras%2FFutag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ispras","download_url":"https://codeload.github.com/ispras/Futag/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317726,"owners_count":21083527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["addresssanitizer","automated-testing","code-generator","crash","fuzzing","llvm","static-analysis"],"created_at":"2024-11-24T17:19:25.432Z","updated_at":"2025-04-10T23:42:14.360Z","avatar_url":"https://github.com/ispras.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Table of Contents\n\n- [Table of Contents](#table-of-contents)\n  - [1. About](#1-about)\n  - [2. Installation](#2-installation)\n  - [3. Usage](#3-usage)\n  - [4. Authors](#4-authors)\n  - [5. References](#5-references)\n  - [6. Found bugs](#6-found-bugs)\n\n## 1. About\n\nFutag is an automated instrument to generate fuzz targets for software libraries.\nUnlike the standalone program, software library may not contain an entry point so that generating fuzz target for it remains a challenge.\nFUTAG uses LLVM clang and clang tools as front end to analyze and generate the fuzzing targets.\nFutag uses static analysis to find:\n- Entities dependencies (data types, functions, structures, etc.) in the source code of target library.\n- Library usage contexts.\nThe information then is used for generating fuzz targets.\n\nThis project is based on llvm-project with Clang statistic analysis, LLVM lto and is distributed under [\"GPL v3 license\"](https://llvm.org/docs/DeveloperPolicy.html#new-llvm-project-license-framework)\n\nCurrently Futag supports:\n- automatically compiling libraries with Makefile, cmake and configure;\n- automatically generating fuzzing-targets for functions of libraries in C/C++ languages.\nAdditionally, Futag provides the ability to test compiled targets.\n\n## 2. Installation\n### 2.1. Using a docker container\nYou can try to build Futag with pre-built [Docker files](https://github.com/ispras/Futag/tree/main/product-tests/build-test) for Ubuntu OS.\n\n### 2.2. Using a prepackaged package\nDownload the latest [futag-llvm.2.0.1.tar.xz](https://github.com/ispras/Futag/releases/tag/2.0.0) and unzip\n\n### 2.3. Building and installing from source\n\n#### 2.3.1. Dependencies\nThis instruction allows you to build a copy of the project and run it on a Unix-like system.\n\nFutag is based on [llvm-project](https://llvm.org/). For compiling the project, these packages must be installed on your system:\n\n- [CMake](https://cmake.org/) \u003e=3.13.4 [cmake-3.19.3-Linux-x86_64.sh](https://github.com/Kitware/CMake/releases/download/v3.19.3/cmake-3.19.3-Linux-x86_64.sh) - Makefile/workspace generator\n- [GCC](https://gcc.gnu.org/)\u003e=5.1.0 C/C++ compiler\n- [python](https://www.python.org/) \u003e=3.6 \n- [pip](https://pypi.org/project/pip/)\n- [zlib](http://zlib.net/) \u003e=1.2.3.4 Compression library\n- [GNU Make](http://savannah.gnu.org/projects/make) 3.79, 3.79.1 Makefile/build processor\n\nPlease check [prerequirement](https://llvm.org/docs/GettingStarted.html#requirements) on official website of LLVM for more detail.\n\nYou also need to create a symbolic link \"python\" to \"python3\" if such a link does not exist on your system. On an Ubuntu system, this can be done by installing the python-is-python3 package.\n\n#### 2.3.1. Building and installing\n\n- Clone the project:\n\n```bash\n  ~$ git clone https://github.com/ispras/Futag\n```\n- Prepare the \"custom-llvm\" directory by running the script:\n```bash\n  ~/Futag/custom-llvm$ ./prepare.sh\n```\nThis script creates the Futag/build directory and copies the Futag/custom-llvm/build.sh script into it.\n\nRun the copied script in \"Futag/build\":\n\n```bash\n  ~/Futag/build$ ./build.sh\n```\n\n- As a result, the tool will be installed in the Futag/futag-llvm directory.\n\n## 3. Usage\n\n- Analyze the library:\n\n```python\n# package futag must be already installed\nfrom futag.preprocessor import *\n\ntesting_lib = Builder(\n    \"futag-llvm/\", # path to the futag-llvm\n    \"path/to/library/source/code\" # library root\n)\ntesting_lib.auto_build()\ntesting_lib.analyze()\n```\n\n- Generate and compile fuzz-drivers\n\n```python\n# package futag must be already installed\nfrom futag.generator import *\n\ng = Generator(\n    \"futag-llvm/\", # path to the futag-llvm\n    \"path/to/library/source/code\" # library root\n    # target_type = LIBFUZZER, # or AFLPLUSPLUS\n)\ng.gen_targets(\n  anonymous=False # Option for generating fuzzing-wrapper of private functions\n)\ng.compile_targets(\n  8, # Compile fuzz drivers with 8 processes\n  # keep_failed=True, # keep uncompiled targets\n  # extra_include=\"-DHAVE_CONFIG_H\", # extra included paths\n  # extra_dynamiclink=\"-lz\", # extra system linked libraries\n  # flags=\"-ferror-limit=1\", # flags for compiling, default to \"\"\n)\n```\nBy default, successfully compiled fuzz-drivers for target functions are located in the futag-fuzz-drivers directory, where each target function is in its own subdirectory, the name of which matches the name of the target function.\nIf several fuzz-drivers have been generated for a function, corresponding directories are created in the subdirectory of the target function, where a serial number is added to the name of the target function.\n\nDocumentation Futag Python-package follows by this [link](https://github.com/ispras/Futag/tree/main/src/python/futag-package)\n\nDetails of working with Futag can be read [here](https://github.com/ispras/Futag/blob/main/How-to-work-with-Futag.md)\n\nThe example script can be viewed [here](https://github.com/ispras/Futag/blob/main/src/python/template-script.py)\n\n[Testing repository](https://github.com/thientc/Futag-tests) has been created to test Futag for libraries (json-c, php, FreeImage, etc.), you can try with [Docker container]( https://github.com/ispras/Futag/tree/main/product-tests/libraries-test).\n\n## 4. Authors\n\n- [Tran Chi Thien](https://github.com/thientc/) (thientc@ispras.ru)\n- Shamil Kurmangaleev (kursh@ispras.ru)\n- Theodor Arsenij Larionov-Trichkin (tlarionov@ispras.ru)\n\n## 5. References\n\n- C. T. Tran and S. Kurmangaleev, [\"Futag: Automated fuzz target generator for testing software libraries\"](https://ieeexplore.ieee.org/document/9693749) 2021 Ivannikov Memorial Workshop (IVMEM), 2021, pp. 80-85, doi: 10.1109/IVMEM53963.2021.00021.\n\n- Research on automatic generation of fuzz-target for software library functions, Ivannikov ISP RAS Open Conference 2022\n\n[![Видео](https://img.youtube.com/vi/qw_tzzgX04E/hqdefault.jpg)](https://www.youtube.com/watch?v=qw_tzzgX04E\u0026t=28122s) \n\n## 6. Found bugs\n\n- Crash in function [png_convert_from_time_t](https://github.com/glennrp/libpng/issues/362) of [libpng version 1.6.37](https://github.com/glennrp/libpng) (confirmed)\n\n- Global-buffer-overflow in function [ErrorIDToName](https://github.com/leethomason/tinyxml2/issues/923) of tinyxml2 version 9.0.0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fispras%2Ffutag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fispras%2Ffutag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fispras%2Ffutag/lists"}