SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Reply
 
Thread Tools Display Modes
Old 13/04/2018, 08:23 PM   #1
ProScripter
Banned
 
Join Date: Apr 2018
Location: India
Posts: 18
Reputation: 0
Default How to make 2 rcon system. [Dual Security]

Introduction
I am making this tutorial for those people who are getting attacked by rcon crackers.

So lets start....

Code:
public OnRconLoginAttempt(ip[], password[], success)
{
 if(success)
 {
here we will check that if player get success with 1st rcon then he will get dialog of 2nd rcon if he dont put second password then he will kicked.
if he try to cancel = kicked
if he try to enter wrong password = kicked.
full security.

Code:
	new pip[16], playername[25], string[270];
here we need this defines pip for playerip and playername for player's name and string which we gooing to send to admins or players.
Code:
	for(new i=0; i<MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
if that player isconnected.
Code:
            GetPlayerName(i, playername, MAX_PLAYER_NAME);
			GetPlayerIp(i, pip, sizeof(pip));
get the player's name and player's ip.
Code:
			if(!strcmp(ip, pip, true))
			{
                new pname[24];
                GetPlayerName(i,pname,24);
                format(string, sizeof(string), "%s trying to login in rcon.",playername);
                SendClientMessageToAll(0xFFFF00FF, string);
here we will send player name to all players that he is trying to log in in rcon.
Code:
				ShowPlayerDialog(i, DIALOG_RCON, DIALOG_STYLE_PASSWORD, "Server Rcon Logging", "You have confirmed with first password.\nNow make your way to second password so you can completely log in it.", "Cancel", "Connect Rcon");
here we will show that player dialog of 2nd rcon to enter hsi 2nd password of rcon.
Code:
			}
		}
	}
	return 1;
 }
 return 1;
}
this will finish the rcon system
now
Code:
#define DIALOG_RCON 1
now lets complete our dialog.

Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == DIALOG_RCON)
	{
check if the dialog is rcon one.
if (!response) Kick(playerid);
{
if player try to cancel or wrong pw he will be kicked.
Code:
			if(strcmp(inputtext, "MyPass", true)==0)
	        {
				SendClientMessage(playerid, COLOR_WHITE,"SERVER: You are logged in as admin.");
		    }
if player enters correct password in 2nd rcon then he will get this message.
otherwise else

Code:
			else
			{
			 format(string, 200, "%s has been kicked due to invalid attempt of rcon login.", RPN(playerid));
			 SendMessageToAdmins(COLOR_ADMIN, string);
			 Kick(playerid);
			}
else kick that player with the message.
Code:
			return 1;
		}
	}

return 1;
}
complete this } and return 1; at correct place.

i hope you will be able to learn how to make 2nd rcon wth simple tutorial.
ProScripter is offline   Reply With Quote
Old 13/04/2018, 08:26 PM   #2
RANGER44
Big Clucker
 
RANGER44's Avatar
 
Join Date: Oct 2016
Location: SA-MP
Posts: 85
Reputation: 25
Default Re: How to make 2 rcon system. [Dual Security]

Looks pretty awesome, however I didn't tried yet, Good job Pro!

edit: it's really good and I think famous servers will get it
RANGER44 is offline   Reply With Quote
Old 13/04/2018, 08:26 PM   #3
ProScripter
Banned
 
Join Date: Apr 2018
Location: India
Posts: 18
Reputation: 0
Default Re: How to make 2 rcon system. [Dual Security]

Quote:
Originally Posted by RANGER44 View Post
Looks pretty awesome, however I didn't tried yet, Good job Pro!
thanks.
ProScripter is offline   Reply With Quote
Old 13/04/2018, 11:54 PM   #4
NaS
High-roller
 
NaS's Avatar
 
Join Date: Mar 2008
Posts: 1,584
Reputation: 466
Default Re: How to make 2 rcon system. [Dual Security]

On first glance this basically works, but still the main issue is that IF you manage to get the RCON password you can still do everything with it, just not from ingame (Remote Console).

Also you can send RCON Commands while the "second RCON" Dialog is open, just press F6. Unless you actually disable RCON Commands from that player until he entered the second password, this will still not be secure. At this point the player already knows the RCON Password AND is logged in!

You should switch the order:

First, log in with the second (custom) RCON Password, which will allow the player to log into the actual RCON.
If a player attempts to log into RCON without having entered the "custom" password, ban the IP for X seconds.

Only this way ensures that a player cannot log into RCON without having typed the other password. Doing it your way will have the player logged in to actual RCON while seeing the Dialog for the second password.
NaS is online now   Reply With Quote
Old 14/04/2018, 12:13 AM   #5
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,807
Reputation: 831
Default Re: How to make 2 rcon system. [Dual Security]

Or just make your RCON password not easy for everyone to guess*!
__________________

My GitHub:


Last edited by Gammix; 14/04/2018 at 12:59 AM.
Gammix is offline   Reply With Quote
Old 14/04/2018, 12:57 AM   #6
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,147
Reputation: 345
Default Re: How to make 2 rcon system. [Dual Security]

Server.cfg -> rcon 0
Problem solved.
__________________

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link


RogueDrifter is online now   Reply With Quote
Old 14/04/2018, 05:56 AM   #7
ProScripter
Banned
 
Join Date: Apr 2018
Location: India
Posts: 18
Reputation: 0
Default Re: How to make 2 rcon system. [Dual Security]

Quote:
Originally Posted by RogueDrifter View Post
Server.cfg -> rcon 0
Problem solved.
this problem not get solved this happend alot with me
i did rcon 0 but still that person getting my password i dont know how
so i made this and he is not able to get in it now.
ProScripter is offline   Reply With Quote
Old 14/04/2018, 07:01 AM   #8
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,147
Reputation: 345
Default Re: How to make 2 rcon system. [Dual Security]

Quote:
Originally Posted by ProScripter View Post
this problem not get solved this happend alot with me
i did rcon 0 but still that person getting my password i dont know how
so i made this and he is not able to get in it now.
Thats why you should never make your rcon pw 123456.
__________________

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link


RogueDrifter is online now   Reply With Quote
Old 14/04/2018, 07:41 AM   #9
ProScripter
Banned
 
Join Date: Apr 2018
Location: India
Posts: 18
Reputation: 0
Default Re: How to make 2 rcon system. [Dual Security]

Quote:
Originally Posted by RogueDrifter View Post
Thats why you should never make your rcon pw 123456.
my rcon password is always in @Aa9 in all characters + 10+ character password
ProScripter is offline   Reply With Quote
Old 14/04/2018, 04:01 PM   #10
DTV
Gangsta
 
DTV's Avatar
 
Join Date: Dec 2010
Posts: 534
Reputation: 121
Default Re: How to make 2 rcon system. [Dual Security]

You could prevent people getting access to RCON by only whitelisting access to certain users, if they aren't whitelisted == Kick/Ban/etc.
__________________
Bringing the nuclear post apocalyptic setting to SA-MP, click the banners to view the forum or Discord server.



DTV 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
[FilterScript] [FS] Ultimate RCON security. b3nz Filterscripts 9 17/06/2015 07:18 PM
[FilterScript] C' Rcon Security Essential Champ Filterscripts 16 06/06/2014 06:30 AM
RCON/Security/Bot narome2b Scripting Help 2 27/02/2014 10:36 PM
[FilterScript] SecuriCon v1.1 [RCON Security System] [UPDATE] Joshb93 Filterscripts 7 05/04/2012 06:42 AM
[FilterScript] ~ SecuriCon ~ [RCON Security System] Joshb93 Filterscripts 6 02/04/2012 09:24 PM


All times are GMT. The time now is 10:46 PM.


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