Skip to content

Commit

Permalink
πŸ—“ Sep 3, 2023 11:35:24 AM
Browse files Browse the repository at this point in the history
✨ new ml plugin
πŸ™ update mappings for upside down chars
πŸ§ͺ tests added/updated
  • Loading branch information
securisec committed Sep 3, 2023
1 parent 3ca5eda commit e5f88fd
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 76 deletions.
2 changes: 1 addition & 1 deletion chepy/chepy_plugins
133 changes: 60 additions & 73 deletions chepy/modules/internal/constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,63 @@
class Encoding(object):
UPSIDE_DOWN = {
"!": "Β‘",
'"': '"',
"#": "#",
"$": "$",
"%": "%",
"&": "β…‹",
"'": ",",
"(": ")",
")": "(",
"*": "*",
"+": "+",
",": "'",
"-": "-",
".": ".",
"/": "\\",
"0": "0",
"1": "Ζ–",
"2": "α„…",
"3": "Ɛ",
"4": "γ„£",
"5": "Ο›",
"6": "9",
"7": "γ„₯",
"8": "8",
"9": "6",
":": ":",
";": ";",
"<": ">",
"=": "=",
">": "<",
"?": "ΒΏ",
"@": "@",
"A": "βˆ€",
"B": "q",
"C": "Ζ†",
"D": "D",
"E": "Ǝ",
"F": "ΕΏ",
"G": "Χ€",
"I": "I",
"K": "ʞ",
"L": "Λ₯",
"M": "W",
"N": "N",
"O": "O",
"P": "Τ€",
"Q": "Q",
"R": "ΙΉ",
"S": "S",
"T": "β”΄",
"U": "∩",
"V": "Ξ›",
"W": "M",
"X": "X",
"Y": "β…„",
"Z": "Z",
"[": "]",
"]": "[",
"a": "ɐ",
"b": "q",
"c": "Ι”",
Expand All @@ -8,13 +66,12 @@ class Encoding(object):
"f": "ɟ",
"g": "Ζƒ",
"h": "Ι₯",
"i": "Δ±",
"i": "ᴉ",
"j": "ΙΎ",
"k": "ʞ",
"l": "Λ₯",
"l": "l",
"m": "Ι―",
"n": "u",
"o": "o",
"p": "d",
"q": "b",
"r": "ΙΉ",
Expand All @@ -26,76 +83,6 @@ class Encoding(object):
"x": "x",
"y": "ʎ",
"z": "z",
"A": "β±―",
"B": "Q",
"C": "Ζ†",
"D": "P",
"E": "Ǝ",
"F": "ɟ",
"G": "Ζ‚",
"H": "Ɥ",
"I": "I",
"J": "ΙΎ",
"K": "Ʞ",
"L": "Λ₯",
"M": "Ɯ",
"N": "U",
"O": "O",
"P": "D",
"Q": "B",
"R": "ΙΉ",
"S": "S",
"T": "Ʇ",
"U": "N",
"V": "Ι…",
"W": "ʍ",
"X": "X",
"Y": "ʎ",
"Z": "Z",
"0": "0",
"1": "Ζ–",
"2": "α„…",
"3": "Ɛ",
"4": "γ„£",
"5": "Ο›",
"6": "9",
"7": "γ„₯",
"8": "8",
"9": "6",
"!": "Β‘",
"@": "@",
"#": "#",
"$": "$",
"%": "%",
"&": "β…‹",
"*": "*",
"(": ")",
")": "(",
"[": "]",
"]": "[",
"{": "}",
"}": "{",
"<": ">",
">": "<",
"?": "ΒΏ",
"/": "\\",
"\\": "/",
"|": "|",
"_": "_",
"-": "-",
"+": "+",
"=": "=",
":": ":",
";": ";",
",": "'",
"'": ",",
'"': '"',
"`": "`",
"~": "~",
".": ".",
"<": ">",
">": "<",
" ": " ",
}

BACON_26 = {
Expand Down
4 changes: 2 additions & 2 deletions tests/test_dataformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,5 +566,5 @@ def test_bacon():
assert Chepy("hello").to_bacon(A="0", B="1").from_bacon(A="0", B="1").o == b"HELLO"

def test_upside_down():
assert Chepy('hello').to_upside_down().from_upside_down().o == b'heLLo'
assert Chepy('hello').to_upside_down(True).from_upside_down(True).o == b'heLLo'
assert Chepy('hello').to_upside_down().from_upside_down().o == b'hello'
assert Chepy('hello').to_upside_down(True).from_upside_down(True).o == b'hello'
20 changes: 20 additions & 0 deletions tests_plugins/test_ml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from chepy import Chepy


def test_ml_detect():
data = "04224d184070df280000806147567362473867643239796247516761534268625342684948526c633351675a47463059513d3d00000000"
assert (
Chepy("https%3A%2F%2Fwww.pennington.com%2Fcategories%2Fwp-content")
.ml_detect()
.o.get("to_url_encode")
!= None
)
assert Chepy(data).ml_detect().o.get("to_hex") != None
assert Chepy(data).from_hex().ml_detect().o.get("lz4_compress") != None
assert (
Chepy(data).from_hex().lz4_decompress().ml_detect().o.get("to_base64") != None
)
assert (
Chepy(data).from_hex().lz4_decompress().from_base64().o
== b"hello world i am a test data"
)

0 comments on commit e5f88fd

Please sign in to comment.