Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- # Function to find CTF patterns in a file
- def find_ctf_patterns(filename):
- try:
- with open(filename, 'r') as file:
- content = file.read()
- ctf_patterns = re.findall(r'NOON_CTF{[^}]+}', content)
- return ctf_patterns
- except FileNotFoundError:
- print(f"Error: File '{filename}' not found.")
- return []
- def main():
- # File containing the CTF patterns
- filename = 'CTF_Match.txt'
- # Find CTF patterns in the file
- ctf_patterns = find_ctf_patterns(filename)
- # Display the CTF patterns found in the file (if any)
- if ctf_patterns:
- print("Found the following CTF patterns:")
- for pattern in ctf_patterns:
- print(pattern)
- else:
- print("No CTF patterns found in the file.")
- if __name__ == "__main__":
- main()
Add Comment
Please, Sign In to add comment