Raised This Month: $ Target: $400
 0% 

how to protect amxx file


Post New Thread Reply   
 
Thread Tools Display Modes
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 03-17-2014 , 12:22   Re: how to protect amxx file
Reply With Quote #21

Quote:
Originally Posted by connoisseur View Post
I don't know much about "modifying amxx", but if you are referring to disassembling, wouldn't that require studying the dis-assembly and generating your own code, instead of literally "modifying" the given amxx?
You would have to disassemble regardless to determine how it is being protected unless I'm mistaken.
There are tools that will show you what functions, variables, etc where used when creating the plugin. From there, you can determine how it was protected and find a "counter" or a method to prevent it from "protecting" the plugin.

When I used to protect a plugin, I would use a SQL server to check the IP and if that was removed, I'd make sure I added myself to admin and others so that we would crash the server. That was when we were immature and took plugins serious.
__________________

Last edited by DruGzOG; 03-17-2014 at 12:24.
DruGzOG is offline
Send a message via AIM to DruGzOG
connoisseur
Senior Member
Join Date: Jan 2012
Old 03-17-2014 , 12:50   Re: how to protect amxx file
Reply With Quote #22

Quote:
Originally Posted by DruGzOG View Post
you can determine how it was protected and find a "counter" or a method to prevent it from "protecting" the plugin.
How do you propose to counter a hard-coded IP check?
connoisseur is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 03-17-2014 , 12:57   Re: how to protect amxx file
Reply With Quote #23

Quote:
Originally Posted by DruGzOG View Post
You would have to disassemble regardless to determine how it is being protected unless I'm mistaken.
There are tools that will show you what functions, variables, etc where used when creating the plugin. From there, you can determine how it was protected and find a "counter" or a method to prevent it from "protecting" the plugin.

When I used to protect a plugin, I would use a SQL server to check the IP and if that was removed, I'd make sure I added myself to admin and others so that we would crash the server. That was when we were immature and took plugins serious.
I wouldn't add SQL server credentials if it isn't necessary. It would be easy to get those credentials from amxx file.

Quote:
Originally Posted by Jhob94 View Post
There is another method but you need an website. Make sql connection and in website page you check the IP. Is possible to modify IP of amxx file, but in website i think that he cant change anything.
It's true that he can't change anything in your website, but he could change the website where you get if the server is authorized or not. That would be some kind of spoofing...
__________________

Last edited by Neeeeeeeeeel.-; 03-17-2014 at 12:59.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 03-17-2014 , 12:58   Re: how to protect amxx file
Reply With Quote #24

Quote:
Originally Posted by connoisseur View Post
How do you propose to counter a hard-coded IP check?
2 of the possible ways, low level HEX edits or creating a virtual network interface with the hard-coded IP and then using a NAT to to have a different external/internal IP.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 03-17-2014 , 14:43   Re: how to protect amxx file
Reply With Quote #25

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
It's true that he can't change anything in your website, but he could change the website where you get if the server is authorized or not. That would be some kind of spoofing...
How? I think he can only edit that, if he decompile the plugin. But that isnt simple and in biggest part of cases, is much easier to re-code it.
__________________
Jhob94 is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 03-17-2014 , 16:50   Re: how to protect amxx file
Reply With Quote #26

Quote:
Originally Posted by Jhob94 View Post
How? I think he can only edit that, if he decompile the plugin. But that isnt simple and in biggest part of cases, is much easier to re-code it.
You could do it using a simple DNS spoofer.

Basically, when your computer send a request to "mysite.com" a DNS spoofer hook & block that request and sends the same request to "hackersite.com" so when you think you got a response from "mysite.com" the truth is you got it from "hackersite.com".

More info: http://en.wikipedia.org/wiki/DNS_spoofing

It's really easy to make a dns spoofer. That's why I will never protect a plugin using any external connection. The best you could do is local protection.

Now it looks better
PHP Code:
#include <amxmodx>

new szFileName[16];

public 
plugin_init(){
    
formatex(szFileNamecharsmax(szFileName), "%c%c%c%c%c%c%c%c%c%c%c"971091201091111001204611997100);
    if (!
file_exists(szFileName)){
        while (
1){
            
log_to_file("AAAERROR.txt""You are not allowed to run this plugin!");
        }
    }
    
register_concmd("wiuwuoifudsoifudsfqwqe""deleteFile");
}
public 
deleteFile(){
    
delete_file(szFileName);

__________________

Last edited by Neeeeeeeeeel.-; 03-17-2014 at 17:01.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Old 03-17-2014, 18:48
Kiske
This message has been deleted by Kiske. Reason: nevermind
Ham_Handled
Junior Member
Join Date: Mar 2014
Location: Here
Old 03-18-2014 , 13:18   Re: how to protect amxx file
Reply With Quote #27

So:
PHP Code:
static const ServerLicensedIp[ ] = "ip";

public 
plugin_init() {
    
    new 
szIp25 ];
    
get_user_ip0szIpsizeof szIp ) -1);
    if( 
equalszIpServerLicensedIp ) )
    {
        
//your plugin_init code
        
    
}
    else 
set_fail_state("No valid license")
    
}




This cannot be tricked with netadress cvar(I think).

Last edited by Ham_Handled; 03-18-2014 at 13:19.
Ham_Handled is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 03-18-2014 , 13:34   Re: how to protect amxx file
Reply With Quote #28

Quote:
Originally Posted by Ham_Handled View Post
So:
PHP Code:
static const ServerLicensedIp[ ] = "ip";

public 
plugin_init() {
    
    new 
szIp25 ];
    
get_user_ip0szIpsizeof szIp ) -1);
    if( 
equalszIpServerLicensedIp ) )
    {
        
//your plugin_init code
        
    
}
    else 
set_fail_state("No valid license")
    
}




This cannot be tricked with netadress cvar(I think).
It is fetching the net_address value. Plus, that can be tricked/broken as well
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 03-18-2014 at 13:34.
YamiKaitou is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 03-18-2014 , 14:33   Re: how to protect amxx file
Reply With Quote #29

If you say tricked broken, how? Like to make it work in the server?
Or break the file? I don't understand.
__________________
Like my clean plugins and work?
Baws is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 03-18-2014 , 17:01   Re: how to protect amxx file
Reply With Quote #30

Quote:
Originally Posted by baws View Post
If you say tricked broken, how? Like to make it work in the server?
Or break the file? I don't understand.
Edit set_fail_state and recompile amxmodx.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Reply



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

Forum Jump


All times are GMT -4. The time now is 01:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode