Code-x

Code-x Private Server
 
HomeHome  PortalPortal  SearchSearch  RegisterRegister  Log inLog in  

 

 anti nuller

Go down 
AuthorMessage
m33p0rz3r
Global Moderator
Global Moderator
m33p0rz3r

Number of posts : 445
Age : 24
Location : Ohio.
Registration date : 2008-06-04

anti nuller Empty
PostSubject: anti nuller   anti nuller Icon_minitimeThu Aug 21, 2008 12:24 pm

*WARNING* sometimes causes players to log in with blackscreens so you will have to delete accounts.








evil got u anti nuller.










Please Note: This was made in a Project16 source.

Purpose: To block those pesky attackers

Time to complete: 1 minute 11 seconds

Classes Modified: BanManager.java and server.java

Credits: 100% Kevin, 0% Guthan

Procedure:

Create a new java file by the name of "BanManager".

Put this in it:

Quote :
Code:

Code:

import java.util.ArrayList;

public class BanManager
{

// Made by Kevin - google.org

public final static void Initialize()
{
AddName("SYIpkpker");
AddName("SilabSoft");
AddName("runescape");
AddName("thorak");

// AddAddress("127.0.0.1"); // Example Razz
}

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>();
}


That will allow access once by the specified name in the Initialize method.

Now go close and save that class and go to server.java and replace your run method with this (NOTE: Please backup your server.java.):
Code:

Quote :
public void run()
{
try
{
shutdownClientHandler = false;
clientListener = new java.net.ServerSocket(serverlistenerPort, 1, null);
misc.println("NAME OF SERVER HERE");

while(true)
{
java.net.Socket s = clientListener.accept();
s.setTcpNoDelay(true);

String connectingAddress = s.getInetAddress().getHostAddress(); // Hostnames are too long, lets use ips Smile - Kevin - google.org

if(clientListener != null)
{
if(!BanManager.BannedAddress(connectingAddress)) // Is ip banned? - Kevin - google.org
{
misc.println("ClientHandler: Accepted from "+connectingAddress+":"+s.getPort());
playerHandler.newPlayerClient(s, connectingAddress);
}
else
{
misc.println("ClientHandler: Rejected from "+connectingAddress+":"+s.getPort());
s.close(); // Ip is banned, lets simply refuse the connection - Kevin - google.org
}
}
}
} 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.");
}
}
}

While still in server.java, under this:
Code:

int waitFails = 0;
long lastTicks = System.currentTimeMillis();
long totalTimeSpentProcessing = 0;
int cycle = 0;


Put this:
Code:

BanManager.Initialize(); // Initialize Kevin's BanManager - google.org

Save and close server.java and go to client.java, under this:
Code:

Quote :
playerName = inStream.readString();
playerName.toLowerCase();
if(playerName == null || playerName.length() == 0)
disconnected = true;


Put this:
Code:

Quote :
if(BanManager.BannedName(playerName)) // Is username illegal or banned? - Kevin - google.org
{
BanManager.AddAddress(connectedFrom); // Ban the bad user - Kevin - google.org
disconnected = true;
return;
}


And then do this


Code:
Quote :
import java.net.*;



2. Add this somewhere in server.java

Code:
Quote :
public Socket acceptSocketSafe(ServerSocket x) { //Anti-nuller by Slysoft
boolean socketFound = false;
Socket s = null;
do {
try {
s = x.accept();
int i = s.getInputStream().read();
if ((i & 0xFF) == 14) {
socketFound = true;
}
} catch (Exception e) {
}
} while (!socketFound);

return s;
}


3. Replace

Code:
Quote :
java.net.Socket s = clientListener.accept();



with

Code:
Quote :
java.net.Socket s = acceptSocketSafe(clientListener);


4. Open client.java, and replace

Code:
Quote :
fillInStream(2);
if(inStream.readUnsignedByte() != 14) {
shutdownError("Expected login Id 14 from client.");
disconnected = true;
return;
}


with

Code:
Quote :
fillInStream(1); //Anti-nuller by Slysoft


Last edited by m33p0rz3r on Thu Aug 21, 2008 12:36 pm; edited 1 time in total
Back to top Go down
http://www.GamersChoice.darkbb.com
Sarchua
Admin
Admin
Sarchua

Number of posts : 244
Age : 24
Registration date : 2008-06-04

anti nuller Empty
PostSubject: Re: anti nuller   anti nuller Icon_minitimeThu Aug 21, 2008 12:29 pm

evil needed this Razz
Back to top Go down
Evil Mage
Admin
Admin
Evil Mage

Number of posts : 432
Age : 28
Registration date : 2008-05-08

anti nuller Empty
PostSubject: Re: anti nuller   anti nuller Icon_minitimeThu Aug 21, 2008 1:01 pm

this causes people to log in with black screens??? or the nulls do?? reply asap befor ei add this 1
Back to top Go down
m33p0rz3r
Global Moderator
Global Moderator
m33p0rz3r

Number of posts : 445
Age : 24
Location : Ohio.
Registration date : 2008-06-04

anti nuller Empty
PostSubject: Re: anti nuller   anti nuller Icon_minitimeThu Aug 21, 2008 1:03 pm

sorry ill find another 1


Quote :
users have been getting black screens when they log in.
Back to top Go down
http://www.GamersChoice.darkbb.com
Evil Mage
Admin
Admin
Evil Mage

Number of posts : 432
Age : 28
Registration date : 2008-05-08

anti nuller Empty
PostSubject: Re: anti nuller   anti nuller Icon_minitimeThu Aug 21, 2008 1:57 pm

thsi si fine aslong as it dosnt caurse that problem. cos people have been getting black screens
Back to top Go down
m33p0rz3r
Global Moderator
Global Moderator
m33p0rz3r

Number of posts : 445
Age : 24
Location : Ohio.
Registration date : 2008-06-04

anti nuller Empty
PostSubject: Re: anti nuller   anti nuller Icon_minitimeThu Aug 21, 2008 3:39 pm

thats from the site i found it on.
Back to top Go down
http://www.GamersChoice.darkbb.com
Sponsored content




anti nuller Empty
PostSubject: Re: anti nuller   anti nuller Icon_minitime

Back to top Go down
 
anti nuller
Back to top 
Page 1 of 1
 Similar topics
-
» I would like to know which pet are better now.
» Openingbook testing part 2
» Anti-engine's book
» Anti-Bajonete-Attack in the King's Indian by Mihail Marin
» A dangerous Anti-Sicilian: 1.e4 c5 2.Nf3 e6 3.g3! in 60 mins by Andrew Martin

Permissions in this forum:You cannot reply to topics in this forum
Code-x :: General Chat :: runescape private [TUT] section-
Jump to: