hgame semana2 Semana3

RE

1, babypy

Bytecode odio dura, generalmente puede analizar la lógica inversa XOR

c = [ 0x7D , 0x03 , 0x7D , 0x04 , 0x57 , 0x17 , 0x72 , 0x2D , 0x62 , 0x11 , 0x4E , 0x6A , 0x5b , 0x04 , 0x4f , 0x2c , 0x18 , 0x4C , 0x3f , 0x44 , 0x21 , 0x4C , 0x2D , 0x4A , 0x22 ]
c.reverse ()
flag = []
 para i en rango (len (c)):
     si i = len (c) - 1 :
        impresión (chr (c [i] ^ c [i + 1 ]), final = '' )
     más :
        imprimir (chr (c [i]))

Obtener la bandera

2, de desempaquetado

Título a su nombre, la mano upx la cáscara, aunque simple, pero Linux es la primera vez fuera

Depuración con ida, f8 no se ejecutan no vuelan f7, hasta

 

 f7 entrar, y luego tiene que f8

 

 Para un salto, f8

 

 Podemos ver el punto de entrada 0x400890, continúe f8

 

 Llegó a la entrada, volcar

#include <idc.idc>
 #define PT_LOAD 1
 #define PT_DYNAMIC 2
 estática principal ( void )
{
         ImageBase automático, StartImg, EndImg;
         e_phoff coche;
         e_phnum auto, p_offset;
         auto i, dumpfile;
         ImageBase = 0x400000 ;
         StartImg = 0x400000 ;
         EndImg = 0x0 ;
         si (DWORD (ImageBase) == 0x7f454c46 || Dword (ImageBase) == 0x464c457f )
  {
     si (dumpfile = fopen ( " G: \\ dumpfile " , " wb " ))
    {
      e_phoff = ImageBase + Qword (ImageBase + 0x20 );
      Mensaje ( " e_phoff = 0x% x \ n " , e_phoff);
      e_phnum = Word (ImageBase + 0x38 );
      Mensaje ( " e_phnum = 0x% x \ n " , e_phnum);
      para (i = 0 ; i <e_phnum; i ++ )
      {
         si (DWORD (e_phoff) == || PT_LOAD Dword (e_phoff) == PT_DYNAMIC)
                         {
                                 p_offset = Qword (e_phoff + 0x8 );
                                 StartImg = Qword (e_phoff + 0x10 );
                                 EndImg = StartImg + Qword (e_phoff + 0x28 );
                                 Mensaje ( " start = 0x% x, final = 0x% x, offset = 0x% x \ n " , StartImg, EndImg, p_offset);
                                 dump (dumpfile, StartImg, EndImg, p_offset);
                                 Mensaje ( " volcado segmento% d ok \ n. " , I);
                         }
         e_phoff = e_phoff + 0x38 ;
      }

      fseek (dumpfile, 0x3C , 0 );
      fputc ( 0x00 , dumpfile);
      fputc ( 0x00 , dumpfile);
      fputc ( 0x00 , dumpfile);
      fputc ( 0x00 , dumpfile);

      fseek (dumpfile, 0x28 , 0 );
      fputc ( 0x00 , dumpfile);
      fputc ( 0x00 , dumpfile);
      fputc ( 0x00 , dumpfile);
      fputc ( 0x00 , dumpfile);
      fputc ( 0x00 , dumpfile);
      fputc ( 0x00 , dumpfile);
      fputc ( 0x00 , dumpfile);
      fputc ( 0x00 , dumpfile);

      fclose (dumpfile);
        } Demás Mensaje ( " err volcado. " );
 }
}
estática volcado (volcado, startimg, endimg, offset)
{
        y el coche;
        tamaño automático;
        tamaño = endimg- startimg;
        fseek (dumpfile, offset, 0 );
        para (i = 0 ; i <tamaño; i = i + 1 )
        {
        fputc (Byte (startimg + i), dumpfile);
        }
}

Mirar por el archivo de volcado, con ida abierta,

 

 La lógica es muy simple, mantenga el guión.

1, crackme

escritura c #, el código de la llave

privada  vacío Button1_Click ( objeto emisor, EventArgs e)
{
    si ( este .status == 1 )
    {
        MessageBox.Show ( " Usted tiene éxito activarlo, ir y presentar la bandera que ~ ~ ~ " );
         de retorno ;
    }
    string text = this.textBox1.Text;
    if (text.Length != 46 || text.IndexOf("hgame{") != 0 || text.IndexOf("}") != 45)
    {
        MessageBox.Show("Illegal format");
        return;
    }
    string base64iv = text.Substring(6, 24);
    string str = text.Substring(30, 15);
    try
    {
        Aes aes = new Aes("SGc0bTNfMm8yMF9XZWVLMg==", base64iv);
        Aes aes2 = new Aes("SGc0bTNfMm8yMF9XZWVLMg==", "MFB1T2g5SWxYMDU0SWN0cw==");
        string text2 = aes.DecryptFromBase64String("mjdRqH4d1O8nbUYJk+wVu3AeE7ZtE9rtT/8BA8J897I=");
        if (text2.Equals("Same_ciphertext_"))
        {
            byte[] array = new byte[16];
            Array.Copy(aes2.EncryptToByte(text2 + str), 16, array, 0, 16);
            if (Convert.ToBase64String(array).Equals("dJntSWSPWbWocAq4yjBP5Q=="))
            {
                MessageBox.Show("注册成功!");
                this.Text = "已激活,欢迎使用!";
                this.status = 1;
            }
            else
            {
                MessageBox.Show("注册失败!\nhint: " + aes2.DecryptFromBase64String("mjdRqH4d1O8nbUYJk+wVu3AeE7ZtE9rtT/8BA8J897I="));
            }
        }
        else
        {
            MessageBox.Show("注册失败!\nhint: " + aes2.DecryptFromBase64String("mjdRqH4d1O8nbUYJk+wVu3AeE7ZtE9rtT/8BA8J897I="));
        }
    }
    catch
    {
        MessageBox.Show("注册失败!");
    }
}

可见又是将输入分为两半,第一部分作为初始向量,使加密后的mjdRqH4d1O8nbUYJk+wVu3AeE7ZtE9rtT/8BA8J897I=变为Same_ciphertext_

第二部分将Same_ciphertext_和第二部分相加后加密为byte后将后十六位转为base64等于dJntSWSPWbWocAq4yjBP5Q==

就第一部分,已经得到了明文,密文,和密钥,根据aes加密的方式,只要将明文作为向量对密文进行解密就可得到真实的初始向量,

第二部分,因为只给了后半部分base64,将其转为十六进制,为了知道前面的部分,我以Same_ciphertext_123456789012345的格式进行加密,从而得到了其前半部分的十六进制,拼在一起后转为base64,再进行aes解密,得到第二部分

拼起来得到flag

hgame{L1R5WFl6UG5ZOyQpXHdlXw==DiFfer3Nt_w0r1d}

 

WEEK3

Misc

1,三重隐写

给了三个音频,其中一个播放时

 

 扫码得到

AES key: 1ZmmeaLL^Typbcg3

第二个文件名有LSB可知是LSB隐写,用slienteye得到

Stegano key: uFSARLVNwVIewCY5

那么可猜到第三个音频是mp3隐写,用mp3stego得到

Zip Password: VvLvmGjpJ75GdJDP

打开压缩包得到flag.crypto

题目贴心的给了解密软件,得到flag

 RE

1,oooollvm

其实这题我连混淆都没去~

本来看到ollvm,第一反应是想用deflat去的,结果总有几个流程算不清,就一直没再看,快结束了时候想起来看了看

 

 这十分可疑啊

table1=['0x31','0x0E','0x10','0x38','0x06','0xA1','0x64','0x26','0x04','0x36','0xC1','0x2B','0xA4','0x07','0x7C','0x0C','0x94','0x06','0xC2','0x51','0xC4','0x01','0x4E','0xC1','0xB9','0x50','0xCE','0x8D','0xB1','0x45','0x44','0x9D','0x3F','0xA1']
table2=['0x59','0x68','0x73','0x56','0x6F','0xDD','0x25','0x61','0x40','0x69','0xA6','0x69','0xD9','0x47','0xD5','0x78','0xCB','0x7A','0xA4','0x28','0xBD','0x6E','0x4F','0xBA','0xA4','0x3D','0xB6','0xFB','0xEC','0x2F','0x12','0xF0','0x1A','0xBF']

for i in range(len(table1)):
    table1[i]=int(table1[i],16)
    table2[i]=int(table2[i],16)

for i in range(len(table2)):
    for s in range(30,127):
        if((~s & (table1[i]+i) | ~(table1[i]+i) & s)==table2[i]):
            print(chr(s),end='')
            continue

得到flag

 

Supongo que te gusta

Origin www.cnblogs.com/harmonica11/p/12231840.html
Recomendado
Clasificación