Hello World \o/
  • 👾ENCONTRASTE MIS WRITEUPS
  • 🟣 MAQUINAS VULNERADAS
    • Vulnhub
      • Darkhole: 2
      • Symfonos 1
      • Symfonos 2
      • ICA: 1
      • Corrosion 2
      • Venom 1
      • Corrosion 1
    • HackTheBox
      • Return
      • Horizontall
      • Validation
      • Love
      • Nodeblog
      • NunChucks
      • Lame
      • Legacy
      • Knife
    • PortSwigger
      • Blind Sqli
  • 🟣 CTFS
    • Bandit
    • Baby Encription
    • Primed for Action
  • 🟣 BUG BOUNTIES
    • Open Redirect
  • 🟣 SCRIPTS
    • I Found You
  • 🟣 PROYECTOS
    • Landing Page
    • Face Tracker
  • 🟣 SOBRE MI
    • Contactame
Powered by GitBook
On this page
  1. 🟣 CTFS

Primed for Action

Platform: HTB.

Mission: Found the key trying to use only prime numbers.

“Intelligence units have intercepted a list of numbers. They seem to be used in a peculiar way — the adversary seems to be sending a list of numbers, most of which are garbage, but two of which are prime. These 2 prime numbers appear to form a key, which is obtained by multiplying the two. Find the key and help us solve the case.”

El codigo que utilice para resolverlo:

// 
# Function to check if a number is prime
def is_prime(num):
    if num <= 1:
        return False
    for i in range(2, int(num ** 0.5) + 1):
        if num % i == 0:
            return False
    return True

# Take input as a string of space-separated numbers
n = input()

# Convert the input into a list of integers
numbers = list(map(int, n.split()))

# Find prime numbers in the list
prime_numbers = [num for num in numbers if is_prime(num)]

# If exactly two prime numbers are found, calculate their product
if len(prime_numbers) == 2:
    product = prime_numbers[0] * prime_numbers[1]
    print(product)
else:
    print("Not enough prime numbers in the list.")

Ejecutas el Script y tendrias la flag.

PreviousBaby EncriptionNextOpen Redirect

Last updated 12 days ago