SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 07/02/2016, 07:01 PM   #1
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,213
Reputation: 352
Cool Script Secure ADM

Hello, I would like to present include allowing us to introduce additional security for our file AMX.

Security Functions:
a) AntiDeAMX
b) ScriptSecureADM
- IP and PORT checker
- Expiration date script
- Control slots server
- Check rcon password
- Check server language
- Web ACK System

How to use UltimateScriptSecure.inc
PHP Code:
//Install
//1. Open UltimateScriptSecure and find "User Configuration"
//2. Edit you server information.

public OnGameModeInit(){ //OR OnFilterScriptInit
    
if(!USS_Init()) return 0;
    return 
1;

Web ACK System:
PHP File for UltimateScriptSecure.inc

If you want to use the authorization by the website follow the steps:
1. Edit /secure_adm/index.php
PHP Code:
$ANTI_FLOOD '123'//the same as SCRIPT_ANTI_FLOOD
$ACK_TRUE =   '{BOBO_HAHA,ACCESSCONTROL,TRUE}'//the same as SCRIPT_ACK_KEY
$ACK_FALSE =  'Fuck you thief :P'//anything 
2. Edit /secure_adm/Server.txt
PHP Code:
//add IP:PORT your server, example:
127.0.0.1:7777
127.0.0.1
:7778 
Error List:
PHP Code:
[ADMInfoLocal server detect.
[
ADMErrorThis script is stolen.
[
ADMErrorScript license has expired.
[
ADMErrorInvalid server configcheck your max players.
[
ADMErrorInvalid server configcheck your rcon password.
[
ADMErrorInvalid server configcheck your language.
[
ADMErrorThe script did not get permission to activation
Download:
UltimateScriptSecure.inc
Web ACK System

Non-Registered Users:
Bug Report

Last edited by AbyssMorgan; 12/10/2019 at 08:34 AM. Reason: Links update
AbyssMorgan is offline   Reply With Quote
Old 07/02/2016, 07:14 PM   #2
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,766
Reputation: 840
Default Re: Script Secure ADM

pawn Code:
#if !defined isnull
    #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif

Do the same for these:
pawn Code:
#define FILE_SERVERIP           "127.0.0.1"
#define FILE_SERVERPORT         (7777)         
#define FILE_LICENSEID          (20160201)      //<--- YYYYMMDD 01.02.2016 (DD.MM.YYYY)
#define FILE_MAX_PLAYERS        (500)           //max players in server.cfg
#define FILE_RCONPASS           "123"           //rcon password
#define FILE_LANGUAGE           "Polish"        //server language

So the user won't need to edit the include but do something like this:
pawn Code:
#define FILE_SERVERIP "127.0.0.1"
#include <ScriptSecure>

And i think the only thing enough for security is the IP and PORT.
__________________

Follow me on Github: Follow me on Spotify: Donate on Paypal:

Gammix is offline   Reply With Quote
Old 07/02/2016, 07:37 PM   #3
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,213
Reputation: 352
Default Re: Script Secure ADM

Quote:
Originally Posted by Gammix View Post
pawn Code:
#if !defined isnull
    #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif

Do the same for these:
pawn Code:
#define FILE_SERVERIP           "127.0.0.1"
#define FILE_SERVERPORT         (7777)         
#define FILE_LICENSEID          (20160201)      //<--- YYYYMMDD 01.02.2016 (DD.MM.YYYY)
#define FILE_MAX_PLAYERS        (500)           //max players in server.cfg
#define FILE_RCONPASS           "123"           //rcon password
#define FILE_LANGUAGE           "Polish"        //server language

So the user won't need to edit the include but do something like this:
pawn Code:
#define FILE_SERVERIP "127.0.0.1"
#include <ScriptSecure>

And i think the only thing enough for security is the IP and PORT.
okay I might add, I personally love the protection time, useful when we are co-owner of the server
AbyssMorgan is offline   Reply With Quote
Old 07/02/2016, 08:52 PM   #4
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,766
Reputation: 840
Default Re: Script Secure ADM

Actually you got it wrong:
pawn Code:
#if !defined FILE_SERVERIP
    #error Please #define FILE_SERVERIP "127.0.0.1"
#endif

Should/Recommended to be like this:
pawn Code:
#if !defined FILE_SERVERIP
    #define FILE_SERVERIP "127.0.0.1"
#endif

So if user haven't defined, the include will run on its default value.
__________________

Follow me on Github: Follow me on Spotify: Donate on Paypal:

Gammix is offline   Reply With Quote
Old 07/02/2016, 09:24 PM   #5
Spmn
Gangsta
 
Join Date: Jun 2015
Location: Romania
Posts: 490
Reputation: 131
Default Re: Script Secure ADM

1. Your protection will fail if "bind" is unset since comparing a null string to a non-null string will return 0 (strings are the same)

2. There is no point in checking if rcon_password is unset because it can't be.

3. I don't get why you stop server if Language or RCON Password is set to any other value than what it is defined in script. Why don't you just change them to the value that should be and eventually print a warning message.

4. Instead of throwing the same error in case of misconfiguration (Invalid Server Config) it should print different messages for every case. It can be quite hard for a newbie to find out what is misconfigured.
Spmn is offline   Reply With Quote
Old 08/02/2016, 02:37 PM   #6
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,213
Reputation: 352
Default Re: Script Secure ADM

1. corrected
2. corrected
3. added switches
PHP Code:
#define DONT_ALLOW_LOCALHOST    //additional option
#define CHECK_MAX_PLAYERS        //additional option
#define CHECK_RCON_PASSWORD        //additional option
#define CHECK_SERVER_LANGUAGE    //additional option 
4. corrected
AbyssMorgan is offline   Reply With Quote
Old 08/02/2016, 04:22 PM   #7
JustMe.77
Huge Clucker
 
JustMe.77's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 214
Reputation: 65
Default Re: Script Secure ADM

Could you add multiple IP's Port and stuff? I'd need it for example with my HomeServer IP, Main Server IP and TestServer IP.

Anyways, nice Include.
JustMe.77 is offline   Reply With Quote
Old 08/02/2016, 04:26 PM   #8
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,213
Reputation: 352
Default Re: Script Secure ADM

I can do it
AbyssMorgan is offline   Reply With Quote
Old 08/02/2016, 04:53 PM   #9
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,213
Reputation: 352
Default Re: Script Secure ADM

Quote:
Originally Posted by JustMe.77 View Post
Could you add multiple IP's Port and stuff? I'd need it for example with my HomeServer IP, Main Server IP and TestServer IP.

Anyways, nice Include.
I created a second version which allows you to specify multiple servers.
Read the instruction inside file.
https://github.com/AbyssMorgan/SA-MP...riptSecure.inc
AbyssMorgan is offline   Reply With Quote
Old 25/06/2016, 06:48 AM   #10
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,213
Reputation: 352
Default Re: Script Secure ADM

Update v4.0 for ScriptSecure.inc and MultiScriptSecure.inc:
- Added Web ACK System (confirmation by the web server)
- Fixed minor bugs in the code
AbyssMorgan is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rcon secure Shazwan Scripting Help 2 05/06/2014 11:16 AM
[FilterScript] Secure Admin (ACAdmin) Chris1337 Filterscripts 12 05/07/2012 05:28 PM
[HELP]when i type /secure or when 3 people type /secure server crashes Lilcuete Help Archive 2 02/08/2010 06:40 PM
[FilterScript] >> Belt Secure System << (DKN) ipsBruno Filterscripts 12 13/07/2010 08:51 AM


All times are GMT. The time now is 05:03 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.