[Auto-Generate Flag (v0.1) under Combat training]20180117,linux

Source: Internet
Author: User

[Auto-Generate Flag (v0.1) under Combat training]20180117,linux

Sets the process for target target drone (Linux) to generate flag at timed intervals.

    • Login to root user at Target drone terminal

Use the command Su and enter the root user's password

    • Create a new script and edit it under/root

2.1 Create a new script and name it ye2.sh

Use the command:

Nano ye2.sh

    • After execution, enter the Nano editor and enter the following:

#!/bin/bash

While ["1" = "1"]

Do

z= ' OpenSSL rand-base64 30 '

s=$ (($RANDOM%100))

ECHO-E $z >>/USR/VMWARE.MC

ECHO-E $z >/root/flag

Sleep 15m

Done

    • #注意while语句中各空格的位置, less space will be an error

    • #注: the symbol "'" in line 4th is not a single quotation mark in English, but a grave accent, which needs to be typed under the English input method, with the keys below the "ESC" key, as shown in the Blue box:

    • Content of ye2.sh:

    • Save and exit the Nano editor, press CTRL + X on the keyboard, and see a prompt asking if you want to save, as shown in:

    • Press the "Y" key 1 times on the keyboard and press the "ENTER" key 1 times to save the edits and exit the Nano editor.

    • To add execute permissions to the script "ye2.sh", use the command:

chmod a+x ye2.sh

    • Run Tests

      • Run

        • In the terminal input command:

        • Bash/root/ye2.sh &

        • Note: #命令后加上 "&" to transpose the process running the script to run in the background

    • See the prompt message: "ye2.sh" process has been run in the background, and the process PID is "2517".

    • Review the currently running process to verify that there is a process with pid "2517" and the result is present. Use the command:

Ps

    • View the flag file (ye2.sh after 60 minutes of operation)

    • View VMWARE.MC files (ye2.sh after 60 minutes of operation)

    • End Run

      • Enter the command:

      • Kill-7-P < process pid> #终止某进程

------------------------------------------------------------------------------

[Flag (v0.1) automatically generated under]20180117,linux training]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.