multiple rotation packets of equal Value

Discussion in 'Spigot Plugin Development' started by Nort721, Feb 7, 2018.

  1. KillAura detection
    hi guys, so I want to try to check: Sending multiple rotation packets of equal value, now I know how to listen to packets with protocolLib.
    my idea is to save in HashMap the last rotation packet for every player, and every time to compare its value with the new packet that has been sent. but I don't really know what PacketType to listen to get the rotation packets values
    Code:

    Code (Text):

        public void packetsCheck() {
            protocolManager.addPacketListener(new PacketAdapter(this,
                    ListenerPriority.NORMAL,
                    PacketType.Play.Client.?) {
                [USER=32110]@Override[/USER]
                public void onPacketReceiving(PacketEvent e) {
                    if (e.getPacketType() == PacketType.Play.Client.?) {
                        PacketContainer p = e.getPacket();
                        if (p.equals(LastRotationPacket)) {
                            // punish or count Violation
                        }
                        e.setCancelled(true);
                    }
                }
            });
        }
     
    sorry if this is a dumb question, the only thing I have done with protocolLib right now is to replace bad words in chat so i don't really use this library much but I will be happy to learn
     
  2. come on guys there is must be someone that knows how to do that
     
  3. http://wiki.vg/Protocol#Player_Look
    and
    http://wiki.vg/Protocol#Player_Position_And_Look_.28serverbound.29

    EDIT: Also note that this will most likely not detect KillAura; I highly doubt that KillAura just sends repeated packets like that. SPECULATION: Hacked clients call methods in the Minecraft code to update the player's orientation in a similar manner to the mouse; if the orientation does not change, the packet is not sent.
     
  4. Just tested, I was curious and killaura is easy to detect :) (I do not know with other cheat, I tried with liquindbounce 1.9.4
    My code:
    Code (Text):
     ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this,
                    ListenerPriority.NORMAL, PacketType.Play.Server.ENTITY_HEAD_ROTATION) {

                @Override
                public void onPacketSending(PacketEvent event) {


                    if(event.getPacket().getType() == PacketType.Play.Server.ENTITY_HEAD_ROTATION) {
                        byte b = event.getPacket().getBytes().read(0);
                        System.out.println("theory head rotation = " + b);
                        System.out.println("real head rotation = " + event.getPlayer().getLocation().getYaw());
                    }
                }

                @Override
                public void onPacketReceiving(PacketEvent event) {

                }

            });
    The theory head rotation should be the rotation of the player
    and event.getPlayer().getLocation().getYaw() is the real rotation

    Output:
    Code (Text):
    [00:43:08 INFO]: real head rotation = -172.70512
    [00:43:10 INFO]: theory head rotation = -8
    [00:43:10 INFO]: real head rotation = -172.70512
    [00:43:10 INFO]: theory head rotation = -3
    [00:43:10 INFO]: real head rotation = -172.70512
    [00:43:10 INFO]: theory head rotation = -2
    [00:43:10 INFO]: real head rotation = -172.70512
    [00:43:11 INFO]: theory head rotation = -1
    [00:43:11 INFO]: real head rotation = -172.70512
    [00:43:11 INFO]: theory head rotation = -2
    [00:43:11 INFO]: real head rotation = -172.70512
    [00:43:12 INFO]: theory head rotation = -2
    [00:43:12 INFO]: real head rotation = -172.70512
    [00:43:13 INFO]: theory head rotation = -2
    [00:43:13 INFO]: real head rotation = -172.70512
     
    here as you see, the player is not looking at the player while its theoric rotation is not the same.
    so just just check if theory rotation is equal to real rotation if not = killaura
     
  5. Did you test it with a non hacked client, too?

    The whole reason the players yaw and the packets yaw are different here is because the packet hasn't been processed yet. So yes, you do detect KillAura, but you're also detecting every other player's movement ever.
     
  6. You may Have right for the packet processing however I checked if the yaw was the same with the f3
    No problem with other player movement
     
  7. thanks guys, i have i will try your suggestions when i will be home :)
     
  8. Code (Text):


    ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this,
            ListenerPriority.NORMAL, PacketType.Play.Client.POSITION_LOOK, PacketType.Play.Server.ENTITY_HEAD_ROTATION) {

        @Override
        public void onPacketSending(PacketEvent event) {
            if(event.getPacket().getType() == PacketType.Play.Server.ENTITY_HEAD_ROTATION) {
                byte b = event.getPacket().getBytes().read(0);
                Bukkit.broadcastMessage("§ctheory head rotation = " + UtilMath.toPackedByte(b));

            }
        }

        @Override
        public void onPacketReceiving(PacketEvent event) {
            if(event.getPacket().getType() == PacketType.Play.Client.POSITION_LOOK) {
                float b = event.getPacket().getFloat().read(0);
                Bukkit.broadcastMessage(event.getPlayer().getName());
                Bukkit.broadcastMessage("§btheory head rotation = " + UtilMath.toPackedByte(b));
                Bukkit.broadcastMessage("§2real head rot: " + UtilMath.toPackedByte(event.getPlayer().getLocation().getYaw()));
            }
        }

    });
         
    So, I tried this, and not good news, the client is able to send real yaw everywhere.
    In fact, the yaw of the cheater should be equal to 90 but it's -90 and everywhere: packet, nms yaw, bukkit yaw ect
    As you can see, the cheter is looking 90 degrees, and the other player see the cheater looking at him (should be -90)

    [​IMG]
     
  9. yes I forgot to mention this here, I have tested the that and it was not working well

    do someone have a better idea how to check Equal Rotations,
    btw it will not detect killaura but i will do help to detect other cheats
     
  10. I think that "kill aura" is an aura, it means that even if you have 2 players around you it will hit 2 players !
    Here is the fail, the aura should send a big yaw rotation, just check different distances between yaws
     
  11. Wouldn't a lag spike also cause a large yaw rotation? It's hard to detect this in this manner without false positives.
     
  12. Yes right again ;), however, we're nearest, check player ping + frequency and start check when the player pvp, is a way to reduce false positive.
    A good anticheat can take around 10mn to detect cheater.
    The new method seems to be machine learning.
     
  13. I would suggest you one thing, quit this detection. Just debug for 1-second KillAura and for pitch and yaw differences and you will find 1000 detections. Aka what I did and all Auras I tested it on set a count = 14 in just 4 hits when a legit player can BARELY pass 3
     
    • Optimistic Optimistic x 1
  14. Oh also to note, equal rotations will not detect any good Killaura. Todays clients randomize almost everything.
     
    • Creative Creative x 1

Share This Page