File tree 6 files changed +18
-11
lines changed
src/main/java/com/pycriptsocket
6 files changed +18
-11
lines changed Original file line number Diff line number Diff line change 3
3
# #############################
4
4
.mtj.tmp /
5
5
* .class
6
- * .jar
6
+
7
7
* .war
8
8
* .ear
9
9
* .nar
Original file line number Diff line number Diff line change @@ -10,19 +10,21 @@ public ByteArray decryptAndPassToTempFile(ByteArray content) {
10
10
TempFile tempFile = new TempFile ();
11
11
String tempFilePath = tempFile .processData (decryptedContent );
12
12
13
- // Get the decryption file path from the UI class
14
13
String decryptionFilePath = UI .getInstance ().getDecryptionFilePath ();
15
14
16
- // Call the Execution class to run the system command
17
15
Execution execution = new Execution ();
18
16
boolean success = execution .runCommand (decryptionFilePath , tempFilePath );
19
17
20
18
if (success ) {
21
- // Read the updated content from the temp file
22
19
String updatedContent = tempFile .readFileContent (tempFilePath );
20
+ boolean isDeleted = tempFile .deleteFile (tempFilePath );
21
+ if (isDeleted ) {
22
+ System .out .println ("Temporary file deleted successfully." );
23
+ } else {
24
+ System .out .println ("Failed to delete the temporary file." );
25
+ }
23
26
return ByteArray .byteArray (updatedContent );
24
27
} else {
25
- // Return the original content if the execution was not successful
26
28
return content ;
27
29
}
28
30
}
Original file line number Diff line number Diff line change @@ -9,20 +9,22 @@ public ByteArray encryptAndPassToTempFile(ByteArray content) {
9
9
10
10
TempFile tempFile = new TempFile ();
11
11
String tempFilePath = tempFile .processData (encryptedContent );
12
-
13
- // Get the encryption file path from the UI class
14
12
String encryptionFilePath = UI .getInstance ().getEncryptionFilePath ();
15
13
16
14
// Call the Execution class to run the system command
17
15
Execution execution = new Execution ();
18
16
boolean success = execution .runCommand (encryptionFilePath , tempFilePath );
19
17
20
18
if (success ) {
21
- // Read the updated content from the temp file
22
19
String updatedContent = tempFile .readFileContent (tempFilePath );
20
+ boolean isDeleted = tempFile .deleteFile (tempFilePath );
21
+ if (isDeleted ) {
22
+ System .out .println ("Temporary file deleted successfully." );
23
+ } else {
24
+ System .out .println ("Failed to delete the temporary file." );
25
+ }
23
26
return ByteArray .byteArray (updatedContent );
24
27
} else {
25
- // Return the original content if the execution was not successful
26
28
return content ;
27
29
}
28
30
}
Original file line number Diff line number Diff line change @@ -17,15 +17,13 @@ public class PyCript implements BurpExtension
17
17
@ Override
18
18
public void initialize (MontoyaApi api )
19
19
{
20
- // set extension name
21
20
api .extension ().setName ("PyCript WebSocket" );
22
21
23
22
Logging logging = api .logging ();
24
23
logging .logToOutput ("Author: Sourav Kalal" );
25
24
logging .logToOutput ("VERSION: 0.1" );
26
25
logging .logToOutput ("GitHub - https://github.com/Anof-cyber/PyCript-WebSocket" );
27
26
logging .logToOutput ("Website - https://souravkalal.tech/" );
28
- logging .logToOutput ("Documentation - https://pycript.souravkalal.tech/" );
29
27
api .userInterface ().registerSuiteTab ("PyCript WebSocket" , new UI (api ));
30
28
31
29
api .userInterface ().registerWebSocketMessageEditorProvider (new WebSocketEditorProvider (api ));
Original file line number Diff line number Diff line change @@ -30,4 +30,9 @@ public String readFileContent(String filePath) {
30
30
return null ;
31
31
}
32
32
}
33
+
34
+ public boolean deleteFile (String filePath ) {
35
+ File file = new File (filePath );
36
+ return file .delete ();
37
+ }
33
38
}
You can’t perform that action at this time.
0 commit comments