WINNING FACTORS

Overview

“Winning Factors” by syyntax is a speed scripting task. Connect to a remote server, parse a factorial prompt, compute the answer, and reply within 3 seconds — repeatedly — until the flag appears.

Provided Information

No files provided. Interact directly with the remote service and solve on the fly.

Python — socket client for factorial prompts
import socket
import re
from math import factorial

def calculate_factorial(n):
    try:
        return factorial(n)
    except ValueError as e:
        print(f"Error calculating factorial: {e}")
        return None

def connect_and_solve():
    host = "147.182.245.126"
    port = 33001

    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.settimeout(5)
    s.connect((host, port))

    try:
        while True:
            data = s.recv(1024).decode().strip()
            if not data:
                continue

            print(f"Received: '{data}'")

            if "flag{" in data:
                print("Found flag:", data)
                break

            number_match = re.search(r'factorial of (\d+)\.?', data)
            if number_match:
                number = int(number_match.group(1))
                answer = calculate_factorial(number)

                if answer is not None:
                    response = str(answer)
                    print(f"Sending answer: {response}")
                    s.send(response.encode())

                    feedback = s.recv(1024).decode().strip()
                    print(f"Server response: '{feedback}'")

    except socket.timeout:
        print("Socket timeout occurred")
    except Exception as e:
        print(f"Error occurred: {e}")
    finally:
        s.close()

if __name__ == "__main__":
    connect_and_solve()
Flag
flag{1ntr0_f4ct0r14l_5t3p}
> Back to DEADFACE > Explore Blogs
``` Notes - Styles come from CSS/challenge.css (already provided). No new CSS needed. - Breadcrumbs and links match your structure. - Includes copy buttons for the Python code and the flag.