Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Analysis of installation and use of shc

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail the analysis of the installation and use of shc, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

1. First of all, you need to check whether the gcc compiler is installed on the system, and take Fedora Core6 as an example to introduce the check and installation of gcc:

Rmp-qa | grep compat-gcc

There are:

No:

Wget ftp://mirrors.kernel.org/fedora/core/6/i386/os/Fedora/RPMS/compat-gcc-34-3.4.6-4.i386.rpm

two。

Ln-s / usr/bin/gcc34 / usr/bin/cc

3. Install shc

Wget http://www.datsi.fi.upm.es/%7Efrosal/sources/shc-3.8.6.tgz

# tar xzvf shc-3.8.6.tgz

# cd shc-3.8.6

# mkdir-p / usr/local/man/man1

This step is required, otherwise an error will be reported during the installation process, and shc will install the command to the / usr/local/bin/ directory; store the help documents in the / usr/local/man/man1/ directory. If there is no such directory on the system, an error will be reported during installation. You can create this directory and then perform the installation:

# make test

# make strings

# make install

This is to answer yes or y. Do not enter directly, or you will report an error.

4. How to use it:

Shc-v-f test.sh

-v is verbose mode, which outputs the compilation log in more detail

-f specifies the name of the script.

Shc-f script-name

After running, two files are generated, script-name.x and script-name.x.c. Script-name.x is the executable binary file after encryption; it can be run with. / script-name, and script-name.x.c is the original file that generates script-name.x (c language).

The "- f" option specifies the program that needs to be encrypted. To encrypt the shell program script.s, execute:

# shc-f script.s

If you want to see the details of the execution, you can add the option "- v". After the execution is completed, two files will be produced: "script.s.x.c" and "script.s.x". The command shc first generates its C language source code "script.s.x.c" through the shell program, and then compiles it to generate an encrypted executable binary file "script.s.x". Run "script.s.x" to see the execution result of this program:

In addition, shc also provides a way to set a valid execution period. You can first use shc to convert shell programs to binary and add expiration time, such as:

# shc-e 18Compact 10Compact 2006-m "It's too late to run this script"-f script.s

On the installation and use of shc analysis to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report