0

please'd like to take a simple doubt would like to know how can I encode my .sh script shell script against third-party modifications?

I can watch the cpanel their installation script found in the url

layer1.cpanel.net/latest

at the end of their script has a part unreadable

I wonder how can I leave my protected script this so?

thank you.

Filipi Silva
  • 137
  • 1
  • 1
  • 10

2 Answers2

0

That bit at the bottom of that script is an embedded binary. The script that you see at the top simply extracts that binary content from the script and then extracts it (using gzip it looks like).

The only "protection from modification" in that script are the CRC and MD5 bits and since neither of those is all that reliable at this point and both the data and the sum are in the script itself it doesn't offer all that much protection against someone who wants to modify the script or the binary. Not to mention that someone could always just delete the sum checking bits of code before running it.

Etan Reisner
  • 77,877
  • 8
  • 106
  • 148
0

The part at the of the script which is unreadable for you is a binary payload which has been attached to it. So it actually does not belong to the script.

Here is an article about shell script payloads: http://www.linuxjournal.com/content/add-binary-payload-your-shell-scripts

A shell script is not a binary format and thus you cannot protected it against third-party modifications. You would have to use programming languages which compile to binary (like C) for that purpose. (Even then it is not completely protected, you would be still able to reverse engineer it and modify it at binary level.)

klein
  • 36
  • 2
  • 4