@obfuscan/core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +224 -0
  3. package/dist/allowlist.d.ts +25 -0
  4. package/dist/allowlist.d.ts.map +1 -0
  5. package/dist/allowlist.js +138 -0
  6. package/dist/allowlist.js.map +1 -0
  7. package/dist/detectors/bidi-control.d.ts +14 -0
  8. package/dist/detectors/bidi-control.d.ts.map +1 -0
  9. package/dist/detectors/bidi-control.js +67 -0
  10. package/dist/detectors/bidi-control.js.map +1 -0
  11. package/dist/detectors/cargo-build-rs-network.d.ts +12 -0
  12. package/dist/detectors/cargo-build-rs-network.d.ts.map +1 -0
  13. package/dist/detectors/cargo-build-rs-network.js +54 -0
  14. package/dist/detectors/cargo-build-rs-network.js.map +1 -0
  15. package/dist/detectors/decode-then-exec.d.ts +20 -0
  16. package/dist/detectors/decode-then-exec.d.ts.map +1 -0
  17. package/dist/detectors/decode-then-exec.js +189 -0
  18. package/dist/detectors/decode-then-exec.js.map +1 -0
  19. package/dist/detectors/deserializer-untrusted.d.ts +15 -0
  20. package/dist/detectors/deserializer-untrusted.d.ts.map +1 -0
  21. package/dist/detectors/deserializer-untrusted.js +99 -0
  22. package/dist/detectors/deserializer-untrusted.js.map +1 -0
  23. package/dist/detectors/dockerfile-curl-pipe-shell.d.ts +10 -0
  24. package/dist/detectors/dockerfile-curl-pipe-shell.d.ts.map +1 -0
  25. package/dist/detectors/dockerfile-curl-pipe-shell.js +42 -0
  26. package/dist/detectors/dockerfile-curl-pipe-shell.js.map +1 -0
  27. package/dist/detectors/dynamic-exec-non-literal.d.ts +17 -0
  28. package/dist/detectors/dynamic-exec-non-literal.d.ts.map +1 -0
  29. package/dist/detectors/dynamic-exec-non-literal.js +104 -0
  30. package/dist/detectors/dynamic-exec-non-literal.js.map +1 -0
  31. package/dist/detectors/encoded-array-fingerprint.d.ts +11 -0
  32. package/dist/detectors/encoded-array-fingerprint.d.ts.map +1 -0
  33. package/dist/detectors/encoded-array-fingerprint.js +60 -0
  34. package/dist/detectors/encoded-array-fingerprint.js.map +1 -0
  35. package/dist/detectors/gha-curl-pipe-shell.d.ts +11 -0
  36. package/dist/detectors/gha-curl-pipe-shell.d.ts.map +1 -0
  37. package/dist/detectors/gha-curl-pipe-shell.js +42 -0
  38. package/dist/detectors/gha-curl-pipe-shell.js.map +1 -0
  39. package/dist/detectors/high-entropy-literal.d.ts +19 -0
  40. package/dist/detectors/high-entropy-literal.d.ts.map +1 -0
  41. package/dist/detectors/high-entropy-literal.js +90 -0
  42. package/dist/detectors/high-entropy-literal.js.map +1 -0
  43. package/dist/detectors/homoglyph-identifier.d.ts +16 -0
  44. package/dist/detectors/homoglyph-identifier.d.ts.map +1 -0
  45. package/dist/detectors/homoglyph-identifier.js +76 -0
  46. package/dist/detectors/homoglyph-identifier.js.map +1 -0
  47. package/dist/detectors/index.d.ts +31 -0
  48. package/dist/detectors/index.d.ts.map +1 -0
  49. package/dist/detectors/index.js +60 -0
  50. package/dist/detectors/index.js.map +1 -0
  51. package/dist/detectors/library-load-non-literal.d.ts +10 -0
  52. package/dist/detectors/library-load-non-literal.d.ts.map +1 -0
  53. package/dist/detectors/library-load-non-literal.js +72 -0
  54. package/dist/detectors/library-load-non-literal.js.map +1 -0
  55. package/dist/detectors/long-line.d.ts +12 -0
  56. package/dist/detectors/long-line.d.ts.map +1 -0
  57. package/dist/detectors/long-line.js +53 -0
  58. package/dist/detectors/long-line.js.map +1 -0
  59. package/dist/detectors/manifest-install-script.d.ts +54 -0
  60. package/dist/detectors/manifest-install-script.d.ts.map +1 -0
  61. package/dist/detectors/manifest-install-script.js +272 -0
  62. package/dist/detectors/manifest-install-script.js.map +1 -0
  63. package/dist/detectors/network-then-exec.d.ts +17 -0
  64. package/dist/detectors/network-then-exec.d.ts.map +1 -0
  65. package/dist/detectors/network-then-exec.js +140 -0
  66. package/dist/detectors/network-then-exec.js.map +1 -0
  67. package/dist/detectors/perl-makefile-side-effect.d.ts +17 -0
  68. package/dist/detectors/perl-makefile-side-effect.d.ts.map +1 -0
  69. package/dist/detectors/perl-makefile-side-effect.js +72 -0
  70. package/dist/detectors/perl-makefile-side-effect.js.map +1 -0
  71. package/dist/detectors/python-setup-side-effect.d.ts +10 -0
  72. package/dist/detectors/python-setup-side-effect.d.ts.map +1 -0
  73. package/dist/detectors/python-setup-side-effect.js +87 -0
  74. package/dist/detectors/python-setup-side-effect.js.map +1 -0
  75. package/dist/detectors/shell-untrusted-input.d.ts +10 -0
  76. package/dist/detectors/shell-untrusted-input.d.ts.map +1 -0
  77. package/dist/detectors/shell-untrusted-input.js +76 -0
  78. package/dist/detectors/shell-untrusted-input.js.map +1 -0
  79. package/dist/detectors/string-array-decoder.d.ts +15 -0
  80. package/dist/detectors/string-array-decoder.d.ts.map +1 -0
  81. package/dist/detectors/string-array-decoder.js +70 -0
  82. package/dist/detectors/string-array-decoder.js.map +1 -0
  83. package/dist/detectors/suspicious-io-cluster.d.ts +11 -0
  84. package/dist/detectors/suspicious-io-cluster.d.ts.map +1 -0
  85. package/dist/detectors/suspicious-io-cluster.js +86 -0
  86. package/dist/detectors/suspicious-io-cluster.js.map +1 -0
  87. package/dist/diff.d.ts +23 -0
  88. package/dist/diff.d.ts.map +1 -0
  89. package/dist/diff.js +144 -0
  90. package/dist/diff.js.map +1 -0
  91. package/dist/directives.d.ts +33 -0
  92. package/dist/directives.d.ts.map +1 -0
  93. package/dist/directives.js +60 -0
  94. package/dist/directives.js.map +1 -0
  95. package/dist/errors.d.ts +19 -0
  96. package/dist/errors.d.ts.map +1 -0
  97. package/dist/errors.js +16 -0
  98. package/dist/errors.js.map +1 -0
  99. package/dist/grammar/query.d.ts +44 -0
  100. package/dist/grammar/query.d.ts.map +1 -0
  101. package/dist/grammar/query.js +24 -0
  102. package/dist/grammar/query.js.map +1 -0
  103. package/dist/index.d.ts +101 -0
  104. package/dist/index.d.ts.map +1 -0
  105. package/dist/index.js +106 -0
  106. package/dist/index.js.map +1 -0
  107. package/dist/internal/patterns.d.ts +48 -0
  108. package/dist/internal/patterns.d.ts.map +1 -0
  109. package/dist/internal/patterns.js +95 -0
  110. package/dist/internal/patterns.js.map +1 -0
  111. package/dist/internal/text.d.ts +14 -0
  112. package/dist/internal/text.d.ts.map +1 -0
  113. package/dist/internal/text.js +20 -0
  114. package/dist/internal/text.js.map +1 -0
  115. package/dist/rules.d.ts +25 -0
  116. package/dist/rules.d.ts.map +1 -0
  117. package/dist/rules.js +195 -0
  118. package/dist/rules.js.map +1 -0
  119. package/dist/scan.d.ts +26 -0
  120. package/dist/scan.d.ts.map +1 -0
  121. package/dist/scan.js +287 -0
  122. package/dist/scan.js.map +1 -0
  123. package/dist/types.d.ts +215 -0
  124. package/dist/types.d.ts.map +1 -0
  125. package/dist/types.js +8 -0
  126. package/dist/types.js.map +1 -0
  127. package/dist/version.d.ts +10 -0
  128. package/dist/version.d.ts.map +1 -0
  129. package/dist/version.js +50 -0
  130. package/dist/version.js.map +1 -0
  131. package/package.json +74 -0
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@obfuscan/core",
3
+ "version": "0.1.0",
4
+ "description": "Detect obfuscated code and likely backdoors in pull-request diffs. Multi-language. Diff-aware. Pure TypeScript.",
5
+ "license": "Apache-2.0",
6
+ "homepage": "https://github.com/ByteBardOrg/obfuscan",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/ByteBardOrg/obfuscan.git",
10
+ "directory": "packages/core"
11
+ },
12
+ "bugs": "https://github.com/ByteBardOrg/obfuscan/issues",
13
+ "keywords": [
14
+ "security",
15
+ "obfuscation",
16
+ "malware",
17
+ "supply-chain",
18
+ "code-review",
19
+ "diff",
20
+ "tree-sitter",
21
+ "static-analysis"
22
+ ],
23
+ "type": "module",
24
+ "main": "./dist/index.js",
25
+ "module": "./dist/index.js",
26
+ "types": "./dist/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "import": "./dist/index.js"
31
+ }
32
+ },
33
+ "files": [
34
+ "dist",
35
+ "README.md",
36
+ "LICENSE"
37
+ ],
38
+ "engines": {
39
+ "node": ">=18"
40
+ },
41
+ "peerDependencies": {
42
+ "@obfuscan/rules": "*"
43
+ },
44
+ "peerDependenciesMeta": {
45
+ "@obfuscan/rules": { "optional": false }
46
+ },
47
+ "dependencies": {
48
+ "parse-diff": "^0.11.0",
49
+ "minimatch": "^9.0.0",
50
+ "fast-levenshtein": "^3.0.0"
51
+ },
52
+ "devDependencies": {
53
+ "typescript": "^5.4.0",
54
+ "vitest": "^1.5.0",
55
+ "@types/node": "^20.0.0"
56
+ },
57
+ "scripts": {
58
+ "build": "tsc -p tsconfig.build.json",
59
+ "prepack": "npm run build && node ./scripts/sync-root-meta.mjs",
60
+ "test": "vitest run --config test/vitest.config.ts test/contract test/unit test/fixtures-runner",
61
+ "test:contract":"vitest run --config test/vitest.config.ts test/contract",
62
+ "test:unit": "vitest run --config test/vitest.config.ts test/unit",
63
+ "test:fixtures":"vitest run --config test/vitest.config.ts test/fixtures-runner",
64
+ "test:perf": "vitest run --config test/vitest.config.ts test/perf",
65
+ "test:perf:full":"OBFUSCAN_PERF_FULL=1 vitest run --config test/vitest.config.ts test/perf",
66
+ "test:all": "vitest run --config test/vitest.config.ts",
67
+ "lint": "eslint src",
68
+ "format": "prettier -w src"
69
+ },
70
+ "publishConfig": {
71
+ "access": "public",
72
+ "provenance": true
73
+ }
74
+ }