You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p><strong>shc</strong> 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 <code>-c</code> option. Unfortunatelly, it will not give you any speed improvement as a real C program would.</p>
67
48
<p><strong>shc</strong>'s main purpose is to protect your shell scripts from modification or inspection. You can use it if you wish to distribute your scripts but don't want them to be easily readable by other people.</p>
68
49
<h1id="options">OPTIONS</h1>
69
-
<dl>
70
-
<dt>-e <em>date</em></dt>
71
-
<dd>Expiration date in <em>dd/mm/yyyy</em> format <code>[none]</code>
72
-
</dd>
73
-
<dt>-m <em>message</em></dt>
74
-
<dd>message to display upon expiration <code>["Please contact your provider"]</code>
75
-
</dd>
76
-
<dt>-f <em>script_name</em></dt>
77
-
<dd>File path of the script to compile
78
-
</dd>
79
-
<dt>-i <em>inline_option</em></dt>
80
-
<dd>Inline option for the shell interpreter i.e: <code>-e</code>
81
-
</dd>
82
-
<dt>-x <em>command</em></dt>
83
-
<dd>eXec command, as a printf format i.e: <code>exec(\\'%s\\',@ARGV);</code>
84
-
</dd>
85
-
<dt>-l <em>last_option</em></dt>
86
-
<dd>Last shell option i.e: <code>--</code>
87
-
</dd>
88
-
<dt>-o <em>outfile</em></dt>
89
-
<dd>output to the file specified by outfile
90
-
</dd>
91
-
<dt>-r</dt>
92
-
<dd>Relax security. Make a redistributable binary which executes on different systems running the same operating system. You can release your binary with this option for others to use
93
-
</dd>
94
-
<dt>-v</dt>
95
-
<dd>Verbose compilation
96
-
</dd>
97
-
<dt>-S</dt>
98
-
<dd>Switch ON setuid for root callable programs [OFF]
99
-
</dd>
100
-
<dt>-D</dt>
101
-
<dd>Switch on debug exec calls
102
-
</dd>
103
-
<dt>-U</dt>
104
-
<dd>Make binary to be untraceable (using <em>strace</em>, <em>ptrace</em>, <em>truss</em>, etc.)
105
-
</dd>
106
-
<dt>-H</dt>
107
-
<dd>Hardening. Extra security flag without root access requirement that protects against dumping, code injection, <code>cat /proc/pid/cmdline</code>, ptrace, etc.. This feature is <strong>experimental</strong> and may not work on all systems. This option currently only works with Bourne shell (sh) scripts without any positional parameters.
108
-
</dd>
109
-
<dt>-s</dt>
110
-
<dd>Hardening with single process. Requires -H option, runs the binary in a single process, shell is called in the main process otherwise its called in a child process. This feature is <strong>experimental</strong> (may hang) and may not work on all systems. This option currently only works with Bourne shell (sh) scripts without any positional parameters.
111
-
</dd>
112
-
<dt>-C</dt>
113
-
<dd>Display license and exit
114
-
</dd>
115
-
<dt>-A</dt>
116
-
<dd>Display abstract and exit
117
-
</dd>
118
-
<dt>-B</dt>
119
-
<dd>Compile for BusyBox
120
-
</dd>
121
-
<dt>-h</dt>
122
-
<dd>Display help and exit
123
-
</dd>
124
-
</dl>
50
+
<p>-e <em>date</em> : Expiration date in <em>dd/mm/yyyy</em> format <code>[none]</code></p>
51
+
<p>-m <em>message</em> : message to display upon expiration <code>["Please contact your provider"]</code></p>
52
+
<p>-f <em>script_name</em> : File path of the script to compile</p>
53
+
<p>-i <em>inline_option</em> : Inline option for the shell interpreter i.e: <code>-e</code></p>
54
+
<p>-x <em>command</em> : eXec command, as a printf format i.e: <code>exec(\\'%s\\',@ARGV);</code></p>
55
+
<p>-l <em>last_option</em> : Last shell option i.e: <code>--</code></p>
56
+
<p>-o <em>outfile</em> : output to the file specified by outfile</p>
57
+
<p>-r : Relax security. Make a redistributable binary which executes on different systems running the same operating system. You can release your binary with this option for others to use</p>
58
+
<p>-v : Verbose compilation</p>
59
+
<p>-S : Switch ON setuid for root callable programs [OFF]</p>
60
+
<p>-D : Switch on debug exec calls</p>
61
+
<p>-U : Make binary to be untraceable (using <em>strace</em>, <em>ptrace</em>, <em>truss</em>, etc.)</p>
62
+
<p>-H : Hardening. Extra security flag without root access requirement that protects against dumping, code injection, <code>cat /proc/pid/cmdline</code>, ptrace, etc.. This feature is <strong>experimental</strong> and may not work on all systems. This option currently only works with Bourne shell (sh) scripts without any positional parameters.</p>
63
+
<p>-s : Hardening with single process. Requires -H option, runs the binary in a single process, shell is called in the main process otherwise its called in a child process. This feature is <strong>experimental</strong> (may hang) and may not work on all systems. This option currently only works with Bourne shell (sh) scripts without any positional parameters.</p>
<p>The maximum size of the script that could be executed once compiled is limited by the operating system configuration parameter <code>_SC_ARG_MAX</code> (see sysconf(2))</p>
Copy file name to clipboardExpand all lines: man.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
% shc(1) shc user manual
2
2
%
3
-
% November 20, 2018
3
+
% January 14, 2019
4
4
<hr>
5
5
6
6
# NAME
@@ -120,7 +120,7 @@ Compile an untraceable binary that doesn't require root access (experimental):
120
120
shc -Hf myscript -o mybinary
121
121
```
122
122
123
-
# BUGS
123
+
# LIMITATIONS
124
124
The maximum size of the script that could be executed once compiled is limited by the operating system configuration parameter `_SC_ARG_MAX` (see sysconf(2))
0 commit comments