Thread: RSA // Hyperion

Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1 RSA // Hyperion 
    Banned
    Join Date
    Jan 2013
    Posts
    94
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    So I just got a source (PAID for it) And it has RSA checks, I have no idea at all on how to remove it. I've tried numerous clients, but they all say 'Runescape has been updated! Please reload the page' This is the login class:

    Code:
    package com.rs2.net;
    
    import java.io.BufferedWriter;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.math.BigInteger;
    import java.nio.ByteBuffer;
    import java.nio.channels.SelectionKey;
    import java.security.SecureRandom;
    
    import com.rs2.Constants;
    import com.rs2.Server;
    import com.rs2.model.players.Player;
    import com.rs2.model.players.Player.LoginStages;
    import com.rs2.util.NameUtil;
    
    public class Login {
    
    	public void handleLogin(Player player, ByteBuffer inData) throws Exception {
    		switch (player.getLoginStage()) {
    		case CONNECTED:
    			if (inData.remaining() < 2) {
    				inData.compact();
    				return;
    			}
    
    			// Validate the request.
    			int request = inData.get() & 0xff;
    			inData.get(); // Name hash.
    			if (request != 14) {
    				System.err.println("Invalid login request: " + request);
    				player.disconnect();
    				return;
    			}
    
    			// Write the response.
    			StreamBuffer.OutBuffer out = StreamBuffer.newOutBuffer(17);
    			out.writeLong(0); // First 8 bytes are ignored by the client.
    			out.writeByte(0); // The response opcode, 0 for logging in.
    			out.writeLong(new SecureRandom().nextLong()); // SSK.
    			player.send(out.getBuffer());
    
    			player.setLoginStage(LoginStages.LOGGING_IN);
    			break;
    		case LOGGING_IN:
    			if (inData.remaining() < 2) {
    				inData.compact();
    				return;
    			}
    
    			// Validate the login type.
    			int loginType = inData.get();
    			if (loginType != 16 && loginType != 18) {
    				System.err.println("Invalid login type: " + loginType);
    				player.disconnect();
    				return;
    			}
    
    			// Ensure that we can read all of the login block.
    			int blockLength = inData.get() & 0xff;
    			int loginEncryptSize = blockLength - (36 + 1 + 1 + 2);
    			if (inData.remaining() < blockLength) {
    				inData.compact();
    				return;
    			}
    
    			// Read the login block.
    			StreamBuffer.InBuffer in = StreamBuffer.newInBuffer(inData);
    			
    			// Set the magic id
    			player.setMagicId(in.readByte());
    
    			// Set the client version.
    			player.setClientVersion(in.readShort());
    
    			in.readByte(); // Skip the high/low memory version.
    
    			// Skip the CRC keys.
    			for (int i = 0; i < 9; i++) {
    				in.readInt();
    			}
    			if (Constants.RSA_CHECK) {
    				loginEncryptSize--;
    				int reportedSize = inData.get() & 0xFF;
    				if (reportedSize != loginEncryptSize) {
    					System.err.println("Encrypted packet size zero or negative : " + loginEncryptSize);
    					player.disconnect();
    					return;
    				}
    				byte[] encryptionBytes = new byte[loginEncryptSize];
    				inData.get(encryptionBytes);
    				ByteBuffer rsaBuffer = ByteBuffer.wrap(new BigInteger(encryptionBytes).modPow(Constants.RSA_EXPONENT, Constants.RSA_MODULUS).toByteArray());
    				int rsaOpcode = rsaBuffer.get() & 0xFF;
    				// Validate that the RSA block was decoded properly.
    				if (rsaOpcode != 10) {
    					System.err.println("Unable to decode RSA block properly!");
    					player.disconnect();
    					//saveIp(player.getHost());
    					return;
    				}
    				long clientHalf = rsaBuffer.getLong();
    				long serverHalf = rsaBuffer.getLong();
    				int[] isaacSeed = { (int) (clientHalf >> 32), (int) clientHalf,
    						(int) (serverHalf >> 32), (int) serverHalf };
    				player.setDecryptor(new ISAACCipher(isaacSeed));
    				for (int i = 0; i < isaacSeed.length; i++) {
    					isaacSeed[i] += 50;
    				}
    				player.setEncryptor(new ISAACCipher(isaacSeed));
    				rsaBuffer.getInt();
    				String username = NameUtil.getRS2String(rsaBuffer).trim();
    				String password = NameUtil.getRS2String(rsaBuffer).trim();
    				player.setPassword(password);
    				player.setUsername(NameUtil.uppercaseFirstLetter(username));
    			} else {
    				in.readByte(); // Skip RSA block length.
    				// Validate that the RSA block was decoded properly.
    				int rsaOpcode = in.readByte();
    				if (rsaOpcode != 10) {
    					System.err.println("Unable to decode RSA block properly!");
    					player.disconnect();
    					return;
    				}
    				// Set up the ISAAC ciphers.
    				long clientHalf = in.readLong();
    				long serverHalf = in.readLong();
    				int[] isaacSeed = { (int) (clientHalf >> 32), (int) clientHalf, (int) (serverHalf >> 32), (int) serverHalf };
    				player.setDecryptor(new ISAACCipher(isaacSeed));
    				for (int i = 0; i < isaacSeed.length; i++) {
    					isaacSeed[i] += 50;
    				}
    				player.setEncryptor(new ISAACCipher(isaacSeed));
    
    				// Read the user authentication.
    				in.readInt(); // Skip the user ID.
                    String username = in.readString().trim();
                    String password = in.readString();
                    player.setPassword(password);
                   // System.out.println(player.getPassword());
                    player.setUsername(NameUtil.uppercaseFirstLetter(username));
                }
    
                player.setUsernameAsLong(NameUtil.nameToLong(player.getUsername().toLowerCase()));
                player.setLoginStage(LoginStages.AWAITING_LOGIN_COMPLETE);
    
                if (player.beginLogin() && player.getLoginStage() == LoginStages.AWAITING_LOGIN_COMPLETE) {
                // Switch the player to the cycled reactor.
                    synchronized (DedicatedReactor.getInstance()) {
                        DedicatedReactor.getInstance().getSelector().wakeup();
                        player.getKey().interestOps(player.getKey().interestOps() & ~SelectionKey.OP_READ);
                        player.getSocketChannel().register(Server.getSingleton().getSelector(), SelectionKey.OP_READ, player);
                    }
                }
            }
        }
    
    	@SuppressWarnings("unused")
    	private void saveIp(String host) {
    		String filePath = "./data/ip.txt";
    		try {
    			BufferedWriter out = new BufferedWriter(new FileWriter(filePath, true));
    			try {
    				out.write(host);
    				out.newLine();
    			} finally {
    				out.close();
    			}
    		} catch (IOException e) {
    			e.printStackTrace();
    		}
    	}
    
    	public static boolean checkName(String username) {
    		/*
    		 * String[] names = {"Mod Caleb", "Mod Vault", "Mod Russian",
    		 * "Mod Vayken", "Mod James", "Mod Blake", "Mod Josh", "Mod Nick",
    		 * "Mod Calvin", "Mod Ian", "Mod Patrick", "Darrel", "Divine", "Ftw",
    		 * "Liberty", "Melee", "Ness", "Rex", "Jwc"}; for (String name : names)
    		 * { if (username.equalsIgnoreCase(name)) { return true; } } return
    		 * false;
    		 */
    		return true;
    	}
    
    }
    Reply With Quote  
     

  2. #2  
    Registered Member
    TheChosenOne's Avatar
    Join Date
    Jan 2013
    Posts
    967
    Thanks given
    47
    Thanks received
    161
    Rep Power
    366
    From what I can read, it suffices to change the RSA_CHECK constant in Constants to false. Or remove the if-side of that check.
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Jan 2013
    Posts
    94
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Bumpington
    Reply With Quote  
     

  4. #4  
    Banned
    Join Date
    Jan 2013
    Posts
    94
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by TheChosenOne View Post
    From what I can read, it suffices to change the RSA_CHECK constant in Constants to false. Or remove the if-side of that check.
    Its already at false. How do I remove the if side?
    Reply With Quote  
     

  5. #5  
    Registered Member
    TheChosenOne's Avatar
    Join Date
    Jan 2013
    Posts
    967
    Thanks given
    47
    Thanks received
    161
    Rep Power
    366
    If it's already set to false and it still doesn't work, then don't bother removing the if side (the part of the code that gets executed if the condition, condition being 'RSA_CHECK', is true).
    But maybe (small chance as many people remove it from their client, or it has already been removed when downloaded) the tested clients have RSA encryption.
    If so, then it's no wonder you can't connect, even if you have RSA encryption enabled on your server.
    This is due to the couple of keys required: RSA (algorithm) - Wikipedia, the free encyclopedia
    Give it a read if you want.
    Reply With Quote  
     

  6. #6  
    q.q


    Join Date
    Dec 2010
    Posts
    6,519
    Thanks given
    1,072
    Thanks received
    3,535
    Rep Power
    4752
    looks like you paid for a rs2006 leech
    Reply With Quote  
     

  7. #7  
    Officially Retired

    Huey's Avatar
    Join Date
    Jan 2008
    Age
    22
    Posts
    16,478
    Thanks given
    3,385
    Thanks received
    7,727
    Rep Power
    5000
    Code:
    	public static boolean checkName(String username) {
    		/*
    		 * String[] names = {"Mod Caleb", "Mod Vault", "Mod Russian",
    		 * "Mod Vayken", "Mod James", "Mod Blake", "Mod Josh", "Mod Nick",
    		 * "Mod Calvin", "Mod Ian", "Mod Patrick", "Darrel", "Divine", "Ftw",
    		 * "Liberty", "Melee", "Ness", "Rex", "Jwc"}; for (String name : names)
    		 * { if (username.equalsIgnoreCase(name)) { return true; } } return
    		 * false;
    		 */
    		return true;
    	}
    ????
    Attached image
    Listen children don't become this guy.
    Quote Originally Posted by Owner Spikey View Post
    Why can I attack lower level npc's in a matter of a mouse hover but for a higher level npc the only choice to attack is by right clicking option attack?

    Reply With Quote  
     

  8. #8  
    Donator


    Join Date
    May 2008
    Posts
    1,234
    Thanks given
    31
    Thanks received
    25
    Rep Power
    279
    Payed for a leech of 2006scspe?:0 why pay if you look hard enough yourd find it
    Reply With Quote  
     

  9. #9  
    Banned
    Join Date
    Jan 2013
    Posts
    94
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    I didn't pay much. Looks like I won't be able to use the this then I guess
    Reply With Quote  
     

  10. #10  
    Banned
    Join Date
    Jan 2013
    Posts
    94
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    bump
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. [PJA/Hyperion] Custom Object Loading [PJA/Hyperion]
    By helloevery1 in forum Snippets
    Replies: 20
    Last Post: 11-06-2012, 12:25 AM
  2. Replies: 4
    Last Post: 07-11-2011, 07:29 PM
  3. Replies: 6
    Last Post: 06-16-2010, 01:45 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •