<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Usman </title>
    <description>The latest articles on DEV Community by Usman  (@usmanismail0x).</description>
    <link>https://dev.to/usmanismail0x</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3989497%2F4ed8833c-6cb4-45d7-8585-6fd1a225dac4.jpg</url>
      <title>DEV Community: Usman </title>
      <link>https://dev.to/usmanismail0x</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/usmanismail0x"/>
    <language>en</language>
    <item>
      <title>I Built a Local Linux Binary Sandbox in Python — Zero Cloud, Zero Root</title>
      <dc:creator>Usman </dc:creator>
      <pubDate>Thu, 18 Jun 2026 11:28:53 +0000</pubDate>
      <link>https://dev.to/usmanismail0x/i-built-a-local-linux-binary-sandbox-in-python-zero-cloud-zero-root-f0n</link>
      <guid>https://dev.to/usmanismail0x/i-built-a-local-linux-binary-sandbox-in-python-zero-cloud-zero-root-f0n</guid>
      <description>&lt;p&gt;I wanted a way to analyze suspicious Linux binaries locally without uploading them to VirusTotal, spinning up a virtual machine, or deploying a heavyweight sandbox.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;Lure&lt;/strong&gt; — a Python-based CLI that isolates ELF binaries using Linux namespaces, traces their behavior with &lt;code&gt;strace&lt;/code&gt;, and generates a simple risk verdict in seconds.&lt;/p&gt;

&lt;p&gt;As a cybersecurity student, I built it because I wanted something fast, local, and easy to understand.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;When I need to quickly inspect a suspicious binary, the usual options are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Upload it to VirusTotal (not always possible with private or sensitive samples)&lt;/li&gt;
&lt;li&gt;Spin up a virtual machine&lt;/li&gt;
&lt;li&gt;Deploy a sandbox such as CAPE or Cuckoo&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;strace ./binary&lt;/code&gt; and manually sift through hundreds of lines of syscall output&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of these approaches work, but they can feel heavy for a quick local analysis workflow.&lt;/p&gt;

&lt;p&gt;I wanted something that could answer a simple question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What did this binary actually do?&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Meet Lure
&lt;/h2&gt;

&lt;p&gt;Lure is a command-line tool for analyzing Linux ELF binaries in an isolated environment.&lt;/p&gt;

&lt;p&gt;It combines Linux namespaces and syscall tracing to provide a concise, readable summary of a binary's behavior.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lure run ./suspicious_binary
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of raw &lt;code&gt;strace&lt;/code&gt; output, Lure displays events in real time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;📁 [0.026s] OPEN       /etc/ld.so.cache
⚠️ [0.031s] SENSITIVE  /etc/passwd
🌐 [0.033s] CONNECT    93.184.216.34:443 (BLOCKED)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When execution finishes, it generates a structured report:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;╭─── Execution Summary ───╮
│ Runtime     0.017s      │
│ Syscalls    45 captured │
│ Exit Code   0 (success) │
╰─────────────────────────╯

╭─── Files Accessed ──────╮
│ ⚠️ /etc/passwd           │
╰─────────────────────────╯

╭─── Network Activity ────╮
│ 93.184.216.34:443       │
│ Status: BLOCKED         │
╰─────────────────────────╯

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃  ✗ DANGEROUS                        ┃
┃  Sensitive file access combined     ┃
┃  with network activity detected     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The verdict system is intentionally simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✓ &lt;strong&gt;CLEAN&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;⚠︎ &lt;strong&gt;SUSPICIOUS&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;✗ &lt;strong&gt;DANGEROUS&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is not to replace a full malware analysis platform, but to provide an immediate and understandable assessment.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;The core of Lure relies on two Linux features.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;unshare&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;unshare&lt;/code&gt; creates isolated namespaces for the process being analyzed.&lt;/p&gt;

&lt;p&gt;The binary runs with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An isolated user namespace&lt;/li&gt;
&lt;li&gt;An isolated mount namespace&lt;/li&gt;
&lt;li&gt;An isolated network namespace&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This gives the binary a restricted view of the system and prevents direct network communication.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;strace&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;strace&lt;/code&gt; records every syscall made by the target process.&lt;/p&gt;

&lt;p&gt;Lure parses those syscalls in real time and categorizes activity such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;File access&lt;/li&gt;
&lt;li&gt;Process execution&lt;/li&gt;
&lt;li&gt;Network connections&lt;/li&gt;
&lt;li&gt;Sensitive system interactions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The result is a report that is significantly easier to interpret than raw syscall logs.&lt;/p&gt;




&lt;h2&gt;
  
  
  Binary Inspection Without Execution
&lt;/h2&gt;

&lt;p&gt;Before running a binary, Lure can perform static inspection.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lure inspect ./binary
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command extracts information directly from the ELF file, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Architecture&lt;/li&gt;
&lt;li&gt;Entry point&lt;/li&gt;
&lt;li&gt;Linked libraries&lt;/li&gt;
&lt;li&gt;Security mitigations

&lt;ul&gt;
&lt;li&gt;NX&lt;/li&gt;
&lt;li&gt;PIE&lt;/li&gt;
&lt;li&gt;RELRO&lt;/li&gt;
&lt;li&gt;Stack canaries&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;File hashes&lt;/li&gt;
&lt;li&gt;UPX packing detection&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All without executing a single instruction.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Not Use Existing Tools?
&lt;/h2&gt;

&lt;p&gt;Lure is not intended to replace established malware analysis frameworks.&lt;/p&gt;

&lt;p&gt;Tools such as CAPE, Cuckoo, and virtualized analysis environments provide much deeper visibility and more advanced capabilities.&lt;/p&gt;

&lt;p&gt;However, they are designed for different workflows.&lt;/p&gt;

&lt;p&gt;Lure focuses on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fast local analysis&lt;/li&gt;
&lt;li&gt;No cloud uploads&lt;/li&gt;
&lt;li&gt;Minimal setup&lt;/li&gt;
&lt;li&gt;Readable output&lt;/li&gt;
&lt;li&gt;Lightweight execution&lt;/li&gt;
&lt;li&gt;Linux-first workflows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For many quick investigations, that is enough.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Learned Building It
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Parsing &lt;code&gt;strace&lt;/code&gt; Is Harder Than It Looks
&lt;/h3&gt;

&lt;p&gt;I initially assumed syscall parsing would be straightforward.&lt;/p&gt;

&lt;p&gt;It wasn't.&lt;/p&gt;

&lt;p&gt;Different syscall formats, interrupted calls, incomplete lines, and numerous edge cases meant that a significant portion of the project became defensive parsing rather than analysis logic.&lt;/p&gt;

&lt;h3&gt;
  
  
  False Positives Destroy Trust
&lt;/h3&gt;

&lt;p&gt;One early version flagged &lt;code&gt;/etc/ld.so.preload&lt;/code&gt; as a sensitive file.&lt;/p&gt;

&lt;p&gt;The problem?&lt;/p&gt;

&lt;p&gt;Many normal dynamically linked binaries interact with it during startup.&lt;/p&gt;

&lt;p&gt;As a result, something as harmless as &lt;code&gt;/bin/ls&lt;/code&gt; appeared suspicious.&lt;/p&gt;

&lt;p&gt;Reducing false positives turned out to be more important than adding new detections.&lt;/p&gt;

&lt;h3&gt;
  
  
  Linux Namespaces Are Incredibly Powerful
&lt;/h3&gt;

&lt;p&gt;I expected sandboxing to be the hardest part.&lt;/p&gt;

&lt;p&gt;Instead, Linux already provides most of the primitives needed through namespaces and standard tools such as &lt;code&gt;unshare&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Python's &lt;code&gt;subprocess&lt;/code&gt; module handled the rest.&lt;/p&gt;




&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Python 3&lt;/li&gt;
&lt;li&gt;&lt;code&gt;click&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rich&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pyelftools&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;strace&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;unshare&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No external APIs.&lt;/p&gt;

&lt;p&gt;No cloud services.&lt;/p&gt;

&lt;p&gt;No subscriptions.&lt;/p&gt;

&lt;p&gt;Just standard Linux tooling and Python.&lt;/p&gt;




&lt;h2&gt;
  
  
  Roadmap
&lt;/h2&gt;

&lt;p&gt;Some features I'm currently exploring:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JSON report export&lt;/li&gt;
&lt;li&gt;YARA rule integration&lt;/li&gt;
&lt;li&gt;File-write tracking&lt;/li&gt;
&lt;li&gt;Improved syscall classification&lt;/li&gt;
&lt;li&gt;Additional detection heuristics&lt;/li&gt;
&lt;li&gt;Terminal dashboard (TUI)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Try It Yourself
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/0xusmanismail/lure.git
&lt;span class="nb"&gt;cd &lt;/span&gt;lure
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inspect a binary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lure inspect /bin/ls
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run a binary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lure run /bin/ls
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lure currently targets Kali Linux and Debian-based distributions with &lt;code&gt;strace&lt;/code&gt; and &lt;code&gt;unshare&lt;/code&gt; installed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/0xusmanismail/lure" rel="noopener noreferrer"&gt;https://github.com/0xusmanismail/lure&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Lure is the first security tool I've released publicly.&lt;/p&gt;

&lt;p&gt;Building it taught me far more about Linux namespaces, ELF internals, and syscall tracing than I expected. There's still plenty of work ahead, but the current version already solves a workflow problem I encounter regularly.&lt;/p&gt;

&lt;p&gt;If you work in malware analysis, reverse engineering, incident response, or Linux security, I'd genuinely appreciate your feedback.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;As a cybersecurity student, this is the first tool I've shipped publicly—I would genuinely love your feedback!&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What would you add to a tool like this?&lt;/p&gt;

</description>
      <category>linux</category>
      <category>python</category>
      <category>opensource</category>
      <category>security</category>
    </item>
  </channel>
</rss>
