SPIDER1CODE
Open in Telegram
Spider1Code is the first Arab community that brings together cybersecurity artificial intelligence, and more ✨🤍
Show more1 753
Subscribers
-324 hours
-87 days
-3830 days
Posts Archive
1 753
اهلا و سهلا بك عزيز او عزيزتي في
Spider1Ctf
قدرت اعمل تشكيله جميله من تحديات صنعتها بنفسي منها الصعب جدا و منها سهل جدا و كل تحدي معا ملف .txt يشرح تحدي او حتا هنت 👀💥
مده ctf من وقت نزول اعلان دا ليوم الجمعه الساعه 12 بتوقيت مصر و اول ما مسابقه تخلص هنطلع لايف مع فائزين نشرح حل تحديات 🏆
كان الله معكم و في عونكم ❤️
Welcome, challengers, to
Spider1CTF!I’ve prepared a diverse collection of challenges crafted entirely by myself — some extremely difficult and others very beginner-friendly. Each challenge comes with a .txt file containing a description or even a hint 👀💥 The CTF will run from the moment this announcement is posted until Friday at 12:00 PM (Egypt time). Once the competition ends, we’ll go live with the winners to walk through the solutions together 🏆 Wishing you all strength, focus, and a bit of luck ❤️ ارسل العلم لي : @Spider1Security Send flag to : @Spider1Security
1 753
طيب لاسبوع الجاي هيكون بدايه ctf عايز كل يكون جاهز 🏆✌🏻
خد حط دا في cmd او ترمنال عندك و قولي شوفت اي 😂
ssh -o StrictHostKeyChecking=no watch.ascii.theater
1 753
عايز اقول خبر مش جميل بخصوص ctf الي هعلمها بعد تفكير كتير مش لقيت منصه كويسه اقدر استعلمها كا سيرفر فا ctf هتكون كريبتو و ريفيرس و فرونزيكس
طيب هل ليها جوائز ؟
لاشخاص الي قدرت تحل هنطلع كلنا لايف ب اذن الله يوم جمعه و نشارك معاكم طرق حل
طيب مواعيد امتا ؟
هنزل كل حاجه قريب بحيث ان فكره تكون جاهزه اول ب اول
طيب ازاي نقدر ندخل تحديات ؟
تحديات هتنزل هنا علي قناه تلجرام و مجتمع فقط !!!
ولو حد عندو اي استفسار يقدر يسيب كومنت و هرد علي ❤️
1 753
Thanks to EC-Council for inviting me to HACKERVERSE. I hope this won’t be our last collaboration. Thank you for the wonderful CTF competition ❤️🏆
1 753
الحمدالله حمدا كثيره طيب به قدرت احل تحدي
CyberTalents / cryptography/ giga-chad
عدد الي حلو تحدي : 10
و دا رايتب :
https://spider1sec.medium.com/cybertalents-cryptography-giga-chad-f1db97b3e8f4?postPublishedType=repub
1 753
حاسس اني بغتت عليكم بس رايتب دول مهمين والله
الحمدالله طبعا قدرت احل تحدي
Red Stone Admin
1 753
الحمدالله حمدا كثيرا طيبا مباركا فيه
قدرت احل تحدي play nice picoctf و دا رايتب بتاعو :
1 753
#!/usr/bin/env python3
import socket
import time
SQUARE_SIZE = 6
def generate_square(alphabet):
"""Convert alphabet string into a 6x6 matrix."""
matrix = []
for i, letter in enumerate(alphabet):
if i % SQUARE_SIZE == 0:
row = []
row.append(letter)
if i % SQUARE_SIZE == (SQUARE_SIZE - 1):
matrix.append(row)
return matrix
def get_index(letter, matrix):
"""Find row and column index of a letter in the matrix."""
for row in range(SQUARE_SIZE):
for col in range(SQUARE_SIZE):
if matrix[row][col] == letter:
return (row, col)
return None
def decrypt_pair(pair, matrix):
"""Decrypt a pair of characters using Playfair rules."""
p1 = get_index(pair[0], matrix)
p2 = get_index(pair[1], matrix)
if p1[0] == p2[0]: # Same row - shift left
return matrix[p1[0]][(p1[1] - 1) % SQUARE_SIZE] + \
matrix[p2[0]][(p2[1] - 1) % SQUARE_SIZE]
elif p1[1] == p2[1]: # Same column - shift up
return matrix[(p1[0] - 1) % SQUARE_SIZE][p1[1]] + \
matrix[(p2[0] - 1) % SQUARE_SIZE][p2[1]]
else: # Rectangle - swap columns
return matrix[p1[0]][p2[1]] + matrix[p2[0]][p1[1]]
def decrypt_string(s, matrix):
"""Decrypt entire message by processing pairs."""
result = ""
for i in range(0, len(s), 2):
result += decrypt_pair(s[i:i + 2], matrix)
return result
# Connect to server
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("mercury.picoctf.net", 19354))
time.sleep(0.5)
# Receive challenge
response = sock.recv(1024).decode()
# Parse response
lines = response.strip().split('\n')
alphabet = lines[0].split("alphabet: ")[1]
encrypted = lines[1].split("encrypted message: ")[1]
# Decrypt
matrix = generate_square(alphabet)
plaintext = decrypt_string(encrypted, matrix)
# Remove padding if present
padding_char = alphabet[0]
plaintext = plaintext.rstrip(padding_char)
print(f"Plaintext: {plaintext}")
# Submit answer
sock.send((plaintext + "\n").encode())
time.sleep(1)
# Receive flag
flag_response = sock.recv(2048).decode()
print(flag_response)
sock.close()
---
## Key Insights
1. 6×6 Matrix Variant: The challenge uses a 6×6 matrix instead of the traditional 5×5, expanding the keyspace to 36 characters.
2. Non-standard Flag Format: The plaintext doesn't look like a typical flag (picoCTF{...}) but is the actual answer. The description "The flag is not in standard format" hints at this.
3. Symmetric Decryption: To reverse Playfair encryption:
- Same row pairs: Shift LEFT (not right)
- Same column pairs: Shift UP (not down)
- Rectangle pairs: Column swap remains the same
4. Padding Character: The first character of the alphabet is used for padding odd-length messages.
5. Modulo Arithmetic: Wraparound is handled using modulo to ensure indices stay within bounds.
---
## Flag
dbc8bf9bae7152d35d3c200c46a0fa30--- ## References - [Playfair Cipher - Wikipedia](https://en.wikipedia.org/wiki/Playfair_cipher) - [Classical Cryptography](https://en.wikipedia.org/wiki/Classical_cipher) - [PicoCTF Challenges](https://picoctf.org/) --- ## Challenge Analysis | Aspect | Details | |--------|---------| | Cipher Type | Playfair (6×6 variant) | | Keyspace | 36! possible alphabets | | Message Length | 30 characters (15 pairs) | | Attack Method | Direct decryption (no brute force needed) | | Time to Solve | ~5 minutes | | Difficulty | high | The challenge demonstrates that while classical ciphers like Playfair are no longer secure by modern standards, understanding their mechanics is valuable for cryptographic education and CTF participation.
1 753
# Playfair Cipher CTF Writeup
## Challenge Overview
Challenge Name: Playfair (Ancient Ciphers)
Challenge Type: Cryptography
Server:
nc mercury.picoctf.net 19354
Difficulty: High
Description: "Not all ancient ciphers were so bad... The flag is not in standard format."
## Challenge Description
This is a Playfair cipher challenge that runs on a remote server. The server:
1. Provides a randomly generated 36-character alphabet
2. Provides an encrypted message using that alphabet
3. Expects the solver to decrypt the message and return the plaintext
4. Returns a flag upon successful decryption
Key Twist: The challenge uses a 6×6 Playfair variant instead of the traditional 5×5, and the plaintext doesn't follow the standard picoCTF{...} format.
---
## Understanding the Playfair Cipher
### Traditional Playfair (5×5)
The Playfair cipher is a classical symmetric encryption method that:
- Uses a 5×5 matrix (25 characters) containing a mixed alphabet
- Encrypts plaintext in pairs of characters (digraphs)
- Applies different rules based on character positions:
1. Same Row: Shift each character right (with wraparound)
2. Same Column: Shift each character down (with wraparound)
3. Rectangle: Swap columns (each takes the other's column in the same row)
### This Challenge's Variant (6×6)
This CTF uses a 6×6 matrix with 36 characters (letters, numbers, and special characters), making it a larger keyspace than traditional Playfair.
#### Encryption Example (6×6)
Alphabet: n5vgru7ehz1klja8s9340m2wcxbd6pqfitoy Matrix: n 5 v g r u 7 e h z 1 k l j a 8 s 9 3 4 0 m 2 w c x b d 6 p q f i t o y Message: "hitherefriend" Plaintext pairs: hi|th|er|ef|ri|en|dn (padded with 'n') Encryption result: av|iz|15|j5|vo|75|cg--- ## Solution Approach ### Step 1: Connect to Server
nc mercury.picoctf.net 19354
Server Output:
Here is the alphabet: n5vgru7ehz1klja8s9340m2wcxbd6pqfitoy Here is the encrypted message: hnjm2e4t51v16gsg104i4oi9wmrqli What is the plaintext message?### Step 2: Parse the Challenge Extract from the server response: - Alphabet:
n5vgru7ehz1klja8s9340m2wcxbd6pqfitoy (36 characters)
- Encrypted Message: hnjm2e4t51v16gsg104i4oi9wmrqli (30 characters)
- Matrix Size: 6×6
### Step 3: Implement Decryption
The decryption process reverses encryption:
- Same Row: Shift each character left (opposite of right)
- Same Column: Shift each character up (opposite of down)
- Rectangle: Swap columns (same as encryption)
def decrypt_pair(pair, matrix):
p1 = get_index(pair[0], matrix) # Get row, col of first char
p2 = get_index(pair[1], matrix) # Get row, col of second char
if p1[0] == p2[0]: # Same row
# Shift left with wraparound
return matrix[p1[0]][(p1[1] - 1) % SQUARE_SIZE] + \
matrix[p2[0]][(p2[1] - 1) % SQUARE_SIZE]
elif p1[1] == p2[1]: # Same column
# Shift up with wraparound
return matrix[(p1[0] - 1) % SQUARE_SIZE][p1[1]] + \
matrix[(p2[0] - 1) % SQUARE_SIZE][p2[1]]
else: # Rectangle - swap columns
return matrix[p1[0]][p2[1]] + matrix[p2[0]][p1[1]]
### Step 4: Decrypt the Message
alphabet = "n5vgru7ehz1klja8s9340m2wcxbd6pqfitoy"
encrypted = "hnjm2e4t51v16gsg104i4oi9wmrqli"
matrix = generate_square(alphabet)
plaintext = decrypt_string(encrypted, matrix)
# Result: 7v8441mfrerhdr8rh20f2fya20noaq
### Step 5: Handle Padding and Submit
The plaintext may be padded with the first character of the alphabet. Remove if necessary and submit:
padding_char = alphabet[0] # 'n'
if plaintext.endswith(padding_char):
plaintext = plaintext.rstrip(padding_char)
# Submit: 7v8441mfrerhdr8rh20f2fya20noaq
### Step 6: Receive Flag
Congratulations! Here's the flag: dbc8bf9bae7152d35d3c200c46a0fa30--- ## Complete Solution Script
