Skip to content

Commit 9608f21

Browse files
committed
fixed for upload to PyPI; v3.0.0
1 parent 722732a commit 9608f21

File tree

6 files changed

+227
-60
lines changed

6 files changed

+227
-60
lines changed

sepunycoder

Lines changed: 0 additions & 60 deletions
This file was deleted.

sepunycoder.py

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/usr/bin/python3
2+
import argparse
3+
import json
4+
import os
5+
import time
6+
7+
# Define the translation function
8+
def translte_to_cyrillic(text, punycode_table):
9+
result = ''
10+
for char in text:
11+
if char.lower() in punycode_table:
12+
if char.isupper():
13+
result += punycode_table[char.lower()].upper()
14+
else:
15+
result += punycode_table[char.lower()]
16+
else:
17+
result += char
18+
return result
19+
20+
# Define the main function
21+
def main():
22+
# Define colors for the banner
23+
green_color = "\033[1;32m"
24+
end_color = "\033[0m"
25+
26+
# Display the banner
27+
banner = r'''{}
28+
______ _______ ______ _
29+
/ _____|_______|_____ \ | |
30+
( (____ _____ _____) ) _ ____ _ _ ____ ___ __| |_____ ____
31+
\____ \| ___) | ____/ | | | _ \| | | |/ ___) _ \ / _ | ___ |/ ___)
32+
_____) ) |_____| | | |_| | | | | |_| ( (__| |_| ( (_| | ____| |
33+
(______/|_______)_| |____/|_| |_|\__ |\____)___/ \____|_____)_|
34+
(____/ Social Engineering Punycoder
35+
by @hackermater
36+
{}'''.format(green_color, end_color)
37+
for line in banner.split('\n'):
38+
print(line)
39+
time.sleep(0.08)
40+
41+
# Parse command-line arguments
42+
parser = argparse.ArgumentParser(description="Translate text to Cyrillic punycode.")
43+
parser.add_argument('--file', type=str, help="Input file containing the text to translate")
44+
parser.add_argument('--output', type=str, help="Output file to save the translated text")
45+
args = parser.parse_args()
46+
47+
# Load the punycode translation table
48+
script_dir = os.path.dirname(os.path.abspath(__file__))
49+
punycode_table_path = os.path.join(script_dir, "punycode_chars.json")
50+
with open(punycode_table_path, 'r') as json_file:
51+
punycode_table = json.load(json_file)
52+
53+
# Read input
54+
if args.file:
55+
with open(args.file, 'r') as file:
56+
user_input = file.read()
57+
output_text = translte_to_cyrillic(user_input, punycode_table)
58+
else:
59+
user_input = input("🔓 Enter the text to translate to Cyrillic: ")
60+
user_input_https = input("🔗 Do you want to add \"https://\" protocol? (y/n): ")
61+
output_text = translte_to_cyrillic(user_input, punycode_table)
62+
if user_input_https.lower() == "y":
63+
output_text = "https://" + output_text
64+
65+
# Write output
66+
if args.output:
67+
with open(args.output, 'w') as file:
68+
file.write(output_text)
69+
print(f"👀 Translated text saved to {args.output}")
70+
else:
71+
print("👀 Translated text:", output_text)
72+
73+
# Entry point for the script
74+
if __name__ == "__main__":
75+
main()

sepunycoder/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# sepunycoder/__init__.py
2+
3+
from .main import main

sepunycoder/main.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import argparse
2+
import json
3+
import os
4+
import time
5+
6+
def translte_to_cyrillic(text, punycode_table):
7+
result = ''
8+
for char in text:
9+
if char.lower() in punycode_table:
10+
if char.isupper():
11+
result += punycode_table[char.lower()].upper()
12+
else:
13+
result += punycode_table[char.lower()]
14+
else:
15+
result += char
16+
return result
17+
18+
def main():
19+
green_color = "\033[1;32m"
20+
end_color = "\033[0m"
21+
22+
banner = r'''{}
23+
______ _______ ______ _
24+
/ _____|_______|_____ \ | |
25+
( (____ _____ _____) ) _ ____ _ _ ____ ___ __| |_____ ____
26+
\____ \| ___) | ____/ | | | _ \| | | |/ ___) _ \ / _ | ___ |/ ___)
27+
_____) ) |_____| | | |_| | | | | |_| ( (__| |_| ( (_| | ____| |
28+
(______/|_______)_| |____/|_| |_|\__ |\____)___/ \____|_____)_|
29+
(____/ Social Engineering Punycoder
30+
by @hackermater
31+
{}'''.format(green_color, end_color)
32+
for line in banner.split('\n'):
33+
print(line)
34+
time.sleep(0.08)
35+
36+
parser = argparse.ArgumentParser(description="Translate text to Cyrillic punycode.")
37+
parser.add_argument('--file', type=str, help="Input file containing the text to translate")
38+
parser.add_argument('--output', type=str, help="Output file to save the translated text")
39+
args = parser.parse_args()
40+
41+
script_dir = os.path.dirname(os.path.abspath(__file__))
42+
punycode_table_path = os.path.join(script_dir, "punycode_chars.json")
43+
44+
with open(punycode_table_path, 'r') as json_file:
45+
data = json.load(json_file)
46+
punycode_table = data["punycode_table"]
47+
48+
if args.file:
49+
with open(args.file, 'r') as file:
50+
user_input = file.read()
51+
output_text = translte_to_cyrillic(user_input, punycode_table)
52+
else:
53+
user_input = input("🔓 Enter the text to translate to Cyrillic: ")
54+
user_input_https = input("🔗 Do you want to add \"https://\" protocol? (y/n): ")
55+
output_text = translte_to_cyrillic(user_input, punycode_table)
56+
if user_input_https.lower() == "y":
57+
output_text = "https://" + output_text
58+
59+
if args.output:
60+
with open(args.output, 'w') as file:
61+
file.write(output_text)
62+
print(f"👀 Translated text saved to {args.output}")
63+
else:
64+
print("👀 Translated text:", output_text)
65+
66+
if __name__ == "__main__":
67+
main()

sepunycoder/punycode_chars.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"punycode_table": {
3+
"A": "A",
4+
"B": "B",
5+
"C": "C",
6+
"D": "D",
7+
"E": "E",
8+
"F": "F",
9+
"G": "G",
10+
"H": "H",
11+
"I": "І",
12+
"J": "Ј",
13+
"K": "К",
14+
"L": "L",
15+
"M": "М",
16+
"N": "N",
17+
"O": "О",
18+
"P": "Р",
19+
"Q": "Ԛ",
20+
"R": "R",
21+
"S": "Ѕ",
22+
"T": "T",
23+
"U": "U",
24+
"V": "V",
25+
"W": "W",
26+
"X": "Х",
27+
"Y": "Y",
28+
"Z": "Z",
29+
"a": "а",
30+
"b": "b",
31+
"c": "с",
32+
"d": "d",
33+
"e": "е",
34+
"f": "f",
35+
"g": "g",
36+
"h": "h",
37+
"i": "і",
38+
"j": "ј",
39+
"k": "k",
40+
"l": "l",
41+
"m": "m",
42+
"n": "n",
43+
"o": "о",
44+
"p": "р",
45+
"q": "ԛ",
46+
"r": "r",
47+
"s": "ѕ",
48+
"t": "t",
49+
"u": "u",
50+
"v": "v",
51+
"w": "w",
52+
"x": "х",
53+
"y": "у",
54+
"z": "z"
55+
}
56+
}

setup.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from setuptools import setup, find_packages
2+
3+
setup(
4+
name='sepunycoder',
5+
version='3.0.0',
6+
packages=find_packages(),
7+
description='A simple script to convert normal-text to Cyrillic-text. This allows hackers to obfuscate text in puny-code format which can lead into a lot of multiple Phishing attacks.',
8+
long_description=open('README.md').read(),
9+
long_description_content_type='text/markdown',
10+
url='https://github.com/mateofumis/SEPunycoder.py',
11+
author='Mateo Fumis',
12+
author_email='mateofumis1@gmail.com',
13+
include_package_data=True,
14+
package_data={'sepunycoder': ['punycode_chars.json']},
15+
entry_points={
16+
'console_scripts': [
17+
'sepunycoder=sepunycoder.main:main'
18+
]
19+
},
20+
classifiers=[
21+
'Programming Language :: Python :: 3',
22+
'License :: OSI Approved :: MIT License',
23+
'Operating System :: OS Independent',
24+
],
25+
python_requires='>=3.6',
26+
)

0 commit comments

Comments
 (0)