PyCript icon indicating copy to clipboard operation
PyCript copied to clipboard

No result when click PyCript

Open Dejavu610 opened this issue 8 months ago • 14 comments

Have you gone through the Documentation or Video Tutorial

  • Documentation - https://pycript.souravkalal.tech/
  • Video - https://youtu.be/J8KE5VR8yDk?si=yr4XqqwWh5ms7O6s
  • [Y/N] - Y

Describe the bug When I click PyScript, the page stays blank, although the logs look correct. Also, it takes a long time to switch to PyScript.

To Reproduce Steps to reproduce the behavior:

  1. Choose encryption and decryption file for request.
  2. Add http://192.168.0.1/ to scope
  3. Capture http package,
  4. Click pycriypt in history's request.

Screenshots

Image

Image

Image

Desktop (please complete the following information):

  • OS: [e.g.Windows11]
  • BurpSuite Version [2025.1.1]
  • PyCript Version [1.0]

Add any other context about the problem here.

Dejavu610 avatar Apr 10 '25 23:04 Dejavu610

Can you check few points?

  • Any errors in PyCript Log Tab?
  • Navigate to Extesion Tab in Burp Suite Select PyCript and check any error message in PyCript
  • Can you show the PyCript Config Tab
  • Can you confirm if you can manually run your encryption decryption scrpt outside PyCript from CMD/Terminal

Anof-cyber avatar Apr 11 '25 08:04 Anof-cyber

Can you check few points?

  • Any errors in PyCript Log Tab? No, there is no errors. I've attached logs and the log shows that the decrypted original_text is right.

Image

  • Navigate to Extesion Tab in Burp Suite Select PyCript and check any error message in PyCript Yes. There is a ValueError.This may be help. Image
  • Can you show the PyCript Config Tab

Image

  • Can you confirm if you can manually run your encryption decryption scrpt outside PyCript from CMD/Terminal I guess the decryption script is ok cause the printed plaintext is right?

Dejavu610 avatar Apr 11 '25 19:04 Dejavu610

Can you confirm what data type your decryption python code write to file.

Can you confirm its byte array and not string or other output.

Anof-cyber avatar Apr 11 '25 19:04 Anof-cyber

Can you confirm what data type your decryption python code write to file. The data type is <class 'int'>. The following is my script and log:

Image

Image

Can you confirm its byte array and not string or other output. so the problem is it should be byte not int?

Dejavu610 avatar Apr 11 '25 21:04 Dejavu610

Seems like extension is unable to convert the byte array to string again. In your python script can you remove .decode(utf8) for updated output byte variable

If that still raise error, the issue is with the extension, there seems to be multiple issues for byte string conversion.

Anof-cyber avatar Apr 12 '25 10:04 Anof-cyber

You can try a temp fixed version of PyCript from below branch

https://github.com/Anof-cyber/PyCript/tree/ASCII-Error

Anof-cyber avatar Apr 12 '25 10:04 Anof-cyber

You can try a temp fixed version of PyCript from below branch

https://github.com/Anof-cyber/PyCript/tree/ASCII-Error

Both ways cannot work. Remove .decode(utf8) will raise error.

Image

May I know what type I should output? Mine is a list containing integers.

Image

Dejavu610 avatar Apr 14 '25 20:04 Dejavu610

I printed the byte_data_clean in gethelpers.py:

Image

Image

It seems like the file wasn't read or parsed correctly.

Dejavu610 avatar Apr 14 '25 20:04 Dejavu610

Okay, i see there is error from extension or script to split body and headers.

  • Can you confirm the body end marker variable in your script.
  • Can you edit the https://github.com/Anof-cyber/PyCript/blob/221b91e0b14cc2cba970c5668dbfcce791b4a8a6/pycript/temp_file.py#L24 and print the body and confirm if after split body contains header or split has any errors.

I have validated with demo python scripts, extension is able to split body and headers perfectly.

Anof-cyber avatar Apr 14 '25 21:04 Anof-cyber

Okay, i see there is error from extension or script to split body and headers.

  • Can you confirm the body end marker variable in your script.

Image

  • Can you edit the

      [PyCript/pycript/temp_file.py](https://github.com/Anof-cyber/PyCript/blob/221b91e0b14cc2cba970c5668dbfcce791b4a8a6/pycript/temp_file.py#L24)
    
    
         Line 24
      in
      [221b91e](/Anof-cyber/PyCript/commit/221b91e0b14cc2cba970c5668dbfcce791b4a8a6)
    
    
    
    
    
    
    
           body_data = parts[0] 
    

    and print the body and confirm if after split body contains header or split has any errors.

Image

Image The body_data seems right

Dejavu610 avatar Apr 15 '25 18:04 Dejavu610

Can you confirm the same with.

https://github.com/Anof-cyber/PyCript/blob/221b91e0b14cc2cba970c5668dbfcce791b4a8a6/pycript/decryption.py#L11

Anof-cyber avatar Apr 15 '25 18:04 Anof-cyber

Yes. it is same

Image

Dejavu610 avatar Apr 16 '25 22:04 Dejavu610

Sorry. I think the body_data didn't split in PyCript/pycript/temp_file.py The body_data still contains body_end_marker and headers: Image

Dejavu610 avatar Apr 16 '25 22:04 Dejavu610

I find the root cuase. I changed the body_end_marker = b'\r\n--BODY_END--\r\n', then it worked. Thank you very much for your help.

Image

Dejavu610 avatar Apr 16 '25 23:04 Dejavu610