[2019] Western NETWORK CHANNEL Cup online game wp section title

Because too dishes so just hit the country the ninth ...

But half an hour AK is really a crypto [bared teeth]

Dawn_whisper_ solving report

MISC

survey

Can easily fill a fill flag to get the ...

HiddenImage

Look "through" the image and get the flag.

Description speculation may be entitled to see the documents bundled

Binwalk about to get under ubuntu:

 

And we found that indeed there is a zip file:

Foremost, get gotflag.jpg

 

 

After opening flag is not found appears in an image, and then open the file to see the tail with 010 Editor,

 

See this suspicious coding

 

OK, get flag.

Crypto

RSA

download file

 

Interesting-RSA! You could finish it step by step and please use the search engine appropriately!

See hinting and code found in this question is given step by step, so we need a step by step decryption.

Part1:

 

Tip very intimate, c1 p1 is obtained by the encryption, see e = 3, and n is much greater than c, c to open directly to the power of 3 to give p.

Part2:

 

I looked a long time do not know this section have any effect on p and q, so skip.

Frt3:

 

And c3 as Part1 q is obtained by encrypting, so we took n about artifact exploded requirements about the way d:

 

As shown, some of the data were made available.

Part4:

 

Like, flag_c flag is encrypted, so you can write a script to write and run:

 

 

 

Directly converted to ascii code

 

Flag hand!

Decrypt it!

To be honest the code to get the title I was taken aback (escape

 

165 lines of code I was shocked

But the question people really conscience, all comments written in great detail (also calculated the answer written very clearly), or I think I have to be about half an hour.

Ado, the first analysis of the code:

Kiki lot of strange code above do not quite understand, an important part of the topic and the subject person very clear (too conscience ah feed)

 

One of the functions, matrix multiplication (the game when I was ready to write later found to have 2333)

Read on:

 

The basic format so obvious to guess left and right matrices are inverse matrix, however the topic at the last gave tips (too conscience ah feed):

 

Well, do not pull these useless, then we see the core of the algorithm:

Encryption function encrypt

 

(This comment also too detailed it, this is the difficulty of reducing the number of ah)

We analyze a sentence:

 

Inspection length, regardless of skip,

 

Predetermined random number seed (because the computer is a pseudorandom number generation, so a subsequent seeds obtained after a predetermined random numbers are the same).

 

16 randomly generated number as a candidate key,

 

Out of order,

 

Into bytes,

 

XOR the plaintext and the key bit

 

The case of the plaintext (hereinafter abbreviated P) into a two-dimensional:

We P [0: 1] referred to as P [0], P [1: 2] denoted as P [1] ... and so on,

We will be able to get it into a two-dimensional P corresponding table:

P0

P1

P2

P3

P5

P6

P7

P4

P10

P11

P8

P9

P15

P12

P13

P14

Then continue to look at:

 

This matrix is ​​multiplied by the left and then pressed into a one-dimensional (If this place does not suggest I might want the card for a long time)

 

Then key it out of order,

 

Again and plaintext XOR bit and then output,

 

Decryption function, ... obviously you want to write our own.

 

Here are the flag encrypted ciphertext, but not much use if you do not look at it the following topic and people are very close:

 

Flag of way to obtain written clearly ♂.

After analyzing it, this question is the key to write the inverse function of encryption function:

For convenience, simply referred afternoon cipher_text is c, scrambled obtained first key referred to as key1, second scrambled obtained referred to as key key2,

 

First deal in advance at the use of key1 and key2 behind convenience,

 

We were backwards against the encryption algorithm, first and key2 c XOR

 

Then the one-dimensional extended to two-dimensional c,

 

The resulting matrix by encryption used to encrypt the matrix inverse matrix,

The corresponding encryption table above

We can get the return corresponding to the table:

P0

P1

P2

P3

P7

P4

P5

P6

P10

P11

P8

P9

P13

P14

P15

P12

 

Then XOR key1 out, you can get the flag before encryption

Then run the code 214 line (really tired 2333), you can get a flag:

 

Reverse

maze

Download the file into a file ubuntu look:

 

ELF files, the reverse appears to be under linux, but we can also be dragged into the ida, find the main function by pressing F5

 

Program uses a parameter to represent the entire map, which found such a sentence:

 

The map that is 50 line.

Then look for map:

 

I found a map in this position, as after extracted:

 

wasd down! Maze

 

Try to open the file:

 

WTF? wrong?

Ida back Kankan:

 

There are two intermediate odd function map function, opening the Kankan:

 

Found that the function of the two locations were modified map, find the location of the address, manually modify the map, wasd do it again, and then try to open:

 

OK, get flag.

Programming

Deadlock

The questions were very simple, with the edge connection event, bfs can

code show as below:

#include <algorithm>

#include <iostream>

#include <cstdio>

#include <cmath>

#include <queue>

using namespace std;

bool Show [1010];

int ru[1010],nex[1010],len,n;

queue<int> q;

struct node

{

         int v, nxt;

}edge[1010*1010];

void add(int u,int v)

{

         edge[++len]=(node) {v,nex[u]},nex[u]=len;

}

void bfs()

{

         while(!q.empty())

         {

                  int x=q.front();

                  q.pop();

                  am [x] = 1;

                  for(int i=nex[x];i;i=edge[i].nxt)

                  {

                          int v=edge[i].v;

                          ru [v] -;

                          if(!ru[v])

                                   q.push(v);

                  }

         }

}

int main ()

{

         scanf("%d",&n);

         for(int i=0;i<n;i++)

         {

                  scanf("%d",&ru[i]);

                  if(!ru[i])

                          q.push(i);

                  for(int j=1;j<=ru[i];j++)

                  {

                          int v;

                          scanf("%d",&v);

                          add(v,i);

                  }

         }

         bfs();

         for(int i=0;i<n;++i)

                  if(!vis[i])

                  {

                          printf("Y\n");

                          return 0;

                  }

         printf("N\n");

         return 0;

}

Guess you like

Origin www.cnblogs.com/dawn-whisper/p/11543091.html
Recommended