Sanitized sentinel NBT honeypot

Refactors are to better utilize Adventure API
Removed Anti-Backdoor. May add it back when I can find a system that isn't trivial to bypass. Extras have been improved and now have their own system.
This commit is contained in:
2025-06-16 17:53:41 -05:00
parent 9c2d34829c
commit fc7d4de129
245 changed files with 4437 additions and 3029 deletions

Binary file not shown.

Binary file not shown.

1
.idea/gradle.xml generated
View File

@@ -13,5 +13,6 @@
</option> </option>
</GradleProjectSettings> </GradleProjectSettings>
</option> </option>
<option name="offlineMode" value="true" />
</component> </component>
</project> </project>

View File

@@ -4,6 +4,7 @@ import java.nio.file.Paths
plugins { plugins {
id 'java' id 'java'
id 'com.gradleup.shadow' version '9.0.0-beta10' id 'com.gradleup.shadow' version '9.0.0-beta10'
id("xyz.jpenilla.run-paper") version "2.3.1"
} }
group = project.group group = project.group
@@ -47,17 +48,16 @@ repositories {
dependencies { dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:5.11.0") testImplementation("org.junit.jupiter:junit-jupiter-api:5.11.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.11.0") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.11.0")
compileOnly "io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT" compileOnly "io.papermc.paper:paper-api:1.21.5-R0.1-SNAPSHOT"
implementation 'com.google.code.gson:gson:2.10.1' implementation 'com.google.code.gson:gson:2.10.1'
implementation 'org.ow2.asm:asm-commons:9.5' implementation 'org.ow2.asm:asm-commons:9.5'
implementation files("libs/PDK-1.4.0.jar") implementation files("libs/PDK-1.4.0.jar")
compileOnly 'com.github.koca2000:NoteBlockAPI:1.6.3' implementation "com.github.retrooper:packetevents-spigot:2.8.0"
implementation "com.github.retrooper:packetevents-spigot:2.7.0" implementation("de.tr7zw:item-nbt-api:2.15.0")
implementation("de.tr7zw:item-nbt-api:2.14.1")
} }
static def generateBuildId() { static def generateBuildId() {
return new Date().format('HH:mm:ss') return new Date().format('HH:mm:ss dd/MM/yyyy')
} }
processResources { processResources {
@@ -69,99 +69,46 @@ processResources {
} }
} }
task cleanPluginYml {
doLast {
def jarFile = shadowJar.archiveFile.get().asFile
def tempDir = file("$buildDir/tmpCleanJar")
tempDir.mkdirs()
// Unpack the jar into a temporary directory
copy {
from zipTree(jarFile)
into tempDir
}
// Delete any plugin.yml files from anywhere in the unpacked directory
fileTree(tempDir).matching {
include '**/plugin.yml'
}.each { file ->
file.delete()
}
// Repackage the jar without the plugin.yml files
ant.zip(destfile: jarFile, basedir: tempDir)
delete tempDir
}
}
task injectPluginYml {
doLast {
def jarFile = shadowJar.archiveFile.get().asFile
def tempDir = file("$buildDir/tmpJar")
tempDir.mkdirs()
// Unpack the jar that has been cleaned
copy {
from zipTree(jarFile)
into tempDir
}
// Copy the already filtered plugin.yml from processed resources
copy {
from file("$buildDir/resources/main/plugin.yml")
into tempDir
}
// Repackage the jar with the updated contents
ant.zip(destfile: jarFile, basedir: tempDir)
delete tempDir
}
}
shadowJar { shadowJar {
archiveClassifier.set('') archiveClassifier.set('')
minimize() minimize()
mergeServiceFiles() mergeServiceFiles()
exclude 'plugin.yml' filesMatching('**/plugin.yml') { fileCopyDetails ->
def content = fileCopyDetails.file.text
def lines = content.split('\n')
if (lines.length == 0 || !lines[0].trim().equals('name: SentinelAntiNuke')) {
fileCopyDetails.exclude()
}
}
relocate("com.github.retrooper.packetevents", "me.trouper.sentinel.packetevents.api") relocate("com.github.retrooper.packetevents", "me.trouper.sentinel.packetevents.api")
relocate("io.github.retrooper.packetevents", "me.trouper.sentinel.packetevents.impl") relocate("io.github.retrooper.packetevents", "me.trouper.sentinel.packetevents.impl")
relocate("de.tr7zw.changeme.nbtapi", "me.trouper.sentinel.nbtapi.api") relocate("de.tr7zw.changeme.nbtapi", "me.trouper.sentinel.nbtapi.api")
} }
task copyLibs { task copyLibs {
doLast { doLast {
// Define the source directory (Gradle cache) and the target directory def sourceDir = Paths.get("${System.getProperty('user.home')}/.gradle/caches/modules-2/files-2.1")
def sourceDir = Paths.get("C:/Users/crvic/.gradle/caches/modules-2/files-2.1") def targetDir = Paths.get("${buildDir}/../deps")
def targetDir = Paths.get("${buildDir}/../deps") // Output directory
// Create the target directory if it doesn't exist
if (!Files.exists(targetDir)) { if (!Files.exists(targetDir)) {
Files.createDirectories(targetDir) Files.createDirectories(targetDir)
} }
// Recursively traverse the source directory and copy JAR files
Files.walk(sourceDir) Files.walk(sourceDir)
.filter { Files.isRegularFile(it) && it.toString().endsWith(".jar") } .filter { Files.isRegularFile(it) && it.toString().endsWith(".jar") }
.forEach { jarFile -> .forEach { jarFile ->
// Extract the file name (without the directory structure)
def fileName = jarFile.fileName.toString() def fileName = jarFile.fileName.toString()
// Define the target file path (flat structure)
def targetFile = targetDir.resolve(fileName) def targetFile = targetDir.resolve(fileName)
// Handle duplicate file names (if any)
if (Files.exists(targetFile)) { if (Files.exists(targetFile)) {
println "Skipping duplicate file: ${fileName}" println "Skipping duplicate file: ${fileName}"
return return
} }
// Copy the JAR file to the target directory
Files.copy(jarFile, targetFile) Files.copy(jarFile, targetFile)
println "Copied: ${jarFile} -> ${targetFile}" println "Copied: ${jarFile} -> ${targetFile}"
} }
@@ -171,32 +118,30 @@ task copyLibs {
} }
task obfuscate(type: JavaExec) { task obfuscate(type: JavaExec) {
// Path to the obfuscator JAR
classpath = files('obf/grunt-main.jar') classpath = files('obf/grunt-main.jar')
// Arguments to pass to the obfuscator (e.g., input and output directories)
args = [ args = [
'--config', 'obf/config.json' '--config', 'obf/config.json'
] ]
} }
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion options.release = targetJavaVersion
} }
} }
compileJava.options.encoding("UTF-8")
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
test { test {
useJUnitPlatform() useJUnitPlatform()
} }
build { build {
dependsOn(shadowJar) dependsOn(shadowJar)
dependsOn injectPluginYml }
tasks {
runServer {
dependsOn(shadowJar)
minecraftVersion("1.21.5")
}
} }

368
config.json Normal file
View File

@@ -0,0 +1,368 @@
{
"Settings": {
"Input": "./build/libs/Sentinel-1.0.0.jar",
"Output": "./build/libs/Sentinel-1.0.0-alfa.jar",
"Libraries": [
"./deps"
],
"Exclusions": [
"com/",
"io/",
"me/trouper/sentinel/data/",
"me/trouper/sentinel/packetevents/",
"me/trouper/sentinel/nbtapi/",
"org/",
"net/",
"module-info"
],
"MixinPackage": [
"net/spartanb312/client/mixins/"
],
"DumpMappings": false,
"Multithreading": true,
"PrintTimeUsage": true,
"ForceUseComputeMax": false,
"LibsMissingCheck": true,
"CustomDictionaryFile": "./obf/dictionary.txt",
"DictionaryStartIndex": 0,
"CorruptOutput": false,
"FileRemovePrefix": [],
"FileRemoveSuffix": []
},
"UI": {
"DarkTheme": true
},
"SourceDebugRemove": {
"Enabled": true,
"SourceDebug": true,
"LineDebug": true,
"RenameSourceDebug": true,
"SourceNames": [
"AhAhAhYouDidntSayTheMagicWord.java",
"SentinelIsClosedSource.java",
"YourHonor-FreeBirdWasPlaying.kt",
"Officer-IDropKickedThatChildInSelfDefense.kt",
"NotTheBees.java",
"Youve-been-trolled.java",
"tuco-get-out.mp3.kt"
],
"Exclusion": []
},
"Shrinking": {
"Enabled": true,
"RemoveInnerClass": true,
"RemoveUnusedLabel": true,
"RemoveNOP": false,
"AnnotationRemovals": [
"Ljava/lang/Override;"
],
"Exclusion": []
},
"KotlinOptimizer": {
"Enabled": false,
"Annotations": true,
"Intrinsics": true,
"IntrinsicsRemoval": [
"checkExpressionValueIsNotNull",
"checkNotNullExpressionValue",
"checkReturnedValueIsNotNull",
"checkFieldIsNotNull",
"checkParameterIsNotNull",
"checkNotNullParameter"
],
"ReplaceLdc": true,
"IntrinsicsExclusion": [],
"MetadataExclusion": []
},
"EnumOptimize": {
"Enabled": false,
"Exclusion": []
},
"DeadCodeRemove": {
"Enabled": false,
"Exclusion": []
},
"ClonedClass": {
"Enabled": false,
"Count": 2048,
"Suffix": "-on-top",
"RemoveAnnotations": true,
"Exclusion": []
},
"TrashClass": {
"Enabled": false,
"Package": "sentinel/",
"Prefix": "NUKE_",
"Count": 2048
},
"HWIDAuthentication": {
"Enabled": false,
"OnlineMode": true,
"OfflineHWID": [
"Put HWID here (For offline mode only)"
],
"OnlineURL": "https://pastebin.com/XXXXX",
"EncryptKey": "1186118611861186",
"CachePools": 5,
"ShowHWIDWhenFailed": true,
"EncryptConst": true,
"Exclusion": []
},
"HideDeclaredFields": {
"Enabled": false,
"Exclusion": []
},
"ReflectionSupport": {
"Enabled": false,
"PrintLog": true,
"Class": true,
"Method": true,
"Field": true
},
"StringEncrypt": {
"Enabled": true,
"Arrayed": false,
"ReplaceInvokeDynamics": true,
"Exclusion": []
},
"NumberEncrypt": {
"Enabled": true,
"Intensity": 1,
"FloatingPoint": true,
"Arrayed": false,
"MaxInsnSize": 16384,
"Exclusion": []
},
"ArithmeticEncrypt": {
"Enabled": true,
"Intensity": 1,
"MaxInsnSize": 16384,
"Exclusion": []
},
"Controlflow": {
"Enabled": true,
"Intensity": 1,
"ExecuteBeforeEncrypt": false,
"SwitchExtractor": true,
"ExtractRate": 25,
"BogusConditionJump": true,
"GotoReplaceRate": 50,
"MangledCompareJump": true,
"IfReplaceRate": 48,
"IfICompareReplaceRate": 25,
"SwitchProtect": true,
"ProtectRate": 30,
"TableSwitchJump": true,
"MutateJumps": true,
"MutateRate": 10,
"SwitchReplaceRate": 30,
"MaxSwitchCase": 5,
"ReverseExistedIf": true,
"ReverseChance": 50,
"TrappedSwitchCase": true,
"TrapChance": 25,
"ArithmeticExprBuilder": true,
"BuilderIntensity": 1,
"JunkBuilderParameter": true,
"BuilderNativeAnnotation": false,
"UseLocalVar": true,
"JunkCode": true,
"MaxJunkCode": 2,
"ExpandedJunkCode": true,
"Exclusion": []
},
"ConstBuilder": {
"Enabled": true,
"NumberSwitchBuilder": true,
"SplitLong": true,
"HeavyEncrypt": false,
"SkipControlFlow": true,
"ReplacePercentage": 25,
"MaxCases": 3,
"Exclusion": []
},
"ConstPollEncrypt": {
"Enabled": false,
"Integer": true,
"Long": true,
"Float": true,
"Double": true,
"String": true,
"HeavyEncrypt": false,
"DontScramble": true,
"NativeAnnotation": false,
"Exclusion": []
},
"RedirectStringEquals": {
"Enabled": true,
"IgnoreCase": true,
"Exclusion": []
},
"FieldScramble": {
"Enabled": false,
"Intensity": 1,
"ReplacePercentage": 25,
"RandomName": false,
"GetStatic": true,
"SetStatic": true,
"GetValue": true,
"SetField": true,
"GenerateOuterClass": false,
"NativeAnnotation": false,
"ExcludedClasses": [],
"ExcludedFieldName": []
},
"MethodScramble": {
"Enabled": false,
"ReplacePercentage": 25,
"GenerateOuterClass": true,
"RandomCall": true,
"NativeAnnotation": false,
"ExcludedClasses": [],
"ExcludedMethodName": []
},
"NativeCandidate": {
"Enabled": false,
"NativeAnnotation": "Lnet/spartanb312/example/Native;",
"SearchCandidate": true,
"UpCallLimit": 0,
"Exclusion": [],
"AnnotationGroups": [
"{ \"annotation\": \"Lnet/spartanb312/grunt/Native;\", \"includeRegexes\": [\"^(?:[^./\\\\[;]+/)*[^./\\\\[;]+$\"], \"excludeRegexes\": [] }",
"{ \"annotation\": \"Lnet/spartanb312/grunt/VMProtect;\", \"includeRegexes\": [\"^(?:[^./\\\\[;]+\\\\/)*(?:[^./\\\\[;])+\\\\.(?:[^./\\\\[;()\\\\/])+(?:\\\\(((\\\\[*L[^./\\\\[;]([^./\\\\[;]*[^.\\\\[;][^./\\\\[;])*;)|(\\\\[*[ZBCSIJFD]+))*\\\\))((\\\\[*L[^./\\\\[;]([^./\\\\[;]*[^.\\\\[;][^./\\\\[;])*;)|V|(\\\\[*[ZBCSIJFD]))$\"], \"excludeRegexes\": [] }"
]
},
"SyntheticBridge": {
"Enabled": false,
"Exclusion": [
"do not use this! (All Events will break)"
]
},
"LocalVariableRename": {
"Enabled": true,
"Dictionary": "Custom",
"ThisReference": false,
"DeleteLocalVars": false,
"DeleteParameters": false,
"Exclusion": []
},
"MethodRename": {
"Enabled": true,
"Enums": true,
"Interfaces": false,
"Dictionary": "Custom",
"HeavyOverloads": false,
"RandomKeywordPrefix": false,
"Prefix": "",
"Reversed": false,
"Exclusion": [],
"ExcludedName": []
},
"FieldRename": {
"Enabled": true,
"Dictionary": "Custom",
"RandomKeywordPrefix": false,
"Prefix": "",
"Reversed": false,
"Exclusion": [],
"ExcludedName": [
"INSTANCE",
"Companion"
]
},
"ClassRename": {
"Enabled": true,
"Dictionary": "Custom",
"Parent": "this/is/a/dying/meme/",
"Prefix": "",
"Reversed": false,
"Shuffled": false,
"CorruptedName": false,
"CorruptedNameExclusion": [],
"Exclusion": [
"me/trouper/sentinel/Sentinel"
]
},
"MixinFieldRename": {
"Enabled": false,
"Dictionary": "Alphabet",
"Prefix": "",
"Exclusion": [],
"ExcludedName": [
"INSTANCE",
"Companion"
]
},
"MixinClassRename": {
"Enabled": false,
"Dictionary": "Alphabet",
"TargetMixinPackage": "net/spartanb312/obf/mixins/",
"MixinFile": "mixins.example.json",
"RefmapFile": "mixins.example.refmap.json",
"Exclusion": []
},
"InvokeDynamic": {
"Enabled": true,
"ReplacePercentage": 25,
"HeavyProtection": false,
"MetadataClass": "me/trouper/tuco/getOutMetadata",
"MassiveRandomBlank": true,
"Reobfuscate": false,
"EnhancedFlowReobf": false,
"BSMNativeAnnotation": false,
"Exclusion": []
},
"ShuffleMembers": {
"Enabled": true,
"Methods": true,
"Fields": true,
"Annotations": true,
"Exceptions": true,
"Exclusion": []
},
"Crasher": {
"Enabled": false,
"Random": false,
"Exclusion": []
},
"Watermark": {
"Enabled": true,
"Names": [
"Copyright_SentinelAntiNuke2024",
"obvWolf",
"thetrouper"
],
"Messages": [
"Ah_Ah_Ah_You_Didnt_Say_The_Magic_Word",
"%%__USERNAME__%%",
"%%__USER__%%"
],
"FieldMark": true,
"MethodMark": true,
"AnnotationMark": false,
"Annotations": [
"ProtectedByGrunt",
"JvavMetadata"
],
"Versions": [
"1984"
],
"InterfaceMark": false,
"FatherOfJava": "linus/torvalds/thegoat/",
"CustomTrashMethod": false,
"CustomMethodName": "protected by YuShengJun",
"CustomMethodCode": "public static String method() {\n return \"Protected by YuShengJun\";\n}",
"Exclusion": []
},
"PostProcess": {
"Enabled": true,
"Manifest": true,
"Plugin YML": true,
"Bungee YML": false,
"Fabric JSON": false,
"Velocity JSON": false,
"ManifestPrefix": [
"Main-Class:"
]
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
deps/ant-1.10.13.jar vendored

Binary file not shown.

Binary file not shown.

BIN
deps/asm-9.4.jar vendored

Binary file not shown.

BIN
deps/asm-9.5.jar vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
deps/asm-tree-9.4.jar vendored

Binary file not shown.

BIN
deps/asm-tree-9.5.jar vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
deps/gson-2.10.1.jar vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
deps/jdom2-2.0.6.1.jar vendored

Binary file not shown.

BIN
deps/joml-1.10.5.jar vendored

Binary file not shown.

Binary file not shown.

BIN
deps/jsr305-3.0.2.jar vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More