Skip to content

FeeeDz/Two-Truths-and-a-Fib-DawgCTF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Two Truths and a Fib

The challenge gives us 3 numbers and we have to say which of these is from the fibonacci series.

fib1

I wrote this python script to solve the task

from pwn import *

def controllo(n):
    c=0
    a=1
    b=1
    if n==0 or n==1:
        print("Yes")
    else:
        while c<n:
            c=a+b
            b=a
            a=c
        if c==n:
            return True
        else:
            return False

r = remote("umbccd.io", 6000)

for i in range(0,100):
    r.recvuntil("[")
    numeri = []
    numeri = r.recvline().split()
    numeri[0] = numeri[0][:-1]
    numeri[1] = numeri[1][:-1]
    numeri[2] = numeri[2][:-1]
    for i in range(0,3):
        if controllo(int(numeri[i])) == True:
            r.sendline(bytes(numeri[i]))
        else:
            continue

r.interactive()

Flag:

DawgCTF{jU$T_l1k3_w3lc0me_w33k}

About

Solution for the task Two Truths and a Fib from DawgCTF 2021

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages