---
# System prepended metadata

title: 煉蠱大會遊戲方法 (Malware Playground Howto) 2021-正式版

---

煉蠱大會遊戲方法 (Malware Playground Howto) 2021-正式版
===========================================

TL;DR
-----

Intro Session:
Web: https://mpg-r1.hitcon.org
TCP Command Stream: mpg-r1.hitcon.org:29171
TCP Message Stream: mpg-r1.hitcon.org:29172

Advanced Session:
Web: https://mpg-r2.hitcon.org
TCP Command Stream: mpg-r2.hitcon.org:29271
TCP Message Stream: mpg-r2.hitcon.org:29272

Doodle Area/塗鴉牆：
http://doodle.hitcon2021.online/index.php
http://doodle.hitcon2021.online/sandbox.php
(No JS in latter. 後者無Javascript)

Web連上後可以嘗試以下指令:
```
CurrentGame
Scoreboard
PlayerInfo
Cmd /usr/bin/php -S 0.0.0.0:<PORT NUMBER>
Cmd echo "<p>__YOUR_NAME__ is here!</p>" > /var/www/html/storage/your_name.php
```

連線介紹 How to connect
------

玩家可以透過Raw TCP Socket或是Web界面來連上遊戲。Web界面較容易使用，但效能較差且不好自動化，而Raw TCP Socket效能較好，適合進階玩家。

Player can choose to use Raw TCP Socket or the Web interface to connect to the game. The Web interface is easier to use, while the Raw TCP Socket interface is faster and easier to interface with code.

Raw TCP Socket
--------------

玩家可以透過Raw TCP Socket連上煉蠱伺服器。遊戲共有兩個Port，一個用於下指令（以下簡稱指令Port），另一個用於觀看目前狀況。（以下簡稱狀況Port）

指令Port只能用來輸入指令，只有少數指令的結果會透過指令Port回傳。其他指令的回傳資料會顯示在狀況Port，因此建議同時開兩個視窗然後同時看兩者。

Players can connect to the malware playground through raw TCP socket. There are 2 ports, one is for sendin commands (hereafter "cmd port"), another is for watching the current status (hereafter "status port").

cmd port can only be used to key in/send command. Only a few commands will respond on the cmd port. The response for other commands will be available on the status port instead. Therefore, it is recommended that two terminal windows be opened at the same time for each of the ports.

Web Interface
-------------

玩家可以直接打開Web界面，界面左邊是目前所有訊息，左下能夠輸入訊息，右上可以選擇觀看哪些訊息，右邊中間可以看目前遊戲規則及狀態，右下可以觀看記分板。

Web界面網址如上TL;DR區塊所述

The player can open the web interface with a browser directly. In the user interface, on the left is the all the messages, on the bottom left is the prompt for entering any chat or command. On the top right users can filter what messages are shown, on the center right is the information on the current game (rules, status... etc), on the bottom right is the scoreboard.

The address for the web interface is above in the TL;DR section.

連上新手村 Connect to the tutorial section
------------------------------------------

透過Web界面連上新手村最方便，可以參考上述TL;DR區塊的網址
It's easiest to connect to the tutorial/intro section through the web interface. Please refer to the address in the TL;DR section above.

新手村位於 mpg-r1.hitcon.org Port 29171 (指令port) Port 29172 (狀態port)。
The tutorial/intro section is on mpg-r1.hitcon.org Port 29171 (cmd port) and Port 29172 (status port).

之後，可以開啟兩個不同視窗，使用nc指令連上煉蠱伺服器：
After that, connect to malware playground with the following commands in two different command prompt:
```
nc mpg-r1.hitcon.org 29171
nc mpg-r1.hitcon.org 29172
```
注意，必須同時打開兩個視窗，各自輸入以上兩個指令（一個視窗一個指令）。
Note, you'll need to open two terminals and enter the commands in them respectively (one in each).

加入後，於指令Port輸入:
After that, enter the following in Cmd port:
```
Nick <Your Nick> <Token>
```
可以設定你的暱稱。限制英文大小寫數字4-20個字長。
Will set your nickname, which is limited to alphanumeric (both cases), length of 4-20.

Token可以從Web界面取得，請點選Socket Token按鈕。
The token is available from the web interface, just click the "Socket Token" button.

```
CurrentGame
```
即可查看目前遊戲規則。
and you'll see the rules for the current game.

該廠遊戲輸入第一個指令後（例如上述的CurrentGame），系統會透過狀態Port告訴你你的Port Number，請你記好它。請注意每一場遊戲的port number可能不一樣。
After entering the first command on speaking on that channel for the first time. The system will tell you your port number through status port. Please take note of it. Note that the port number may be different on every game.

如果你忘了你的Port Number，可以輸入PlayerInfo指令取得他：
If you lost your port number, you can use the PlayerInfo command.
```
PlayerInfo
```

接下來，在指令Port輸入以下指令重複Listen在某個Port Number：
Enter the following command in cmd port to listen on your port number:
```
Cmd /usr/bin/php -S 0.0.0.0:<YOUR PORT NUMBER>
```

如果你的Process沒有被別人Kill掉，去Scoreboard就會看到你開始得分。
If your process is not killed, then you'll see that your score is increasing on the scoreboard.

在指令Port中輸入下列指令可以看Scoreboard:
Enter the following command on cmd port to see the scoreboard on IRC:
```
Scoreboard
```

最後，新手村遊戲規則為：
1. Process存活每秒1分，Port可以被連線每秒5分。可對外連網。
2. 可以直接執行指令。
3. 友善新手，請不要太頻繁的獵殺別人的Process。
4. 這場保留最久，原則上不刪除檔案，請多利用塗鴉區 (新手村中伺服器有跑一台http server)。

Lastly, the rules for the tutorial section is:
1. Process survival earns you 1 point per second. Port is up earns you 5 points per second. You may connect to the internet from the machine.
2. You can execute commands directly.
3. Please be friendly to noobs, and not kill them too frequently.
4. This room/game will be kept running for the duration of the conference, and generally we won't delete files/reset the game, so you're welcome to use the doodle area (the HTTP server running in the room).

塗鴉牆 Doodle Area
-----

塗鴉牆位於新手村的/var/www/html/storage/，裡面所有的.php都會被顯示出來。
如果想要塗鴉，可以使用以下指令
```
Cmd echo "<p>__YOUR_NAME__ is here!</p>" > /var/www/html/storage/your_name.php
```
請把__YOUR_NAME__跟your_name換成你的名子或暱稱

如果要觀看塗鴉牆，可以前往
https://doodle.hitcon2021.online/index.php
或是
https://doodle.hitcon2021.online/sandbox.php
(後者不會有javascript)

The doodle area is located in the intro session, in /var/www/html/storage/. Every .php file in that directory will be shown in the doodle page.

To doodle in the doodle area, use the following command:
```
Cmd echo "<p>__YOUR_NAME__ is here!</p>" > /var/www/html/storage/your_name.php
```
Replace YOUR_NAME with your name or nick name.

To visit the doodle page:
https://doodle.hitcon2021.online/index.php
Or
https://doodle.hitcon2021.online/sandbox.php
(No javascript)



進階場次 Advanced session
-------

進階場次位於同伺服器29271, 29272 Port


遊戲規則，時間與獎勵 Rules, Hours and Rewards
================================

遊戲規則 Rules
--------------

規則：
1. 每一場次有自己的計分規則，有的是需要你執行的Process存活，有的是需要你Listen在某個Port。
2. 每一場次的入侵方法也可能不同，有的直接提供輸入指令或Shellcode。
3. 於該場輸入CurrentGame顯示該場次的計分方式，入侵方法與規則。
4. 禁止攻擊位於/hitcon目錄中的遊戲Infra，不得（包含但不限於）修改，模擬，注入，阻擋，偽裝成該目錄中跑起來的伺服器，亦不得阻擋或為造Port 29100~29200中的任何流量。
5. 禁止癱瘓伺服器，例如使用Fork Bomb或是佔滿所有記憶體/磁碟空間。
6. 有上述違規行為，其他玩家可以向管理員檢舉。管理員可以將違規者禁賽及禁止其獲得獎勵的HITCON Token。

The rules are:
1. Each game have different scoring policy. Some requires your process to be alive, the other requires your port to be reachable.
2. Each game, the access you've to the machine is different. For some you can enter commands dircetly, others you can only use shellcode.
3. Enter the "CurrentGame" command to see the rules on scoring policy and access you've.
4. Do not attack the game infra, located in /hitcon directory. You may not (including but not limited to), modify, emulate, inject, block, masquerade as anything that runs from that directory. You must not block or spoof any traffic on port 29100~29200.
5. Do not attempt denial of service attack on the machine, such as using fork bomb, or filling up the memory/disk space.
6. If there's any prohibited action, other players may notify the administrators. The administrator may prohibit the violators from player, and/or forfeiting their reward HITCON tokens.

獎勵 Rewards
------------

新手村 Intro Session:
* You'll get 200 HITCON Points if your score is above 10,000. This is equivalent to surviving for ~30 minutes. Each attendee can earn this once only.
* 如果你能在新手村獲得超過10,000分（約等同於存活30分鐘），那你會取得200 HITCON Points。每個會眾只可以領一次。

進階版 Advanced Session:
* First place gets 31,337 HITCON Points
* Second place gets 16,384 HITCON Points
* Third place gets 8,192 HITCON Points
* Fourth and Fifth place gets 4,096 HITCON Points
* 6-10th place gets 2,048 HITCON Points
* 11-25th place gets 1,337 HITCON Points
* 第一名拿31,337 HITCON Points
* 第二名拿16.384 HITCON Points
* 第三名拿8,192 HITCON Points
* 第四五名拿4,096 HITCON Points
* 第六到第十名拿2,048 HITCON Points
* 第十一到第二十五名拿1,337 HITCON Points

開放時間 Operating Hours
-----------------------

* The event runs from 8am Nov 26th 2021 to 2:30pm Nov 27th 2021, only scores earned in these period counts.
* The points will be given out by 3:15pm Nov 27th 2021. The rankings for the advanced session will be announced on IRC/Telegram as well.
* Note that there are no breaks in between the 2 days. You can automate your tactic but please don't DDoS/DoS our server.
* There might be disruption in service between 7:30am to 8am on Nov 26th and from 2:30pm to 3:00pm to facilitate scoring.
* The server might be up before or after the event but the scores don't count. Just have fun.
* All time are UTC+8.
* 活動時間為11月26日8am至27日2:30pm，只有這段期間獲得的分數才會被計算。
* 點數於11月27日3:15pm前發放，並且進階場名次將於IRC/TG公佈。
* 兩天之間的晚上沒有中斷。你可以考慮自動化你的戰略但請不要DDoS/DoS我們的伺服器。
* 為了計算分數，伺服器在11月26日7:30-8am及27日2:30pm-3pm可能會中斷。
* 活動時間之外，伺服器可能已經開啟，但分數不計算。歡迎亂入。
* 所有時間點皆為 UTC+8 時區
