Python | IT | lab – Part 1: python practice

Part 1: python practice

Python | IT | lab – 该题目是一个常规的IT的练习题目代写, 涉及了Python/IT等代写方面, 这是值得参考的lab代写的题目

lab代写 代写lab

Question 1 : We can use grep And.it$ to gain the passphrase. ^And means to match the string starting with And, it$ means matching a string ending with it.

Question 2: Because the correct passphrase appears 14 times, I can find the passphrase by counting the string. The result obtained by using the command uniq c is the number of times and the value of the string. Then I can use the awk command to filter the string output with exactly 14 times from the counting result.

Question 3: Use the sha256sum tool to generate hash values for all files under the folder, and then use grep to filter and match the hash values to get the correct answer.

The name of the file is hacklab_{demipauldron-crucialness-abrased}.

Question 4: If the decryption is successful, the gpg command will return 0 and use Python to crack it.

First, use the open() function to read the words.txt content, then perform the "l33t" conversion and then use the system call to continue decryption. If the decryption is successful, the program will terminate the output the passphrase.

The passphrase is: pr0b4bl3. The content of the decrypted file is hacklab_{saronide-pitchometer-cinephone}.

Question 5: First read the cyber.py file to understand that flag is generated in the following way:

So we need to read the integer of the first four characters of each string as the length, then extract c , and finally generate the flag.

The flag is hack lab {hightailing-cothurnian-longhaired} .

Question 6: I want to list the sizes of all files in the current directory and subdirectories, and then filter out the files with the size of 47 bytes. Finally, I found that the du command can achieve this function.

Use the du – b a command to list the current directory file and the file size under the subdirectory in bytes.

Use the grep command to find the file with the size of 47 bytes, and then use the cat command to read the secret

The secet is hacklab_{landfill-tyrannizes-pseudoneuropteran}

Question 7:

First, run the a.out program and find that no information is prompted. Then use the cat command to read the a.out command, and the secret will be displayed when found.

The secret is hacklab_{sautoires-piperidine-snobbing} .

Question 8:

At the beginning, I thought that the password directly exists in the file. Use the string command to view the string in the file. No secret is displayed, but the end of the displayed string is’=’, indicating that the string may be base32 or base64 encoded. Then notice that there are not only uppercase letters but also lowercase letters in the string, so IT is base64 encoded. Use the base64 decode command to get the secret.

The secret is hacklab_{copartnery-palegold-supergiant} .

Part 2

Question 1:

It is observed that the encryption method of mycrypto.py is XOR. Because P ^ K ^ K=P, P is obtained after encrypting the P again.

The secret is hacklab_{wrestled-bigwiggedness-banqueteer} . This encryption method is XOR, so it is not secure. Because the key is generated by seed, if seed is n bits, the key space is 2 ^ n.

Question 2 :

First, define int_ to_ String function and initialize n, p, q, e, d, c. Then calculate ^ and convert it to string type. The secret is hacklab_{demonetization}.

Question 3 :

We can know from the file name that the image is a 256 color bitmap with 2000 * 2000 pixels.

Use convert command to create a blank image of the same size output.bmp, and then use the dd command to combine the two files. No useful information is found. Later, using the ls – l command, it was found that the size of output.bmp was 12000138 bytes, and the file to be decrypted was 4001088 bytes. So using the dd command again, but only 4001088 bytes of output.bmp were copied, and finally the key information was obtained in out1.bmp.

The message hidden inside this file is 42 42 42 .

Question 4 :

After trying many traditional ciphers, it is found that the cipher used is subsitution cipher. First use pip install subbreaker command to install subbreaker, and then follow the help of https://pypi.org/project/subbreaker/ to crack. But this tool can’t recognize , and -, so I need to handle these symbols manually.

Get the original text: IT WAS THE BEST OF TIMES, IT WAS THE WORST OF TIMES, IT WAS THE AGE OF WISDOM, IT WAS THE AGE OF FOOLISHNESS, IT WAS THE EPOCH OF BELIEF, IT WAS THE OF INCREDULITY, IT WAS THE SEASON OF LIGHT, IT WAS THE SEASON OF DARKNESS, IT WAS THE SPRING OF HOPE, IT WAS THE WINTER OF DESPAIR, WE HAD EVERYTHING BEFORE US, WE HAD NOTHING BEFORE US, WE WERE ALL GOING DIRECT TO HEAVEN, WE WERE ALL GOING DIRECT THE OTHER WAY-IN SHORT, THE PERIOD WAS SO FAR LIKE THE PRESENT PERIOD, THAT SOME OF ITS NOISIEST AUTHORITIES INSISTED ON ITS BEING RDECEIVED, FOR GOOD OR FOR EVIL, IN THE SUPERLATIVE DEGREE OF COMPARISON ONLY.

Get the key: Alphabet: abcdefghijklmnopqrstuvwxyz Key: lwsimazuekyhgrncdjtxbqpfvo

Question 5 :

Use John the Ripper password cracker to solve this problem.

Because the tool needs to be downloaded, the attack process is carried out on the Kali virtual machine. The password spiderman1 can be easily obtained through the unshadow command and the john command.

Restart the virtual machine to log in to yoda’s account, find the flag file, and use the cat command to get the flag: hacklab_{prehypophysis-chacker-sphagnous} .