{"id":13515548,"url":"https://github.com/microsoft/lain","last_synced_at":"2025-03-31T04:37:11.701Z","repository":{"id":35062442,"uuid":"174432798","full_name":"microsoft/lain","owner":"microsoft","description":"A fuzzer framework built in Rust","archived":true,"fork":false,"pushed_at":"2022-09-27T00:50:27.000Z","size":247,"stargazers_count":469,"open_issues_count":11,"forks_count":33,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-30T21:38:27.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2019-03-07T22:55:10.000Z","updated_at":"2025-03-29T12:22:26.000Z","dependencies_parsed_at":"2022-07-06T11:21:03.335Z","dependency_job_id":null,"html_url":"https://github.com/microsoft/lain","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Flain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Flain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Flain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Flain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/lain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246385406,"owners_count":20768668,"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":[],"created_at":"2024-08-01T05:01:12.753Z","updated_at":"2025-03-31T04:37:09.908Z","avatar_url":"https://github.com/microsoft.png","language":"Rust","readme":"# NOTE: As of September 2022, this repository is no longer maintained. \nTo continue using `lain`, please use the `lain` [repository](https://github.com/landaire/lain) at https://github.com/landaire/lain.\n\n# lain\n\nThis crate provides functionality one may find useful while developing a fuzzer. A recent\nnightly Rust build is required for the specialization feature.\n\nPlease consider this crate in \"beta\" and subject to breaking changes for minor version releases for pre-1.0.\n\n[![crates.io](https://img.shields.io/crates/v/lain.svg)](https://crates.io/crates/lain)\n[![docs.rs](https://docs.rs/lain/badge.svg)](https://docs.rs/lain)\n\n### Documentation\n\nPlease refer to [the wiki](https://github.com/microsoft/lain/wiki) for a high-level overview.\n\nFor API documentation: https://docs.rs/lain\n\n### Installation\n\nLain requires rust nightly builds for specialization support.\n\nAdd the following to your Cargo.toml:\n\n```toml\n[dependencies]\nlain = \"0.5\"\n```\n\n### Example Usage\n\n```rust\nextern crate lain;\n\nuse lain::prelude::*;\nuse lain::rand;\nuse lain::hexdump;\n\n#[derive(Debug, Mutatable, NewFuzzed, BinarySerialize)]\nstruct MyStruct {\n    field_1: u8,\n\n    #[lain(bits = 3)]\n    field_2: u8,\n\n    #[lain(bits = 5)]\n    field_3: u8,\n\n    #[lain(min = 5, max = 10000)]\n    field_4: u32,\n\n    #[lain(ignore)]\n    ignored_field: u64,\n}\n\nfn main() {\n    let mut mutator = Mutator::new(rand::thread_rng());\n\n    let mut instance = MyStruct::new_fuzzed(\u0026mut mutator, None);\n\n    let mut serialized_data = Vec::with_capacity(instance.serialized_size());\n    instance.binary_serialize::\u003c_, BigEndian\u003e(\u0026mut serialized_data);\n\n    println!(\"{:?}\", instance);\n    println!(\"hex representation:\\n{}\", hexdump(\u0026serialized_data));\n\n    // perform small mutations on the instance\n    instance.mutate(\u0026mut mutator, None);\n\n    println!(\"{:?}\", instance);\n}\n\n// Output:\n//\n// MyStruct { field_1: 95, field_2: 5, field_3: 14, field_4: 8383, ignored_field: 0 }\n// hex representation:\n// ------00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n// 0000: 5F 75 00 00 20 BF 00 00 00 00 00 00 00 00         _u...¿........\n// MyStruct { field_1: 160, field_2: 5, field_3: 14, field_4: 8383, ignored_field: 0 }\n```\n\nA complete example of a fuzzer and its target can be found in the [examples](examples/)\ndirectory. The server is written in C and takes data over a TCP socket, parses a message, and\nmutates some state. The fuzzer has Rust definitions of the C data structure and will send fully\nmutated messages to the server and utilizes the `Driver` object to manage fuzzer threads and\nstate.\n\n## Contributing\n\n**This repo is no longer maintained, and therefore is not accepting new contributions.**\n\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to\na Contributor License Agreement (CLA) declaring that you have the right to, and actually do,\ngrant us the rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to\nprovide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the\ninstructions provided by the bot. You will only need to do this once across all repos using our\nCLA.\n\nThis project has adopted the [Microsoft Open Source Code of\nConduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of\nConduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact\n[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or\ncomments.\n\nLicense: MIT\n","funding_links":[],"categories":["Fuzzing","\u003ca id=\"683b645c2162a1fce5f24ac2abfa1973\"\u003e\u003c/a\u003e漏洞\u0026\u0026漏洞管理\u0026\u0026漏洞发现/挖掘\u0026\u0026漏洞开发\u0026\u0026漏洞利用\u0026\u0026Fuzzing","Vulnerability Assessment","Rust"],"sub_categories":["功能","Fuzzing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Flain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Flain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Flain/lists"}