Welcome to World of IPTV

With

+23k members
+11k threads
+106k posts

we are the most popular IPTV community on the web. 

IMPORTANT NOTE:
WE HAVE RECENTLY NOTICED THAT TOO MANY DOUBLE FAKE ACCOUNTS ARE CREATED IN THE PAST.
TO PREVENT THIS ISSUE THE DECISION WAS MADE THAT IN THE FUTURE A ANNUALLY FEE 20 EURO WILL BE RAISED FOR NEW MEMBERSHIPS.

Join now to the World of IPTV

Forum Rules

Before you start, check out the forum rules first

Account upgrade

Upgrade your account to get access to full features

Advertising

Would you like to place your advertisement with us ?

Resources Manager

Hundreds of IPTV scripts and apps are available for download

Script Encrypting a shell script

mediasat

Extended Member
Ext. Member
Joined
Oct 20, 2019
Messages
3
Reaction score
18
Points
11
Location
morocco
Go to the link https://www.datsi.fi.upm.es/~frosal/sources/ and download latest stable source for shc
in this case the latest source is shc-3.8.9b.tgz

1 ) cd /usr/local
2 ) sudo wget https://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.9b.tgz
3 ) sudo tar -zxvf shc-3.8.9b.tgz
4) cd shc-3.8.9
5) make
6) make test
7) make strings
8) make expiration
9) mkdir -p /usr/local/man/man1
10) make install

now shc in installed on your system in /usr/local/bin

to encrypt the script

shc -help gives the complete information about how we can use the package

shc -help
shc Version 3.8.9b, Generic Script Compiler
shc Copyright (c) 1994-2015 Francisco Rosales <[email protected]>
shc Usage: shc [-e date] [-m addr] [-i iopt] [-x cmnd] [-l lopt] [-rvDTCAh] -f script

-e %s Expiration date in dd/mm/yyyy format [none]
-m %s Message to display upon expiration ["Please contact your provider"]
-f %s File name of the script to compile
-i %s Inline option for the shell interpreter i.e: -e
-x %s eXec command, as a printf format i.e: exec('%s',@ARGV);
-l %s Last shell option i.e: --
-r Relax security. Make a redistributable binary
-v Verbose compilation
-D Switch ON debug exec calls [OFF]
-T Allow binary to be traceable [no]
-C Display license and exit
-A Display abstract and exit
-h Display help and exit

Environment variables used:
Name Default Usage
CC cc C compiler command
CFLAGS <none> C compiler flags

Please consult the shc(1) man page.


###### simple encryption ####
write a test script like below

#!/bin/bash
echo Test Script

shc -f test
This will create 2 files test.x (executable binary) and test.x.c(C source code)

test.x is an executable file
test.x may or may not run on system depending upon kernel as it is non traceable

to overcome this problem we must compile our script as traceable and redistributable
so that it can run on any system by any user.

shc -Tf test (or you can write it in simple way shc -T -f test)

### Encryption with expiration date and message #####

provide expiration date with -e in dd/mm/yyyy format and with -m type a message which you want to display after script expiration

shc -e 01/01/2000 -m "This script expired.Contact your admin" -Tf test

sice the date is in past the encrypted script is already expired and after running ./test.x it will give message "This script expired.Contact your admin"

### The one more thing you can do with this is compile the C source code into the binary by below command.##

gcc -o <binary-file-name> test.x.c

This will create c compiled binary file of your script.
The only difference between the shc compiled binary and c compiled binary is shc compiled binary is stripped while the c compiled binary is not stripped. (non stripped binaries have debugging information built into it)
This is something different that you. should try.



transported​
 
shape1
shape2
shape3
shape4
shape5
shape6
Top
AdBlock Detected

We know, ad-blocking software do a great job at blocking ads. But our site is sponsored by advertising. 

For the best possible site experience please take a moment to disable your AdBlocker.
You can create a Account with us or if you already have account, you can prefer an Account Upgrade.

I've Disabled AdBlock