{"id":19390623,"url":"https://github.com/mandiant/flare-qdb","last_synced_at":"2025-04-24T00:31:27.000Z","repository":{"id":51084418,"uuid":"77093410","full_name":"mandiant/flare-qdb","owner":"mandiant","description":"Command-line and Python debugger for instrumenting and modifying native software behavior on Windows and Linux.","archived":true,"fork":false,"pushed_at":"2023-04-10T00:58:14.000Z","size":1450,"stargazers_count":162,"open_issues_count":8,"forks_count":54,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-12T09:37:30.202Z","etag":null,"topics":["fireeye-flare"],"latest_commit_sha":null,"homepage":"https://www.fireeye.com/blog/threat-research/2017/01/flare_script_series.html","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mandiant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2016-12-21T23:22:36.000Z","updated_at":"2025-01-28T07:21:31.000Z","dependencies_parsed_at":"2024-11-15T16:00:13.365Z","dependency_job_id":null,"html_url":"https://github.com/mandiant/flare-qdb","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/mandiant%2Fflare-qdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandiant%2Fflare-qdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandiant%2Fflare-qdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandiant%2Fflare-qdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mandiant","download_url":"https://codeload.github.com/mandiant/flare-qdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250539408,"owners_count":21447303,"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":["fireeye-flare"],"created_at":"2024-11-10T10:22:15.709Z","updated_at":"2025-04-24T00:31:24.196Z","avatar_url":"https://github.com/mandiant.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FireEye Labs Query-Oriented Debugger\n\nflare-qdb is a command-line and scriptable Python-based tool for evaluating and\nmanipulating native program state. It uses\n[Vivisect](https://github.com/vivisect/vivisect) to set a breakpoint on each\nqueried instruction and executes Python code when hit.\n\nflare-qdb frees the analyst to take a nonlinear approach to dynamic analysis\nthat accommodates the questions that arise in the course of normal debugging\nand static analysis. flare-qdb answers these questions without requiring the\nanalyst to manually set up an interactive debugger session and navigate the\nprogram counter to that code location.\n\nHere are some examples of spot questions flare-qdb can answer:\n\n* Does eax always equal this value at this point?\n* What was eax equal to before this branch?\n* What values will this string assume throughout this loop?\n* At the *first* iteration of the inner loop, what base address is used?\n* Is the program even going to hit this logic?\n* Which code executes first?\n* Does the number of loop iterations depend on the value of `argv[1]`?\n* Can I alter the command-line arguments to avoid this condition?\n\nflare-qdb can also be used to facilitate automated, repeatable manipulation of\nprogram execution. Here are some examples of useful applications:\n\n* Executing a string decoder with different arguments to quickly extract all\n  the strings used by a malware sample.\n* Overriding the arguments to `Sleep()` to permit rapid iterative testing of\n  a custom command and control (C2) server.\n* Telling a privilege escalation tool that its integrity level is 0x1000\n  (`MANDATORY_LOW_RID`) in order to induce it to execute its exploit code.\n* Repeatably automating the unpacking of a packer that jumps into one or more\n  non-deterministic heap locations.\n\nflare-qdb accepts multiple queries that take the form of a program counter or\nVivisect expression paired with some Python text to evaluate in the flare-qdb\nscripting environment. Vivisect expressions can be used to specify simple\nconstant program counter values like `\"0x401000\"`, symbolic expressions like\n`\"kernel32.Sleep\"`, and more. Vivisect expressions can also incorporate\nregister and memory state to articulate sophisticated conditions, such as `\"not\neax or (( edx \u003e 3) and (poi(ebp-8) \u003c 5))\"`.\n\nThe command line argument format for this is:\n\n\t-at \u003cvexpr-pc\u003e \u003cpythontext\u003e\n\nflare-qdb also supports conditional evaluation based on the truth value of a\nVivisect expression:\n\n\t-at-if \u003cvexpr-pc\u003e \u003cvexpr-conds\u003e \u003cpythontext\u003e\n\nflare-qdb provides several builtins for convenient debugging, which are\navailable both from the command line and as methods of its `Qdb` class.\n\nflare-qdb has been tested primarily on Windows, but works on Linux.\nUnfortunately, the Darwin port of Vivisect's `vtrace.Trace` class is\nincomplete, so flare-qdb does not support OSX.\n\n## Example Scripts\n\nflare-qdb comes with De-DOSfuscator, which is a tool for decoding obfuscated\nbatch files by running them. Details can be found in the [De-DOSfuscator\nGuide](doc/dedosfuscator.md) or by reading the blog [Cmd and Conquer: De-DOSfuscation with flare-qdb](https://www.fireeye.com/blog/threat-research/2018/11/cmd-and-conquer-de-dosfuscation-with-flare-qdb.html).\n\n## Detailed Information\n\nInformation about installing flare-qdb is available in the [Installation\nGuide](doc/installation.md).\n\nInformation about using flare-qdb on the command line is available in the\n[Command Line Usage Guide](doc/usage.md).\n\nInformation about scripting with flare-qdb is available in the [Scripting\nGuide](doc/scripting.md). `Qdb` class methods specific to scripting flare-qdb\ncan be found in the [Methods Reference](doc/qdb_methods.txt).\n\nA full reference of flare-qdb's builtins (available both from the CLI and as\ninstance methods) is available in the [Builtins\nReference](doc/qdb_builtins.txt) or by typing `flareqdb --help-builtins` after\ninstalling flare-qdb.\n\nDe-DOSfuscator documentation can be found in the [De-DOSfuscator\nGuide](doc/dedosfuscator.md).\n\nTroubleshooting information can be found in the [Troubleshooting\nGuide](doc/troubleshooting.md).\n\nAcknowledgements and thoughts about future functionality that may be useful can\nbe found in the [Notes](doc/notes.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmandiant%2Fflare-qdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmandiant%2Fflare-qdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmandiant%2Fflare-qdb/lists"}