<?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: HimitsuShell</title>
    <description>The latest articles on DEV Community by HimitsuShell (@himitsushell).</description>
    <link>https://dev.to/himitsushell</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%2F3998052%2F8208533c-4e8f-40bd-8351-56edd74a1b2a.png</url>
      <title>DEV Community: HimitsuShell</title>
      <link>https://dev.to/himitsushell</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/himitsushell"/>
    <language>en</language>
    <item>
      <title>Shell Script-to-Binary Tools: shc vs. HimitsuShell</title>
      <dc:creator>HimitsuShell</dc:creator>
      <pubDate>Wed, 24 Jun 2026 07:01:38 +0000</pubDate>
      <link>https://dev.to/himitsushell/shell-script-to-binary-tools-shc-vs-himitsushell-5f7j</link>
      <guid>https://dev.to/himitsushell/shell-script-to-binary-tools-shc-vs-himitsushell-5f7j</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/neurobin/shc/tree/master" rel="noopener noreferrer"&gt;shc&lt;/a&gt; is a tool that converts shell scripts into binaries to prevent source code exposure. It is widely used, but has several limitations in practical use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It provides no obfuscation, making it vulnerable to reverse engineering.&lt;/li&gt;
&lt;li&gt;It depends on system shells such as &lt;code&gt;/bin/sh&lt;/code&gt;, exposing it to logging- and hooking-based attacks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In contrast, &lt;a href="https://himitsushell.com/" rel="noopener noreferrer"&gt;HimitsuShell&lt;/a&gt; was designed to address these issues. It applies various obfuscation techniques and does not rely on system shells, providing better protection against logging- and hooking-based attacks.&lt;/p&gt;

&lt;p&gt;Below is a comparison across multiple aspects.&lt;/p&gt;




&lt;h2&gt;
  
  
  Test Environment
&lt;/h2&gt;

&lt;p&gt;The test is conducted on Ubuntu 24.04 using the following shell script:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu0t7ahzydudm3roqmw6y.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu0t7ahzydudm3roqmw6y.webp" alt="shell_script" width="319" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;HimitsuShell is executed with default settings, while shc is built using its &lt;a href="https://github.com/neurobin/shc/blob/master/man.md" rel="noopener noreferrer"&gt;maximum security configuration&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;shc &lt;span class="nt"&gt;-Uf&lt;/span&gt; launcher.sh &lt;span class="nt"&gt;-o&lt;/span&gt; shc_binary
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both binaries generated by HimitsuShell and shc execute correctly as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8ryfvzymzjevbmf7v7i2.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8ryfvzymzjevbmf7v7i2.webp" alt=" " width="429" height="138"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Debug Symbol Stripping
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqjqbta2drt8b9yyq7596.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqjqbta2drt8b9yyq7596.webp" alt=" " width="405" height="128"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Both HimitsuShell and shc strip debug symbols.&lt;/p&gt;




&lt;h2&gt;
  
  
  Protection against Dynamic Library Hooking
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu51rskjxt82megu1r3vq.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu51rskjxt82megu1r3vq.webp" alt=" " width="545" height="174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Himitsu Shell does not rely on dynamic libraries, whereas shc does. As a result, shc is vulnerable to hooking-based attacks.&lt;/p&gt;




&lt;h2&gt;
  
  
  Debugger Detection
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnhw166txnxdistscn8le.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnhw166txnxdistscn8le.webp" alt=" " width="355" height="147"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxdzk834y8zxxoqxtmr40.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxdzk834y8zxxoqxtmr40.webp" alt=" " width="521" height="238"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Both HimitsuShell and shc detect debuggers such as gdb and strace and terminate execution accordingly.&lt;/p&gt;




&lt;h2&gt;
  
  
  String and Constant Obfuscation
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5n2klti3sebhz2xqjywt.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5n2klti3sebhz2xqjywt.webp" alt=" " width="640" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhwfuclwxh3n5rlcf51te.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhwfuclwxh3n5rlcf51te.webp" alt=" " width="640" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When extracting strings using Ghidra, the difference is apparent.&lt;/p&gt;

&lt;p&gt;HimitsuShell obfuscates strings, making analysis more difficult. In contrast, shc binaries expose sensitive strings in plaintext.&lt;/p&gt;

&lt;p&gt;Additionally, HimitsuShell supports constant obfuscation, while shc does not.&lt;/p&gt;




&lt;h2&gt;
  
  
  Advanced Obfuscation (Control Flow Flattening, Dead Code Injection, etc.)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3b85ubg3cun4f3yjlu3u.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3b85ubg3cun4f3yjlu3u.webp" alt=" " width="640" height="691"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffxyxo6ewggmcgu4p4jwe.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffxyxo6ewggmcgu4p4jwe.webp" alt=" " width="640" height="709"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The control flow graph of the main function in Ghidra reveals a clear difference.&lt;/p&gt;

&lt;p&gt;HimitsuShell heavily obfuscates the execution flow, making analysis significantly harder.&lt;/p&gt;

&lt;p&gt;shc, on the other hand, has a simple and readily analyzable control flow.&lt;/p&gt;




&lt;h2&gt;
  
  
  Protection against OS-level Logging and Hooking
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs8hrikmk6oyvmosr4zev.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs8hrikmk6oyvmosr4zev.webp" alt=" " width="640" height="113"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When monitoring &lt;code&gt;execve&lt;/code&gt; using auditd, scripts executed via shc expose the original shell script content in the logs.&lt;br&gt;
This happens because shc relies on the system shell.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2i7bp5fg5ssqvp6rshve.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2i7bp5fg5ssqvp6rshve.png" alt=" " width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In contrast, binaries generated by HimitsuShell do not expose script contents under the same conditions. This is because HimitsuShell does not rely on an external system shell and handles execution internally.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;A comparison between shc and Himitsu Shell reveals clear differences in obfuscation and protection against OS-level logging and hooking.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0np0u5t5cx1etx4iawtg.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0np0u5t5cx1etx4iawtg.webp" alt=" " width="515" height="277"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Additional Comparison
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/liberize/ssc" rel="noopener noreferrer"&gt;ssc&lt;/a&gt; is another tool that improves upon shc.&lt;/p&gt;

&lt;p&gt;It introduces protection against dynamic library hooking and string obfuscation, but still has limitations in advanced obfuscation and protection against OS-level logging and hooking.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In particular, ssc is independent of the system shell, but it extracts an interpreter (e.g., &lt;code&gt;/bin/sh&lt;/code&gt;) into &lt;code&gt;/tmp/ssc/XXXXXX&lt;/code&gt; during execution. This leaves a window during which logging and hooking are still possible.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In contrast, Himitsu Shell does not extract an external interpreter and handles execution internally, making it more resilient than ssc under the same conditions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://medium.com/@y37653/how-to-hack-ssc-shell-script-protection-tool-90a34b13c802" rel="noopener noreferrer"&gt;ssc Security Analysis: Structural Limitations of a Shell Script Compiler&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@y37653/how-to-hack-shc-shell-script-protection-tool-bd958126ea66" rel="noopener noreferrer"&gt;shc Security Analysis: Structural Limitations of a Shell Script Compiler&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>bash</category>
      <category>security</category>
      <category>opensource</category>
      <category>linux</category>
    </item>
    <item>
      <title>ssc Security Analysis: Structural Limitations of a Shell Script Compiler</title>
      <dc:creator>HimitsuShell</dc:creator>
      <pubDate>Wed, 24 Jun 2026 06:39:37 +0000</pubDate>
      <link>https://dev.to/himitsushell/ssc-security-analysis-structural-limitations-of-a-shell-script-compiler-3825</link>
      <guid>https://dev.to/himitsushell/ssc-security-analysis-structural-limitations-of-a-shell-script-compiler-3825</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/liberize/ssc" rel="noopener noreferrer"&gt;ssc&lt;/a&gt; is a project designed to improve upon shc, a popular Shell Script Compiler. Like shc, it converts shell scripts into C source code and then builds them into binaries to prevent source code exposure.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/liberize" rel="noopener noreferrer"&gt;
        liberize
      &lt;/a&gt; / &lt;a href="https://github.com/liberize/ssc" rel="noopener noreferrer"&gt;
        ssc
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Convert shell script to binary
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Simple Script Compiler&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://github.com/liberize/ssc/blob/master/README_zh_CN.md" rel="noopener noreferrer"&gt;中文版&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is a powerful tool to turn almost any script to binary, inspired by shc.&lt;/p&gt;
&lt;p&gt;ssc itself is not a compiler such as cc, it rather generates c++ source code with script code, then uses c++ compiler to compile the source into a binary which behaves exactly like the original script.&lt;/p&gt;
&lt;p&gt;Upon execution, the binary will call real script interpreter (systemwide, bundled or embeded), and fork a child process to pipe script code to the interpreter to execute.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Prerequisite&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;&lt;em&gt;(Note: g++ version should be 5.2 or above)&lt;/em&gt;&lt;/p&gt;

For Debian-based Linux distros


&lt;ul&gt;
&lt;li&gt;g++, perl, binutils&lt;/li&gt;
&lt;li&gt;libc-dev, libstdc++-dev (only required by -s flag)&lt;/li&gt;
&lt;li&gt;libz-dev (only required by -E flag)&lt;/li&gt;
&lt;li&gt;libz-dev, libfuse-dev, git, gcc, make, automake, autoconf, pkg-config, libtool, squashfs-tools (only required by -M flag)&lt;/li&gt;
&lt;/ul&gt;

&lt;br&gt;


For RedHat-based Linux distros



&lt;ul&gt;
&lt;li&gt;g++, perl, binutils&lt;/li&gt;
&lt;li&gt;glibc-static, libstdc++-static (only required by -s flag)&lt;/li&gt;
&lt;li&gt;zlib-devel (only required by -E flag)&lt;/li&gt;
&lt;li&gt;zlib-devel, fuse-devel, git, gcc…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/liberize/ssc" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Unlike shc, ssc does not directly depend on the system shell. Instead, it embeds a shell interpreter inside the generated binary.&lt;/p&gt;

&lt;p&gt;As a result, the attack technique demonstrated in the previous shc analysis using auditd (an operating system-level monitoring tool) cannot be applied to ssc in the same way.&lt;/p&gt;


&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/himitsushell/shc-security-analysis-structural-limitations-of-a-shell-script-compiler-1fgc" class="crayons-story__hidden-navigation-link"&gt;shc Security Analysis: Structural Limitations of a Shell Script Compiler&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/himitsushell" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3998052%2F8208533c-4e8f-40bd-8351-56edd74a1b2a.png" alt="himitsushell profile" class="crayons-avatar__image" width="800" height="800"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/himitsushell" class="crayons-story__secondary fw-medium m:hidden"&gt;
              HimitsuShell
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                HimitsuShell
                
              
              &lt;div id="story-author-preview-content-3968096" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/himitsushell" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3998052%2F8208533c-4e8f-40bd-8351-56edd74a1b2a.png" class="crayons-avatar__image" alt="" width="800" height="800"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;HimitsuShell&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/himitsushell/shc-security-analysis-structural-limitations-of-a-shell-script-compiler-1fgc" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Jun 23&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/himitsushell/shc-security-analysis-structural-limitations-of-a-shell-script-compiler-1fgc" id="article-link-3968096"&gt;
          shc Security Analysis: Structural Limitations of a Shell Script Compiler
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/security"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;security&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/linux"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;linux&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/bash"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;bash&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/opensource"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;opensource&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/himitsushell/shc-security-analysis-structural-limitations-of-a-shell-script-compiler-1fgc" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;5&lt;span class="hidden s:inline"&gt;&amp;nbsp;reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/himitsushell/shc-security-analysis-structural-limitations-of-a-shell-script-compiler-1fgc#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            2 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


&lt;p&gt;However, ssc also has its own structural limitations.&lt;/p&gt;

&lt;p&gt;Binaries generated by ssc temporarily extract an embedded shell interpreter (for example, BusyBox) to a path such as: &lt;code&gt;/tmp/ssc.XXXXXX/busybox&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The shell script is then passed to the extracted interpreter for execution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;As a result, if an attacker monitors the moment the embedded interpreter becomes externally accessible, the original shell script can be recovered.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4lvvhl1etxgsosbynepr.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4lvvhl1etxgsosbynepr.webp" alt="scheme" width="640" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s reproduce the issue and examine the limitation in practice.&lt;/p&gt;


&lt;h2&gt;
  
  
  Test Environment
&lt;/h2&gt;

&lt;p&gt;On Ubuntu 24.04, use the following shell script.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F862374uye0rfvsedhq4e.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F862374uye0rfvsedhq4e.webp" alt="shell_script" width="363" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Use the following command to &lt;a href="https://github.com/liberize/ssc/tree/master/examples/4_embed_interpreter" rel="noopener noreferrer"&gt;embed the shell interpreter&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./ssc &lt;span class="nb"&gt;test &lt;/span&gt;ssc_binary &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; busybox &lt;span class="nt"&gt;-c&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Reproducing the Issue
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install bpftrace&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;bpftrace

&lt;span class="c"&gt;# Start monitoring in Terminal 1&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;bpftrace &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s1"&gt;'tracepoint:syscalls:sys_enter_write /comm == "ssc_binary"/ { printf("PID: %d | FD: %d | Data: %s\n", pid, args-&amp;gt;fd, str(args-&amp;gt;buf)); }'&lt;/span&gt;

&lt;span class="c"&gt;# Run ssc_binary in Terminal 2&lt;/span&gt;
./ssc_binary
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;As shown in the screenshot below, the original shell script can be recovered using bpftrace, a kernel-level monitoring tool.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm3f9nn0if4zrvnp1hwa0.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm3f9nn0if4zrvnp1hwa0.webp" alt="Terminal2" width="461" height="185"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F25ghr8gwc6ysipsalk6n.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F25ghr8gwc6ysipsalk6n.webp" alt="Terminal1" width="640" height="360"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Mitigation
&lt;/h2&gt;

&lt;p&gt;To avoid this issue, a Shell Script Compiler should process the shell interpreter internally without extracting it outside the binary.&lt;/p&gt;

&lt;p&gt;Architectures that temporarily expose the interpreter to the operating system may still be vulnerable to kernel-level monitoring attacks such as the one demonstrated above.&lt;/p&gt;

&lt;p&gt;One example of an alternative approach is &lt;a href="https://himitsushell.com/" rel="noopener noreferrer"&gt;HimitsuShell&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The following articles provide additional information:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://medium.com/@y37653/shell-script-to-binary-tools-shc-vs-himitsushell-31baed264c6f" rel="noopener noreferrer"&gt;Shell Script-to-Binary Tools: shc vs. HimitsuShell&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://himitsushell.com/" rel="noopener noreferrer"&gt;HimitsuShell&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>security</category>
      <category>opensource</category>
      <category>bash</category>
      <category>linux</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>HimitsuShell</dc:creator>
      <pubDate>Tue, 23 Jun 2026 07:36:23 +0000</pubDate>
      <link>https://dev.to/himitsushell/-1d99</link>
      <guid>https://dev.to/himitsushell/-1d99</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/himitsushell/shc-security-analysis-structural-limitations-of-a-shell-script-compiler-1fgc" class="crayons-story__hidden-navigation-link"&gt;shc Security Analysis: Structural Limitations of a Shell Script Compiler&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/himitsushell" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3998052%2F8208533c-4e8f-40bd-8351-56edd74a1b2a.png" alt="himitsushell profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/himitsushell" class="crayons-story__secondary fw-medium m:hidden"&gt;
              HimitsuShell
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                HimitsuShell
                
              
              &lt;div id="story-author-preview-content-3968096" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/himitsushell" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3998052%2F8208533c-4e8f-40bd-8351-56edd74a1b2a.png" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;HimitsuShell&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/himitsushell/shc-security-analysis-structural-limitations-of-a-shell-script-compiler-1fgc" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Jun 23&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/himitsushell/shc-security-analysis-structural-limitations-of-a-shell-script-compiler-1fgc" id="article-link-3968096"&gt;
          shc Security Analysis: Structural Limitations of a Shell Script Compiler
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/security"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;security&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/linux"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;linux&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/bash"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;bash&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/opensource"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;opensource&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/himitsushell/shc-security-analysis-structural-limitations-of-a-shell-script-compiler-1fgc" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;5&lt;span class="hidden s:inline"&gt;&amp;nbsp;reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/himitsushell/shc-security-analysis-structural-limitations-of-a-shell-script-compiler-1fgc#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            2 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>shc Security Analysis: Structural Limitations of a Shell Script Compiler</title>
      <dc:creator>HimitsuShell</dc:creator>
      <pubDate>Tue, 23 Jun 2026 07:25:11 +0000</pubDate>
      <link>https://dev.to/himitsushell/shc-security-analysis-structural-limitations-of-a-shell-script-compiler-1fgc</link>
      <guid>https://dev.to/himitsushell/shc-security-analysis-structural-limitations-of-a-shell-script-compiler-1fgc</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/neurobin/shc" rel="noopener noreferrer"&gt;shc&lt;/a&gt; is one of the most widely used Shell Script Compilers. It converts a shell script into C source code and then builds it into a binary to prevent source code exposure.&lt;/p&gt;

&lt;p&gt;However, shc has a fundamental architectural limitation: it relies on the system shell for script execution, making it vulnerable to operating system-level logging and hooking attacks.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/neurobin" rel="noopener noreferrer"&gt;
        neurobin
      &lt;/a&gt; / &lt;a href="https://github.com/neurobin/shc" rel="noopener noreferrer"&gt;
        shc
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Shell script compiler
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;p&gt;&lt;a href="https://travis-ci.org/neurobin/shc" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/310797d1d7930cc76107d9bc3691afdd21e930ad947831ced97533bb71afc95f/68747470733a2f2f7472617669732d63692e6f72672f6e6575726f62696e2f7368632e7376673f6272616e63683d72656c65617365" alt="build status image"&gt;&lt;/a&gt;
&lt;a href="https://github.com/neurobin/shc/stargazers" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/2d2de42b48d8cc151b30d01495e1d05e4cbcb22f5db118c9654ddaaac87c556c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6e6575726f62696e2f7368632e737667" alt="GitHub stars"&gt;&lt;/a&gt;
&lt;a href="https://github.com/neurobin/shc/network" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/bdf3abd3687526ea11614ca7fe2fd85cd72ba9dcd3f6b3bf7429cf3645bba17a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6e6575726f62696e2f7368632e737667" alt="GitHub forks"&gt;&lt;/a&gt;
&lt;a href="https://github.com/neurobin/shc/issues" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/06b1844c8ec8a38f8faf2abdb880657b4907e754e4213e821d31dda6f74992e6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6e6575726f62696e2f7368632e737667" alt="GitHub issues"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Shell Script Compiler&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;A generic shell script compiler. Shc takes a script, which is specified on the command line and produces C source code. The generated source code is then compiled and linked to produce a stripped binary executable.&lt;/p&gt;
&lt;p&gt;The compiled binary will still be dependent on the shell specified in the first line of the shell code (i.e shebang) (i.e. #!/bin/sh), thus shc does not create completely independent binaries.&lt;/p&gt;
&lt;p&gt;shc itself is not a compiler such as cc, it rather encodes and encrypts a shell script and generates C source code with the added expiration capability. It then uses the system compiler to compile a stripped binary which behaves exactly like the original script. Upon execution, the compiled binary will decrypt and execute the code with the shell -c option.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Install&lt;/h2&gt;
&lt;/div&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;./configure
make
sudo make install&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; If &lt;code&gt;make&lt;/code&gt; fails due to &lt;em&gt;automake&lt;/em&gt; version, run &lt;code&gt;./autogen.sh&lt;/code&gt; before running the…&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/neurobin/shc" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Binaries generated by shc execute shell scripts by passing them to the system shell (for example, &lt;code&gt;/bin/bash&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;As a result, if an attacker monitors the moment the script is passed to the system shell, the original shell script can be recovered with relative ease.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F85vwhlu21yi8bd6lbfej.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F85vwhlu21yi8bd6lbfej.webp" alt="scheme" width="800" height="341"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s reproduce the issue and examine the limitation in practice.&lt;/p&gt;




&lt;h2&gt;
  
  
  Test Environment
&lt;/h2&gt;

&lt;p&gt;On Ubuntu 24.04, use the following shell script.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxhrd96ewaf1v0t6jv11d.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxhrd96ewaf1v0t6jv11d.webp" alt="shell script" width="319" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Use the &lt;a href="https://github.com/neurobin/shc/blob/master/man.md" rel="noopener noreferrer"&gt;maximum security settings&lt;/a&gt; as shown below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;shc &lt;span class="nt"&gt;-Uf&lt;/span&gt; launcher.sh &lt;span class="nt"&gt;-o&lt;/span&gt; shc_binary
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Reproducing the Issue
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install auditd&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;auditd &lt;span class="nt"&gt;-y&lt;/span&gt;

&lt;span class="c"&gt;# Register monitoring rule&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;auditctl &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nb"&gt;exit&lt;/span&gt;,always &lt;span class="nt"&gt;-F&lt;/span&gt; &lt;span class="nb"&gt;arch&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;b64 &lt;span class="nt"&gt;-S&lt;/span&gt; execve

&lt;span class="c"&gt;# Run the shc binary&lt;/span&gt;
./shc_binary

&lt;span class="c"&gt;# Check logs&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ausearch &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;-sc&lt;/span&gt; execve | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"shc_binary"&lt;/span&gt; &lt;span class="nt"&gt;-A&lt;/span&gt; 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;As shown in the screenshot below, the original shell script can be recovered using auditd, an operating system-level monitoring tool.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6muj8jfkdseqdwu38g67.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6muj8jfkdseqdwu38g67.png" alt="terminal" width="800" height="364"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Mitigation
&lt;/h2&gt;

&lt;p&gt;To avoid this issue, a Shell Script Compiler should not rely on the system shell for script execution.&lt;/p&gt;

&lt;p&gt;Architectures that depend on the system shell are inherently exposed to operating system-level logging and hooking attacks such as the one demonstrated above.&lt;/p&gt;

&lt;p&gt;Several alternatives exist, including &lt;a href="https://github.com/liberize/ssc" rel="noopener noreferrer"&gt;ssc&lt;/a&gt; and &lt;a href="https://himitsushell.com/" rel="noopener noreferrer"&gt;HimitsuShell&lt;/a&gt;. &lt;strong&gt;However, ssc also has its own architectural limitations.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The following articles provide additional analysis:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://medium.com/@y37653/how-to-hack-ssc-shell-script-protection-tool-90a34b13c802" rel="noopener noreferrer"&gt;ssc Security Analysis: Structural Limitations of a Shell Script Compiler&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@y37653/shell-script-to-binary-tools-shc-vs-himitsushell-31baed264c6f" rel="noopener noreferrer"&gt;Shell Script-to-Binary Tools: shc vs. HimitsuShell&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

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