I'm also having problems with clicking on PyCript
Hello! I am very honored to find such a good encryption and decryption plug-in, but I encountered a very confused problem during the use. I just came into contact with this plug-in. I tried to solve it with AI and read the relevant manual documents, but I still can't find the problem. I will list the detailed process below as follows. I hope you can get your help. I want to use JSrpc remote to call the front-end js code in the encryption and decryption functions so that I do not need to the relevant encryption and decryption functions for the construction at the same time can also solve the magic after some encryption, directly using its original encryption and decryption functions for testing. So I combined the Jsrpc call into the PyCript encryption and decryption script, I used python language to write. The data to be decrypted is:
zalWUYQ1OKsGUYzDnrvL3gw5A0XEfCJiLJCkPKAuQBuaRm35/7Y3g5emnGPE4BLmQ1jBpHiy/JHUL+cPGL1ndJJnBguqyhmYA5Nrsu7EVDMCB6jJr+Q3zyAWJ2bF5Nb43cKx2fZ22Ohc3YzqHTyuV0EZgRTZUsFr8N+2K6Kn+4n2ZRG4N8D21L8Mi03eTxUG+6nMRpGz48/wxn9xQRIvXXi5cb/KG+X0b4gDpM7jMbAeAK60tU8uCKZEC76jfLJYLrY31BwgzQs6BcrF0mrrx39UK6Dbjqtet/tSRRD3NvUK+iRqk1iceu7pGbJenpsNridTH6y42zQG9CC08a9bincCYqE41tQ+S/6S0vN4nhE8VqpR39DvW5IlPJ76TiW3FQniykrqzLBgXmqt0KGIYb3fVJZdoy+sVm2xD1ySS4AyiyXbKjA2QnPind7yMWwPyEl0tZU8zR0e2WbeUm/zYd1vChoEc0QSan7iv8o9e3jvHHU47z+WY4TXs6/BWNCSjWDi9bIvRRYVB27/n5AoHhA5rxhgWv4ZHLZuFnHE/C97dDyNwSqzeQzM7UAofQwY0vCnz+TGqG7tca4PBkgnN/BbidmhqLkOjI/pvSWak8bWPLSOXXJBgmMEATe50P1efmR2tg77lsyjO3CPKfpyALI9NvvVDkf/D6QCVlDp14/jBQ00mGC2rx1A0EFnrPaXgZG1c5XZeAPC7y7DBGVzBfAjnUJt+vvPtBOSvjHkTdnwJy3xP+GSXbEMEvyjcfSEAJZY2Fh9n9P/vjIuu383OYCuQt4o7inKsOdIM8PMMe0=
According to the PyCript manual I converted the data to be decrypted into a byte array and I named the conversion script test_data_encrytp.py with the following code:
import json
import os
script_dir = os.path.dirname(os.path.abspath(__file__))
encrypted_data = "zalWUYQ1OKsGUYzDnrvL3gw5A0XEfCJiLJCkPKAuQBuaRm35/7Y3g5emnGPE4BLmQ1jBpHiy/JHUL+cPGL1ndJJnBguqyhmYA5Nrsu7EVDMCB6jJr+Q3zyAWJ2bF5Nb43cKx2fZ22Ohc3YzqHTyuV0EZgRTZUsFr8N+2K6Kn+4n2ZRG4N8D21L8Mi03eTxUG+6nMRpGz48/wxn9xQRIvXXi5cb/KG+X0b4gDpM7jMbAeAK60tU8uCKZEC76jfLJYLrY31BwgzQs6BcrF0mrrx39UK6Dbjqtet/tSRRD3NvUK+iRqk1iceu7pGbJenpsNridTH6y42zQG9CC08a9bincCYqE41tQ+S/6S0vN4nhE8VqpR39DvW5IlPJ76TiW3FQniykrqzLBgXmqt0KGIYb3fVJZdoy+sVm2xD1ySS4AyiyXbKjA2QnPind7yMWwPyEl0tZU8zR0e2WbeUm/zYd1vChoEc0QSan7iv8o9e3jvHHU47z+WY4TXs6/BWNCSjWDi9bIvRRYVB27/n5AoHhA5rxhgWv4ZHLZuFnHE/C97dDyNwSqzeQzM7UAofQwY0vCnz+TGqG7tca4PBkgnN/BbidmhqLkOjI/pvSWak8bWPLSOXXJBgmMEATe50P1efmR2tg77lsyjO3CPKfpyALI9NvvVDkf/D6QCVlDp14/jBQ00mGC2rx1A0EFnrPaXgZG1c5XZeAPC7y7DBGVzBfAjnUJt+vvPtBOSvjHkTdnwJy3xP+GSXbEMEvyjcfSEAJZY2Fh9n9P/vjIuu383OYCuQt4o7inKsOdIM8PMMe0="
byte_array = [ord(c) for c in encrypted_data]
file_path = os.path.join(script_dir, 'test_data.txt')
with open(file_path, 'w', encoding='utf-8') as f:
f.write(json.dumps(byte_array))
f.write('\n--BODY_END--\n')
f.write('\r\n')
The converted byte array data is:
[122, 97, 108, 87, 85, 89, 81, 49, 79, 75, 115, 71, 85, 89, 122, 68, 110, 114, 118, 76, 51, 103, 119, 53, 65, 48, 88, 69, 102, 67, 74, 105, 76, 74, 67, 107, 80, 75, 65, 117, 81, 66, 117, 97, 82, 109, 51, 53, 47, 55, 89, 51, 103, 53, 101, 109, 110, 71, 80, 69, 52, 66, 76, 109, 81, 49, 106, 66, 112, 72, 105, 121, 47, 74, 72, 85, 76, 43, 99, 80, 71, 76, 49, 110, 100, 74, 74, 110, 66, 103, 117, 113, 121, 104, 109, 89, 65, 53, 78, 114, 115, 117, 55, 69, 86, 68, 77, 67, 66, 54, 106, 74, 114, 43, 81, 51, 122, 121, 65, 87, 74, 50, 98, 70, 53, 78, 98, 52, 51, 99, 75, 120, 50, 102, 90, 50, 50, 79, 104, 99, 51, 89, 122, 113, 72, 84, 121, 117, 86, 48, 69, 90, 103, 82, 84, 90, 85, 115, 70, 114, 56, 78, 43, 50, 75, 54, 75, 110, 43, 52, 110, 50, 90, 82, 71, 52, 78, 56, 68, 50, 49, 76, 56, 77, 105, 48, 51, 101, 84, 120, 85, 71, 43, 54, 110, 77, 82, 112, 71, 122, 52, 56, 47, 119, 120, 110, 57, 120, 81, 82, 73, 118, 88, 88, 105, 53, 99, 98, 47, 75, 71, 43, 88, 48, 98, 52, 103, 68, 112, 77, 55, 106, 77, 98, 65, 101, 65, 75, 54, 48, 116, 85, 56, 117, 67, 75, 90, 69, 67, 55, 54, 106, 102, 76, 74, 89, 76, 114, 89, 51, 49, 66, 119, 103, 122, 81, 115, 54, 66, 99, 114, 70, 48, 109, 114, 114, 120, 51, 57, 85, 75, 54, 68, 98, 106, 113, 116, 101, 116, 47, 116, 83, 82, 82, 68, 51, 78, 118, 85, 75, 43, 105, 82, 113, 107, 49, 105, 99, 101, 117, 55, 112, 71, 98, 74, 101, 110, 112, 115, 78, 114, 105, 100, 84, 72, 54, 121, 52, 50, 122, 81, 71, 57, 67, 67, 48, 56, 97, 57, 98, 105, 110, 99, 67, 89, 113, 69, 52, 49, 116, 81, 43, 83, 47, 54, 83, 48, 118, 78, 52, 110, 104, 69, 56, 86, 113, 112, 82, 51, 57, 68, 118, 87, 53, 73, 108, 80, 74, 55, 54, 84, 105, 87, 51, 70, 81, 110, 105, 121, 107, 114, 113, 122, 76, 66, 103, 88, 109, 113, 116, 48, 75, 71, 73, 89, 98, 51, 102, 86, 74, 90, 100, 111, 121, 43, 115, 86, 109, 50, 120, 68, 49, 121, 83, 83, 52, 65, 121, 105, 121, 88, 98, 75, 106, 65, 50, 81, 110, 80, 105, 110, 100, 55, 121, 77, 87, 119, 80, 121, 69, 108, 48, 116, 90, 85, 56, 122, 82, 48, 101, 50, 87, 98, 101, 85, 109, 47, 122, 89, 100, 49, 118, 67, 104, 111, 69, 99, 48, 81, 83, 97, 110, 55, 105, 118, 56, 111, 57, 101, 51, 106, 118, 72, 72, 85, 52, 55, 122, 43, 87, 89, 52, 84, 88, 115, 54, 47, 66, 87, 78, 67, 83, 106, 87, 68, 105, 57, 98, 73, 118, 82, 82, 89, 86, 66, 50, 55, 47, 110, 53, 65, 111, 72, 104, 65, 53, 114, 120, 104, 103, 87, 118, 52, 90, 72, 76, 90, 117, 70, 110, 72, 69, 47, 67, 57, 55, 100, 68, 121, 78, 119, 83, 113, 122, 101, 81, 122, 77, 55, 85, 65, 111, 102, 81, 119, 89, 48, 118, 67, 110, 122, 43, 84, 71, 113, 71, 55, 116, 99, 97, 52, 80, 66, 107, 103, 110, 78, 47, 66, 98, 105, 100, 109, 104, 113, 76, 107, 79, 106, 73, 47, 112, 118, 83, 87, 97, 107, 56, 98, 87, 80, 76, 83, 79, 88, 88, 74, 66, 103, 109, 77, 69, 65, 84, 101, 53, 48, 80, 49, 101, 102, 109, 82, 50, 116, 103, 55, 55, 108, 115, 121, 106, 79, 51, 67, 80, 75, 102, 112, 121, 65, 76, 73, 57, 78, 118, 118, 86, 68, 107, 102, 47, 68, 54, 81, 67, 86, 108, 68, 112, 49, 52, 47, 106, 66, 81, 48, 48, 109, 71, 67, 50, 114, 120, 49, 65, 48, 69, 70, 110, 114, 80, 97, 88, 103, 90, 71, 49, 99, 53, 88, 90, 101, 65, 80, 67, 55, 121, 55, 68, 66, 71, 86, 122, 66, 102, 65, 106, 110, 85, 74, 116, 43, 118, 118, 80, 116, 66, 79, 83, 118, 106, 72, 107, 84, 100, 110, 119, 74, 121, 51, 120, 80, 43, 71, 83, 88, 98, 69, 77, 69, 118, 121, 106, 99, 102, 83, 69, 65, 74, 90, 89, 50, 70, 104, 57, 110, 57, 80, 47, 118, 106, 73, 117, 117, 51, 56, 51, 79, 89, 67, 117, 81, 116, 52, 111, 55, 105, 110, 75, 115, 79, 100, 73, 77, 56, 80, 77, 77, 101, 48, 61]
--BODY_END--
Then according to the PyCript manual combined with JsRpc call method, I wrote a decryption script called JsRpc_PyCript_Decrypt.py, the code is as follows:
import json
from pathlib import Path
import argparse
import requests
def decrypt(ciphertext):
url = "http://127.0.0.1:12080/go"
data = {
"group": "zzz",
"action": "Decrypt",
"param": json.dumps({
"data": ciphertext,
"t": "73647333323461643435336b75747276"
})
}
try:
response = requests.post(url, data=data)
if response.status_code == 200:
return json.loads(response.text)['data']
else:
print(f"JSRPC request failed with status code:{response.status_code}")
return ciphertext
except Exception as e:
print(f"Error when calling JSRPC:{str(e)}")
return ciphertext
def read_parse_header(headers_raw):
return headers_raw
parser = argparse.ArgumentParser(
description='Process encrypted/decrypted data.'
)
parser.add_argument(
'-d', '--data',
required=True,
help='Path to temp file containing request/response data'
)
args = parser.parse_args()
file_path = Path(args.data).resolve()
data = file_path.read_text(encoding='utf-8')
body_end_marker = '\n--BODY_END--\n'
byte_array_str, headers_raw = data.split(body_end_marker)
byte_array = json.loads(byte_array_str.strip())
ciphertext = bytes(byte_array).decode('utf-8')
original_text = decrypt(ciphertext)
updated_header = read_parse_header(headers_raw)
updated_output_byte = [ord(char) for char in original_text]
output = f"{json.dumps(updated_output_byte)}{body_end_marker}{updated_header}"
file_path.write_text(output, encoding='utf-8')
Similarly I wrote the encryption script called JsRpc_PyCript_Encrypt.py with the following code:
import json
from pathlib import Path
import argparse
import requests
def encrypt(ciphertext):
url = "http://127.0.0.1:12080/go"
data = {
"group": "zzz",
"action": "Encrypt",
"param": json.dumps({
"data": ciphertext,
"t": "73647333323461643435336b75747276"
})
}
try:
response = requests.post(url, data=data)
if response.status_code == 200:
return json.loads(response.text)['data']
else:
print(f"JSRPC request failed with status code:{response.status_code}")
return ciphertext
except Exception as e:
print(f"Error when calling JSRPC:{str(e)}")
return ciphertext
def read_parse_header(headers_raw):
return headers_raw
parser = argparse.ArgumentParser(
description='Process encrypted/decrypted data.'
)
parser.add_argument(
'-d', '--data',
required=True,
help='Path to temp file containing request/response data'
)
args = parser.parse_args()
file_path = Path(args.data).resolve()
data = file_path.read_text(encoding='utf-8')
body_end_marker = '\n--BODY_END--\n'
byte_array_str, headers_raw = data.split(body_end_marker)
byte_array = json.loads(byte_array_str.strip())
ciphertext = bytes(byte_array).decode('utf-8')
original_text = encrypt(ciphertext)
updated_header = read_parse_header(headers_raw)
updated_output_byte = [ord(char) for char in original_text]
output = f"{json.dumps(updated_output_byte)}{body_end_marker}{updated_header}"
file_path.write_text(output, encoding='utf-8')
I will JsRpc to all the environment is normally enabled, now I will test locally to see if it can be used normally, I execute JsRpc_PyCript_Decrypt.py decrypt test_data.txt operation, can be normal to get test_data.txt decrypted data, the data is as follows:
[123, 34, 115, 101, 114, 118, 105, 99, 101, 34, 58, 123, 34, 115, 121, 115, 72, 101, 97, 100, 34, 58, 123, 34, 115, 101, 114, 118, 105, 99, 101, 67, 111, 100, 101, 34, 58, 110, 117, 108, 108, 44, 34, 115, 101, 114, 118, 105, 99, 101, 83, 99, 101, 110, 101, 34, 58, 110, 117, 108, 108, 44, 34, 111, 114, 105, 103, 105, 110, 83, 121, 115, 73, 100, 34, 58, 110, 117, 108, 108, 44, 34, 115, 121, 115, 73, 100, 34, 58, 110, 117, 108, 108, 44, 34, 105, 110, 102, 84, 121, 112, 101, 34, 58, 110, 117, 108, 108, 44, 34, 116, 114, 97, 110, 77, 111, 100, 101, 34, 58, 110, 117, 108, 108, 44, 34, 117, 115, 101, 114, 73, 100, 34, 58, 110, 117, 108, 108, 44, 34, 116, 114, 97, 110, 67, 111, 100, 101, 34, 58, 110, 117, 108, 108, 44, 34, 112, 114, 100, 67, 111, 100, 101, 34, 58, 110, 117, 108, 108, 44, 34, 103, 108, 111, 98, 83, 101, 113, 78, 117, 109, 34, 58, 34, 77, 83, 80, 48, 49, 50, 48, 50, 53, 48, 57, 49, 55, 48, 48, 48, 48, 48, 50, 48, 55, 56, 57, 34, 44, 34, 115, 121, 115, 83, 101, 113, 78, 117, 109, 34, 58, 34, 77, 83, 80, 48, 49, 50, 48, 50, 53, 48, 57, 49, 55, 48, 48, 48, 48, 48, 50, 48, 55, 56, 57, 77, 83, 80, 48, 50, 48, 55, 56, 57, 34, 44, 34, 105, 110, 102, 83, 101, 113, 78, 117, 109, 34, 58, 110, 117, 108, 108, 44, 34, 98, 114, 97, 110, 99, 104, 73, 100, 34, 58, 110, 117, 108, 108, 44, 34, 116, 101, 108, 108, 101, 114, 73, 100, 34, 58, 110, 117, 108, 108, 44, 34, 116, 114, 97, 110, 68, 97, 116, 101, 34, 58, 110, 117, 108, 108, 44, 34, 116, 114, 97, 110, 84, 105, 109, 101, 34, 58, 110, 117, 108, 108, 44, 34, 98, 97, 116, 99, 104, 73, 100, 34, 58, 110, 117, 108, 108, 44, 34, 114, 101, 116, 67, 111, 100, 101, 34, 58, 34, 77, 83, 80, 49, 48, 48, 48, 48, 34, 44, 34, 114, 101, 116, 77, 115, 103, 34, 58, 34, 30331, 24405, 22833, 36133, 44, 36134, 21495, 25110, 23494, 30721, 38169, 35823, 65281, 34, 44, 34, 98, 97, 99, 107, 68, 97, 116, 101, 34, 58, 110, 117, 108, 108, 44, 34, 98, 97, 99, 107, 84, 105, 109, 101, 34, 58, 110, 117, 108, 108, 44, 34, 98, 97, 99, 107, 83, 101, 113, 78, 117, 109, 34, 58, 110, 117, 108, 108, 44, 34, 97, 99, 99, 116, 68, 97, 116, 101, 34, 58, 110, 117, 108, 108, 44, 34, 118, 101, 114, 34, 58, 110, 117, 108, 108, 125, 44, 34, 97, 112, 112, 72, 101, 97, 100, 34, 58, 123, 34, 97, 116, 116, 114, 105, 98, 117, 116, 101, 84, 101, 120, 116, 34, 58, 110, 117, 108, 108, 44, 34, 112, 97, 103, 101, 78, 117, 109, 34, 58, 49, 44, 34, 112, 97, 103, 101, 83, 105, 122, 101, 34, 58, 53, 44, 34, 116, 111, 116, 97, 108, 78, 117, 109, 34, 58, 48, 125, 44, 34, 98, 111, 100, 121, 34, 58, 110, 117, 108, 108, 125, 44, 34, 115, 117, 99, 99, 101, 115, 115, 34, 58, 102, 97, 108, 115, 101, 125]
--BODY_END--
Then I wrote a script called: test_data_encrytp.py to do the byte array conversion, the code is as follows:
ascii_values = [123, 34, 115, 101, 114, 118, 105, 99, 101, 34, 58, 123, 34, 115, 121, 115, 72, 101, 97, 100, 34, 58, 123, 34, 115, 101, 114, 118, 105, 99, 101, 67, 111, 100, 101, 34, 58, 110, 117, 108, 108, 44, 34, 115, 101, 114, 118, 105, 99, 101, 83, 99, 101, 110, 101, 34, 58, 110, 117, 108, 108, 44, 34, 111, 114, 105, 103, 105, 110, 83, 121, 115, 73, 100, 34, 58, 110, 117, 108, 108, 44, 34, 115, 121, 115, 73, 100, 34, 58, 110, 117, 108, 108, 44, 34, 105, 110, 102, 84, 121, 112, 101, 34, 58, 110, 117, 108, 108, 44, 34, 116, 114, 97, 110, 77, 111, 100, 101, 34, 58, 110, 117, 108, 108, 44, 34, 117, 115, 101, 114, 73, 100, 34, 58, 110, 117, 108, 108, 44, 34, 116, 114, 97, 110, 67, 111, 100, 101, 34, 58, 110, 117, 108, 108, 44, 34, 112, 114, 100, 67, 111, 100, 101, 34, 58, 110, 117, 108, 108, 44, 34, 103, 108, 111, 98, 83, 101, 113, 78, 117, 109, 34, 58, 34, 77, 83, 80, 48, 49, 50, 48, 50, 53, 48, 57, 49, 55, 48, 48, 48, 48, 48, 50, 48, 55, 56, 57, 34, 44, 34, 115, 121, 115, 83, 101, 113, 78, 117, 109, 34, 58, 34, 77, 83, 80, 48, 49, 50, 48, 50, 53, 48, 57, 49, 55, 48, 48, 48, 48, 48, 50, 48, 55, 56, 57, 77, 83, 80, 48, 50, 48, 55, 56, 57, 34, 44, 34, 105, 110, 102, 83, 101, 113, 78, 117, 109, 34, 58, 110, 117, 108, 108, 44, 34, 98, 114, 97, 110, 99, 104, 73, 100, 34, 58, 110, 117, 108, 108, 44, 34, 116, 101, 108, 108, 101, 114, 73, 100, 34, 58, 110, 117, 108, 108, 44, 34, 116, 114, 97, 110, 68, 97, 116, 101, 34, 58, 110, 117, 108, 108, 44, 34, 116, 114, 97, 110, 84, 105, 109, 101, 34, 58, 110, 117, 108, 108, 44, 34, 98, 97, 116, 99, 104, 73, 100, 34, 58, 110, 117, 108, 108, 44, 34, 114, 101, 116, 67, 111, 100, 101, 34, 58, 34, 77, 83, 80, 49, 48, 48, 48, 48, 34, 44, 34, 114, 101, 116, 77, 115, 103, 34, 58, 34, 30331, 24405, 22833, 36133, 44, 36134, 21495, 25110, 23494, 30721, 38169, 35823, 65281, 34, 44, 34, 98, 97, 99, 107, 68, 97, 116, 101, 34, 58, 110, 117, 108, 108, 44, 34, 98, 97, 99, 107, 84, 105, 109, 101, 34, 58, 110, 117, 108, 108, 44, 34, 98, 97, 99, 107, 83, 101, 113, 78, 117, 109, 34, 58, 110, 117, 108, 108, 44, 34, 97, 99, 99, 116, 68, 97, 116, 101, 34, 58, 110, 117, 108, 108, 44, 34, 118, 101, 114, 34, 58, 110, 117, 108, 108, 125, 44, 34, 97, 112, 112, 72, 101, 97, 100, 34, 58, 123, 34, 97, 116, 116, 114, 105, 98, 117, 116, 101, 84, 101, 120, 116, 34, 58, 110, 117, 108, 108, 44, 34, 112, 97, 103, 101, 78, 117, 109, 34, 58, 49, 44, 34, 112, 97, 103, 101, 83, 105, 122, 101, 34, 58, 53, 44, 34, 116, 111, 116, 97, 108, 78, 117, 109, 34, 58, 48, 125, 44, 34, 98, 111, 100, 121, 34, 58, 110, 117, 108, 108, 125, 44, 34, 115, 117, 99, 99, 101, 115, 115, 34, 58, 102, 97, 108, 115, 101, 125]
result = ''.join(chr(value) for value in ascii_values)
print(result)
I converted the decrypted byte array to get the plaintext information and I found success with the following results:
To this step I feel that the PyCript encryption and decryption script I wrote can be executed normally, I loaded it into the PyCript plugin for execution, and the site normally requests packets as follows:
POST /prod-api/auth/login HTTP/1.1
Host: x.x.x.x
Cookie: ticket=""; containerStyle=0; leftMenu=0; sidebarRight=0; Encrypt=true; sidebarStatus=1
Content-Length: 64
Pragma: no-cache
Cache-Control: no-cache
Sec-Ch-Ua-Platform: "Windows"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 NetType/WIFI MicroMessenger/7.0.20.1781(0x6700143B) WindowsWechat(0x6309071d) XWEB/8461 Flue
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Ch-Ua: "Chromium";v="140", "Not=A?Brand";v="24", "Google Chrome";v="140"
Content-Type: application/json;charset=UTF-8
Istoken: false
Sec-Ch-Ua-Mobile: ?0
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Priority: u=1, i
Connection: keep-alive
e4Hzgn8lZjjge6fEfL7euu6h/tVHf0VN4IfBUiFlDEO3ScoMMFIdAT+RAdyVAd+7
But I find that the page is blank when I click on PyCript.
I tried to check the Logging situation but found that no errors are generated and all data is normal.
This problem has been bothering me for a long time, I can't find a solution now, can you help me, I need your help. If you can you can not record or give details of the case to use the document, so that I am conducive to such a novice to read the use of the last would like to say that this plug-in is really very convenient and very applicable, thank you for your contribution!
It seems the issue is within the PyCript. Please check for any errors in the Burp Suite Extensions tab by selecting PyCript and then the Error tab to see if there are any errors.
From the screenshot, I can see your script output, which is
[123, 34, 117, 115, 101, 114, 110, 97, 109, 101, 34, 58, 34, 115, 100, 115, 100, 102, 115, 100, 100, 34, 44, 34, 112, 97, 115, 115, 119, 111, 114, 100, 34, 58, 34, 115, 100, 115, 100, 102, 115, 100, 100, 34, 125]
`>python -c "print(bytes([123,34,117,115,101,114,110,97,109,101,34,58,34,115,100,115,100,102,115,100,100,34,44,34,112,97,115,115,119,111,114,100,34,58,34,115,100,115,100,102,115,100,100,34,125]).decode())"
{"username":"sdsdfsdd","password":"sdsdfsdd"}`
Your script is working, I believe it's an error from the PyCript itself. Can you confirm the error in the Burp Extension tab to figure out the reason
The following is the Errors message displayed by PyCript:
Traceback (most recent call last):
File "D:\DawnLauncher-1.4.7\Tools\ProxyTools\Burpsuite\Plug\PyCript-main\pycript\Requesttab.py", line 51, in setMessage
output = DecryptRequest(self._extender,content,request)
File "D:\DawnLauncher-1.4.7\Tools\ProxyTools\Burpsuite\Plug\PyCript-main\pycript\Reqcheck.py", line 55, in DecryptRequest
decrypted_value, updated_header = Parameterdecrypt(selectedlang, decryptionpath, body,headers_str)
File "D:\DawnLauncher-1.4.7\Tools\ProxyTools\Burpsuite\Plug\PyCript-main\pycript\decryption.py", line 11, in Parameterdecrypt
string_body = bytes_to_string(body)
File "D:\DawnLauncher-1.4.7\Tools\ProxyTools\Burpsuite\Plug\PyCript-main\pycript\gethelpers.py", line 24, in bytes_to_string
byte_data2 = [int(code.strip()) for code in byte_data_clean.split(',')]
ValueError: invalid literal for int() with base 10: '125]
--BODY_END--
POST /prod-api/auth/login HTTP/1.1
Host: x.x.x.x
Cookie: ticket=""; containerStyle=0; leftMenu=0; sidebarRight=0; Encrypt=true; sidebarStatus=1
Content-Length: 64
Pragma: no-cache
Cache-Control: no-cache
Sec-Ch-Ua-Platform: "Windows"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML'
at org.python.core.Py.ValueError(Py.java:332)
at org.python.core.PyString.atoi(PyString.java:2978)
at org.python.core.PyString.__int__(PyString.java:1053)
at org.python.core.PyInteger.asPyInteger(PyInteger.java:127)
at org.python.core.PyInteger.int_new(PyInteger.java:75)
at org.python.core.PyInteger$exposed___new__.new_impl(Unknown Source)
at org.python.core.PyType.invokeNew(PyType.java:1119)
at org.python.core.PyType.type___call__(PyType.java:2399)
at org.python.core.PyType.__call__(PyType.java:2389)
at org.python.core.PyObject.__call__(PyObject.java:461)
at org.python.core.PyObject.__call__(PyObject.java:465)
at pycript.gethelpers$py.bytes_to_string$4(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-main/pycript/gethelpers.py:26)
at pycript.gethelpers$py.call_function(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-main/pycript/gethelpers.py)
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyBaseCode.call(PyBaseCode.java:134)
at org.python.core.PyFunction.__call__(PyFunction.java:416)
at pycript.decryption$py.Parameterdecrypt$1(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-main/pycript/decryption.py:14)
at pycript.decryption$py.call_function(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-main/pycript/decryption.py)
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyBaseCode.call(PyBaseCode.java:187)
at org.python.core.PyFunction.__call__(PyFunction.java:449)
at pycript.Reqcheck$py.DecryptRequest$2(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-main/pycript/Reqcheck.py:67)
at pycript.Reqcheck$py.call_function(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-main/pycript/Reqcheck.py)
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyBaseCode.call(PyBaseCode.java:168)
at org.python.core.PyFunction.__call__(PyFunction.java:437)
at pycript.Requesttab$py.setMessage$6(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-main/pycript/Requesttab.py:60)
at pycript.Requesttab$py.call_function(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-main/pycript/Requesttab.py)
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyBaseCode.call(PyBaseCode.java:306)
at org.python.core.PyBaseCode.call(PyBaseCode.java:197)
at org.python.core.PyFunction.__call__(PyFunction.java:485)
at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:237)
at org.python.core.PyMethod.__call__(PyMethod.java:228)
at org.python.core.PyMethod.__call__(PyMethod.java:218)
at org.python.core.PyMethod.__call__(PyMethod.java:213)
at org.python.core.PyObject._jcallexc(PyObject.java:3565)
at org.python.core.PyObject._jcall(PyObject.java:3598)
at org.python.proxies.pycript.Requesttab$CriptInputTab$2.setMessage(Unknown Source)
at burp.Zqy.setRequestResponse(Unknown Source)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at burp.Zj6m.invoke(Unknown Source)
at jdk.proxy2/jdk.proxy2.$Proxy100.setRequestResponse(Unknown Source)
at burp.Zebv.Zp(Unknown Source)
at burp.Zdwz.Zi(Unknown Source)
at burp.Zdqg.ZY(Unknown Source)
at burp.Zlk8.ZB(Unknown Source)
at burp.Zlk8.Zc(Unknown Source)
at burp.Zil8.ZM(Unknown Source)
at burp.Zil8.ZY(Unknown Source)
at burp.Zil8.ZD(Unknown Source)
at burp.Zil8.lambda$configureViewControls$10(Unknown Source)
at java.desktop/javax.swing.JTabbedPane.fireStateChanged(JTabbedPane.java:446)
at java.desktop/javax.swing.JTabbedPane$ModelListener.stateChanged(JTabbedPane.java:297)
at java.desktop/javax.swing.DefaultSingleSelectionModel.fireStateChanged(DefaultSingleSelectionModel.java:148)
at java.desktop/javax.swing.DefaultSingleSelectionModel.setSelectedIndex(DefaultSingleSelectionModel.java:79)
at java.desktop/javax.swing.JTabbedPane.setSelectedIndexImpl(JTabbedPane.java:650)
at java.desktop/javax.swing.JTabbedPane.setSelectedIndex(JTabbedPane.java:625)
at java.desktop/javax.swing.plaf.basic.BasicTabbedPaneUI$Handler.mousePressed(BasicTabbedPaneUI.java:4140)
at com.formdev.flatlaf.ui.FlatTabbedPaneUI$Handler.mousePressed(FlatTabbedPaneUI.java:2697)
at java.desktop/java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:287)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6618)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3398)
at java.desktop/java.awt.Component.processEvent(Component.java:6386)
at java.desktop/java.awt.Container.processEvent(Container.java:2266)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4996)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4828)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4572)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4828)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:775)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:98)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:747)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:744)
at burp.Zse2.dispatchEvent(Unknown Source)
at burp.Zsep.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
How to solve this error problem?
This is a known issue and should be fixed in a newer version.
For now, if you are using PyCript from the Burp BAPP store, instead of that, download this version - https://github.com/Anof-cyber/PyCript/archive/refs/heads/24-im-also-having-problems-with-clicking-on-pycript.zip - i have added a temp fix which should work
Thank you very much for providing the solution, I was able to decrypt the plaintext message using this version of PyCript you gave me, but a new problem has arisen as well, the problem is as follows: The first problem is that some special characters are inexplicably added to the decrypted plaintext message.
The second problem is that the plaintext data decrypted in the response packet does not display Chinese properly
During this time error in PyCript logged the following error message
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:744)
at burp.Zse2.dispatchEvent(Unknown Source)
at burp.Zsep.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Traceback (most recent call last):
File "D:\DawnLauncher-1.4.7\Tools\ProxyTools\Burpsuite\Plug\PyCript-24-im-also-having-problems-with-clicking-on-pycript\pycript\Requesttab.py", line 70, in getMessage
output = EncryptRequest(self._extender,editabedbyte,req)
File "D:\DawnLauncher-1.4.7\Tools\ProxyTools\Burpsuite\Plug\PyCript-24-im-also-having-problems-with-clicking-on-pycript\pycript\Reqcheck.py", line 23, in EncryptRequest
encryptedvalue, updated_header = Parameterencrypt(selectedlang, encryptionpath, body,headers_str)
File "D:\DawnLauncher-1.4.7\Tools\ProxyTools\Burpsuite\Plug\PyCript-24-im-also-having-problems-with-clicking-on-pycript\pycript\encryption.py", line 11, in Parameterencrypt
body, header = result
TypeError: 'NoneType' object is not iterable
at org.python.core.Py.TypeError(Py.java:234)
at org.python.core.PyObject.__iter__(PyObject.java:837)
at org.python.core.Py.unpackSequence(Py.java:2324)
at pycript.encryption$py.Parameterencrypt$1(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-24-im-also-having-problems-with-clicking-on-pycript/pycript/encryption.py:15)
at pycript.encryption$py.call_function(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-24-im-also-having-problems-with-clicking-on-pycript/pycript/encryption.py)
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyBaseCode.call(PyBaseCode.java:187)
at org.python.core.PyFunction.__call__(PyFunction.java:449)
at pycript.Reqcheck$py.EncryptRequest$1(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-24-im-also-having-problems-with-clicking-on-pycript/pycript/Reqcheck.py:33)
at pycript.Reqcheck$py.call_function(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-24-im-also-having-problems-with-clicking-on-pycript/pycript/Reqcheck.py)
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyBaseCode.call(PyBaseCode.java:168)
at org.python.core.PyFunction.__call__(PyFunction.java:437)
at pycript.Requesttab$py.getMessage$7(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-24-im-also-having-problems-with-clicking-on-pycript/pycript/Requesttab.py:75)
at pycript.Requesttab$py.call_function(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-24-im-also-having-problems-with-clicking-on-pycript/pycript/Requesttab.py)
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyBaseCode.call(PyBaseCode.java:306)
at org.python.core.PyBaseCode.call(PyBaseCode.java:197)
at org.python.core.PyFunction.__call__(PyFunction.java:485)
at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:237)
at org.python.core.PyMethod.__call__(PyMethod.java:228)
at org.python.core.PyMethod.__call__(PyMethod.java:218)
at org.python.core.PyMethod.__call__(PyMethod.java:213)
at org.python.core.PyObject._jcallexc(PyObject.java:3565)
at org.python.core.PyObject._jcall(PyObject.java:3598)
at org.python.proxies.pycript.Requesttab$CriptInputTab$2.getMessage(Unknown Source)
at burp.Zqy.getRequest(Unknown Source)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at burp.Zj6m.invoke(Unknown Source)
at jdk.proxy2/jdk.proxy2.$Proxy100.getRequest(Unknown Source)
at burp.Zez2.Zg(Unknown Source)
at burp.Zs5g.Zh(Unknown Source)
at burp.Zebv.Zc(Unknown Source)
at burp.Zebv.ZX(Unknown Source)
at burp.Zdqg.ZqK(Unknown Source)
at burp.Zdqg.ZqR(Unknown Source)
at burp.Zil4.Zbr(Unknown Source)
at java.base/java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:891)
at burp.Zdsb.Zg(Unknown Source)
at burp.Zp1k.ZZ(Unknown Source)
at burp.Zsk5.Zd(Unknown Source)
at burp.Zsk5.ZZ(Unknown Source)
at burp.Zldt.ZC(Unknown Source)
at burp.Zldt.Zo(Unknown Source)
at burp.Zldt.lambda$scheduleRefresh$12(Unknown Source)
at burp.Zhgy.run(Unknown Source)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Traceback (most recent call last):
File "D:\DawnLauncher-1.4.7\Tools\ProxyTools\Burpsuite\Plug\PyCript-24-im-also-having-problems-with-clicking-on-pycript\pycript\Requesttab.py", line 70, in getMessage
output = EncryptRequest(self._extender,editabedbyte,req)
File "D:\DawnLauncher-1.4.7\Tools\ProxyTools\Burpsuite\Plug\PyCript-24-im-also-having-problems-with-clicking-on-pycript\pycript\Reqcheck.py", line 23, in EncryptRequest
encryptedvalue, updated_header = Parameterencrypt(selectedlang, encryptionpath, body,headers_str)
File "D:\DawnLauncher-1.4.7\Tools\ProxyTools\Burpsuite\Plug\PyCript-24-im-also-having-problems-with-clicking-on-pycript\pycript\encryption.py", line 11, in Parameterencrypt
body, header = result
TypeError: 'NoneType' object is not iterable
at org.python.core.Py.TypeError(Py.java:234)
at org.python.core.PyObject.__iter__(PyObject.java:837)
at org.python.core.Py.unpackSequence(Py.java:2324)
at pycript.encryption$py.Parameterencrypt$1(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-24-im-also-having-problems-with-clicking-on-pycript/pycript/encryption.py:15)
at pycript.encryption$py.call_function(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-24-im-also-having-problems-with-clicking-on-pycript/pycript/encryption.py)
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyBaseCode.call(PyBaseCode.java:187)
at org.python.core.PyFunction.__call__(PyFunction.java:449)
at pycript.Reqcheck$py.EncryptRequest$1(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-24-im-also-having-problems-with-clicking-on-pycript/pycript/Reqcheck.py:33)
at pycript.Reqcheck$py.call_function(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-24-im-also-having-problems-with-clicking-on-pycript/pycript/Reqcheck.py)
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyBaseCode.call(PyBaseCode.java:168)
at org.python.core.PyFunction.__call__(PyFunction.java:437)
at pycript.Requesttab$py.getMessage$7(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-24-im-also-having-problems-with-clicking-on-pycript/pycript/Requesttab.py:75)
at pycript.Requesttab$py.call_function(D:/DawnLauncher-1.4.7/Tools/ProxyTools/Burpsuite/Plug/PyCript-24-im-also-having-problems-with-clicking-on-pycript/pycript/Requesttab.py)
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyBaseCode.call(PyBaseCode.java:306)
at org.python.core.PyBaseCode.call(PyBaseCode.java:197)
at org.python.core.PyFunction.__call__(PyFunction.java:485)
at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:237)
at org.python.core.PyMethod.__call__(PyMethod.java:228)
at org.python.core.PyMethod.__call__(PyMethod.java:218)
at org.python.core.PyMethod.__call__(PyMethod.java:213)
at org.python.core.PyObject._jcallexc(PyObject.java:3565)
at org.python.core.PyObject._jcall(PyObject.java:3598)
at org.python.proxies.pycript.Requesttab$CriptInputTab$2.getMessage(Unknown Source)
at burp.Zqy.getRequest(Unknown Source)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at burp.Zj6m.invoke(Unknown Source)
at jdk.proxy2/jdk.proxy2.$Proxy100.getRequest(Unknown Source)
at burp.Zez2.Zg(Unknown Source)
at burp.Zs5g.Zh(Unknown Source)
at burp.Zebv.Zc(Unknown Source)
at burp.Zebv.ZX(Unknown Source)
at burp.Zdqg.ZqK(Unknown Source)
at burp.Zdqg.Zqx(Unknown Source)
at burp.Zil4.Zbr(Unknown Source)
at java.base/java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:891)
at burp.Zdsb.Zg(Unknown Source)
at burp.Zp1k.ZZ(Unknown Source)
at burp.Zsk5.Zd(Unknown Source)
at burp.Zsk5.ZZ(Unknown Source)
at burp.Zldt.ZC(Unknown Source)
at burp.Zldt.Zo(Unknown Source)
at burp.Zldt.lambda$scheduleRefresh$12(Unknown Source)
at burp.Zhgy.run(Unknown Source)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)