Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
zha0cai committed Jun 20, 2024
1 parent 92d02c3 commit f73b124
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.owasp.webgoat.lessons.cryptography.mytest;

public class PathChecker {
public static void main(String[] args) {
String path = "..%2Fetc/passwd";
System.out.println("Path: " + path);

for (int i = 0; i < path.length(); i++) {
System.out.println("Character at index " + i + ": " + (int) path.charAt(i));
}

if (!path.contains("./")) {
System.out.println("Path does not contain './'");
} else {
System.out.println("Path contains './'");
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ public static void main(String[] args) {
// System.out.printf("Key: 0x%02X -> Decoded String: %s%n", key, decodedStr);
// }
}

// String path = "../../etc/passwd";
// if (!path.contains("./")) {
// System.out.println("Path does not contain './'");
// } else {
// System.out.println("Path contains './'");
// }
}

private static byte[] xorDecode(byte[] dataBytes, byte key) {
Expand Down

0 comments on commit f73b124

Please sign in to comment.