Skip to main content

cybergrabs2022-rev

CUSTOM CIPHER  

Solution

We are provided a .pyc file which is a compiled python file we can't read it in plain text but there is an amazing tool online 

https://www.toolnb.com/tools-lang-en/pyc.html


Using this website I found the python code behind the file 


So, encryption function:

def encode_secret(secret):

    rotate_const = 37

    encoded = ''

    for c in secret:

        index = alphabet.find(c)

        original_index = (index + rotate_const) % len(alphabet)

        encoded = encoded + alphabet[original_index]


    return encoded


We need to decrypt this so I wrote a small decryption function


You can even try it by yourselves 

code:


for i in encoded_flag:
  temp=alphabet.index(i)-37
  while(temp<0):
    temp+=len(alphabet)
  print(alphabet[temp],end='')

FLAG: cybergrabs{yOU_FounD_7H3_SHIfT_c1PheR}



Comments

Popular posts from this blog

GET STARTED WITH SQLMAP

sqlmap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of database servers. learn more...   So lets know how to use it....... Lets start with installation   FOR WINDOWS:                  In the official website of sqlmap we are provided with a zip file. Download it by clicking on it                 Extract it into a desired directory and you must have gotten a python file named sqlmap.py.                                                              So if you already have python installed in your machine continue and use command line python3  <path_to_sqlmap.py> <required_parameters>                           FOR LINUX:                          Most of the Linux machines already have sqlmap prebuilt                          If not, type in the following command in you terminal                                         $ sudo apt install sqlmap Now we have everything. So lets get into it.....