Thread: Anti SYI protection for Project Czar

Page 1 of 6 123 ... LastLast
Results 1 to 10 of 52
  1. #1 Anti SYI protection for Project Czar 
    Registered Member
    Join Date
    Jul 2007
    Posts
    358
    Thanks given
    0
    Thanks received
    0
    Rep Power
    26
    I did not make the SYI protecter it was made by KEVIN, this tutorial is for Czar only, because that is the only server that has a strange server.java.

    Description: Stopping an Syi crasher from attacking your server.

    Difficulty: 2

    Assumed Knowledge: Copy & Paste

    Tested Server: Project Czar

    Files/Classes Modified: Server.java, client.java

    Procedure
    Step 1: Make a new file called BanManager.java and put this inside:

    Code:
    import java.util.ArrayList;
    
    public class BanManager 
    {
     public final static void Initialize() // Ban Manager handler by Kevin
      {
       AddName("SYIpkpker");
       AddName("SilabSoft");
       AddName("runescape");
       AddName("thorak");
       AddName("CRASH");
    
    AddAddress("e83-245-158-89.elisa-laajakaista.fi"); 
      }
    
      public final static void AddName(String Name)
      {
        Names.add(Name.toLowerCase());
      }
    
      public final static boolean BannedName(String _Name)
      {
       _Name = _Name.toLowerCase();
    
       for(String Name : Names)
        if(_Name.contains(Name))
          return true;
    
       for(Character c : _Name.toCharArray()) // <3 Silabsoft
        if(!Character.isLetterOrDigit(c))
         if(!Character.isSpaceChar(c))
          return true;
    
       return false;
      }
    
      public final static void AddAddress(String Address)
      {
        Addresses.add(Address.toLowerCase());
      }
    
      public final static boolean BannedAddress(String _Address)
      {
       _Address = _Address.toLowerCase();
    
       for(String Address : Addresses)
        if(Address.equals(_Address))
          return true;
    
       return false;
      }
    
      public static ArrayList<String> Names = new ArrayList<String>();
      public static ArrayList<String> Addresses = new ArrayList<String>();
    }

    Step 2: Open up client.java and search:

    Code:
    			if(playerName == null || playerName.length() == 0) 
                            disconnected = true;
    Under that add:

    Code:
    			if(BanManager.BannedName(playerName)) //by kevin
           			{
            		BanManager.AddAddress(connectedFrom);
            		disconnected = true;
            		return;
           			}

    Step 3: Now open up server.java ( backup your server.java ):

    Add this to server.java:

    Code:
    public String connectingHost;
    then Find,

    Code:
    public void run() {
    Replace ALL the code below that with:

    Code:
    	public void run() {
    		// setup the listener
    		try {
    			shutdownClientHandler = false;
    			clientListener = new java.net.ServerSocket(serverlistenerPort, 1, null);
    			misc.println("- YOUR SERVER NAME -");
    			misc.println("NOW ONLINE!");
    			while(true) {
    				java.net.Socket s = acceptSocketSafe(clientListener);
    				s.setTcpNoDelay(true);
                                    connectingHost = s.getInetAddress().getHostName(); 
    					if (server.playerHandler.checkBannedIps() == true) {
    					misc.println(connectingHost+" is ip banned");
    					s.close();
    					} else {
    				if(/*connectingHost.startsWith("localhost") || connectingHost.equals("127.0.0.1")*/true) {
      			        
                                 	if(clientListener != null)
    				{
    				 if(!BanManager.BannedAddress(connectingHost)) 
    				 {
    				  misc.println("ClientHandler: Accepted from "+connectingHost+":"+s.getPort()); // by kevin
    					 playerHandler.newPlayerClient(s, connectingHost);
    				 }
    				 else
    				 {
    					misc.println("ClientHandler: Rejected from "+connectingHost+":"+s.getPort()); // by kevin
    				   s.close(); 
    				 }
    				}
    			}
    }
    }
    		} catch(java.io.IOException ioe) {
    			if(!shutdownClientHandler) {
    				misc.println("Error: Unable to startup listener on "+serverlistenerPort+" - port already in use?");
    			} else {
    				misc.println("ClientHandler was shut down.");
    			}
    		}
    	}
    	                public void killServer() {
    		        try {
    			shutdownClientHandler = true;
    			if(clientListener != null) clientListener.close();
    			clientListener = null;
    		        } catch(java.lang.Exception __ex) {
    			__ex.printStackTrace();
    		        }
    	                }
    	public static int EnergyRegian = 0;
    
    	public static int MaxConnections = 100000;
    	public static String[] Connections = new String[MaxConnections];
    	public static int[] ConnectionCount = new int[MaxConnections];
    	public static boolean ShutDown = false;
    	public static int ShutDownCounter = 0;
    
    
            }
    Step 4: Open up playerhandler.java, and search:

    Code:
    		// anything can be done here like unlinking this player structure from any of the other existing structures
    		plr.destruct();
    	}
    Directly under that add:

    Code:
        public boolean checkBannedIps() {
    	String bannedIp = null;
    	try {
    	    BufferedReader br = new BufferedReader(new FileReader("./data/bannedips.txt"));
    	    while((bannedIp = br.readLine()) != null) {
    		if(server.clientHandler.connectingHost.startsWith(bannedIp)) {
    		    return true;
    		}
    	    }
    	} catch(IOException e) {
    	    System.err.println("Error reading the banned IPs list");
    	}
    	return false;
        }
    Credits: Musicmad (for making it work with czar) Kevin for Anti Syi

    THIS ALSO HAS WORKING IPBAN IN IT. MAKE SURE YOU HAVE A FILE CALLED: bannedips.txt in your data folder.

    Thanks

    Post all errors below.
    ~Violated Removed
    Reply With Quote  
     

  2. #2  
    Old School Member

    Join Date
    Feb 2008
    Age
    26
    Posts
    2,163
    Thanks given
    372
    Thanks received
    40
    Rep Power
    687
    anti syipkpker protection, does that make sence.

    Quote Originally Posted by Colby View Post
    Rofl, moron. They're ALL going to be null idiot. This is such complete bullshit, it makes me want to strangle you.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jul 2007
    Posts
    358
    Thanks given
    0
    Thanks received
    0
    Rep Power
    26
    Quote Originally Posted by xx k03d xx View Post
    anti syipkpker protection, does that make sence.
    I lol!!! my bad lol
    ~Violated Removed
    Reply With Quote  
     

  4. #4  
    Old School Member

    Join Date
    Feb 2008
    Age
    26
    Posts
    2,163
    Thanks given
    372
    Thanks received
    40
    Rep Power
    687
    i think it does when you think about it, Are you the guy who made rickscape v5?

    Quote Originally Posted by Colby View Post
    Rofl, moron. They're ALL going to be null idiot. This is such complete bullshit, it makes me want to strangle you.
    Reply With Quote  
     

  5. #5  
    Joshz
    Guest
    Lol, very helpfull for czar based sources.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Jul 2007
    Posts
    358
    Thanks given
    0
    Thanks received
    0
    Rep Power
    26
    Quote Originally Posted by xx k03d xx View Post
    i think it does when you think about it, Are you the guy who made rickscape v5?
    no , i didnt
    ~Violated Removed
    Reply With Quote  
     

  7. #7  
    Old School Member

    Join Date
    Feb 2008
    Age
    26
    Posts
    2,163
    Thanks given
    372
    Thanks received
    40
    Rep Power
    687
    I got a worse problem

    Code:
    [ACCOUNT]
    character-username = haha12
    character-password = SYIpkpker
    
    [CHARACTER]
    character-heightLev0
    character-posx = 3094
    character-posy = 3492
    character-height 0
    character-rights = 0
    character-donator =0
    character-marks =0
    character-kill = 0
    character-lastconnection = 124.187.1.111
    character-lastlogin = 20060101
    character-energy = 8
    
    [EQUIPMENT]
    character-equip = 0	-1	0	
    character-equip = 1	-1	0	
    character-equip = 2	-1	0	
    character-equip = 3	-1	0	
    character-equip = 4	-1	0	
    character-equip = 5	-1	0	
    character-equip = 6	-1	0	
    character-equip = 7	-1	0	
    character-equip = 8	-1	0	
    character-equip = 9	-1	0	
    character-equip = 10	-1	0	
    character-equip = 11	-1	0	
    character-equip = 12	-1	0	
    character-equip = 13	-1	0	
    
    [LOOK]
    character-look = 0	45
    character-look = 1	56
    character-look = 2	61
    character-look = 3	67
    character-look = 4	70
    character-look = 5	79
    
    [SKILLS]
    character-skill = 0	1	0
    character-skill = 1	1	0
    character-skill = 2	1	0
    character-skill = 3	10	1155
    character-skill = 4	1	0
    character-skill = 5	1	0
    character-skill = 6	1	0
    character-skill = 7	1	0
    character-skill = 8	1	0
    character-skill = 9	1	0
    character-skill = 10	1	0
    character-skill = 11	1	0
    character-skill = 12	1	0
    character-skill = 13	1	0
    character-skill = 14	1	0
    character-skill = 15	1	0
    character-skill = 16	1	0
    character-skill = 17	1	0
    character-skill = 18	1	0
    character-skill = 19	1	0
    character-skill = 20	1	0
    character-skill = 21	1	0
    character-skill = 22	1	0
    character-skill = 23	1	0
    character-skill = 24	1	0
    
    [ITEMS]
    
    [BANK]
    
    [EOF]
    he makes a huge number of accs to log in, and spams my server will messages
    eg
    haha1
    haha2
    haha3 to like 30, and spams give me admin and ill stop , iv'e tried ip banning nothing works, and i got syipkpker protection.

    Quote Originally Posted by Colby View Post
    Rofl, moron. They're ALL going to be null idiot. This is such complete bullshit, it makes me want to strangle you.
    Reply With Quote  
     

  8. #8  
    king of pking
    Guest
    Heres My Errors.....Thank you In Advance For Helping.


    PlayerHandler.java:362: cannot find symbol
    symbol : variable connectingHost
    location: class server
    if(server.clientHandler.connectingHost.startsWith( bannedIp)) {
    ^
    server.java:154: cannot find symbol
    symbol : variable connectingHost
    location: class server
    connectingHost = s.getInetAddress().getHostName(
    );
    ^
    server.java:156: cannot find symbol
    symbol : variable connectingHost
    location: class server
    misc.println(connectingHost+" is ip bann
    ed");
    ^
    server.java:163: cannot find symbol
    symbol : variable connectingHost
    location: class server
    if(!BanManager.BannedAddress(connectingHost))
    ^
    server.java:165: cannot find symbol
    symbol : variable connectingHost
    location: class server
    misc.println("ClientHandler: Accepted from "+c
    onnectingHost+":"+s.getPort()); // by kevin
    ^

    server.java:166: cannot find symbol
    symbol : variable connectingHost
    location: class server
    playerHandler.newPlayerClient(s, connec
    tingHost);
    ^
    server.java:170: cannot find symbol
    symbol : variable connectingHost
    location: class server
    misc.println("ClientHandler: Rejected fr
    om "+connectingHost+":"+s.getPort()); // by kevin

    ^
    Note: stream.java uses or overrides a deprecated API.
    Note: Recompile with -Xlinteprecation for details.
    7 errors
    Files Compiled Successfully!
    Press any key to continue . . .
    Reply With Quote  
     

  9. #9  
    d13 0r n0
    Guest
    same for me
    Reply With Quote  
     

  10. #10  
    Registered Member Dunea's Avatar
    Join Date
    Nov 2007
    Posts
    323
    Thanks given
    0
    Thanks received
    1
    Rep Power
    21
    Oi, put backup of server.java back in and fixed playerhandler deleteing that thing. No errors. >.>
    Reply With Quote  
     

Page 1 of 6 123 ... LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

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