---
# System prepended metadata

title: ATULA

---

# ATULA
![image](https://hackmd.io/_uploads/B1m2npIv-x.png)

Bài cho ta 1 file zip, sau khi giải nén ra thì wow, 1 file .exe 600mb=))

Mình tiến hành cho vào DiE để xem profile
![image](https://hackmd.io/_uploads/BkpKOqDwZl.png)

DiE không nhận dạng được, mình vứt luôn vào HxD để xem signature file

![image](https://hackmd.io/_uploads/BkIAdcwPWe.png)

Tại đây vừa mở lên mình thấy luôn 2 chỗ đã bị thay đổi là phần Magic byte của DOS Header và phần PE signature. Hơn nữa khi khéo xuống thì mình thấy thêm là ở dưới còn padding thêm 1 đống byte 0x00 nên mới làm cho file bị to lên bất thường như thế.

Tiếp nữa, sau khi để ý kĩ hơn thì mình phát hiện điều này

![image](https://hackmd.io/_uploads/S1fMj5Dw-g.png)

Hàng loạt symbol như : Py_InitializeFromConfig, PyConfig_Read,PyImport_ImportModule,PyMarshal_ReadObjectFromString.,,...

=> dấu hiệu cực mạnh của việc file bị packed bởi PyInstaller

MÌnh liền thử unpack xem
![image](https://hackmd.io/_uploads/HyLghqvPbx.png)

Rất ngol, đã unpack thành công
Theo kinh nghiệm làm RE của mình thì mình để ý luôn vào file `luongvd.pyc`, đây là 1 file bytecode của python , sử dụng trang https://pylingual.io/ để decompile, dựng lại source cho giống với file `.py`

Ta được kết quả như sau :

```python
# Decompiled with PyLingual (https://pylingual.io)
# Internal filename: 'luongvd.py'
# Bytecode version: 3.13.0rc3 (3571)
# Source timestamp: 1970-01-01 00:00:00 UTC (0)

from pyarmor_runtime_000000 import __pyarmor__
__pyarmor__(__name__, __file__, b'PY000000\x00\x03\r\x00\xf3\r\r\n\x80\x00\x01\x00\x08\x00\x00\x00\x04\x00\x00\x00@\x00\x00\x00"\x15\x00\x00\x12\t\x04\x00H\x1e\xa9]\xb7QCn\x02\xee\x7f\x8a2\x89\x90Y\x00\x00\x00\x00\x00\x00\x00\x00\xf7I\xa0\x87eu\xb5\x9a\n9^SV5\x8fky\x11\xc1\x98A\x10\xc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\x8dq2\xd79}S\xf3\x8f\x97\x8ccr\x9c&\x8c\x1c\x06}-\xb7\xae\xdc2\x01\xc3\xdd\xd7b\x86,\xf6\xd6:GDvZ\xf8S\x1f')
```

Rất rõ ràng, file này đang bị `obfuscate` bằng `pyarmor`. Ta cần `deobfuscate` nó

Sử dụng tool `Pyarmor-Static-Unpack-1shot`
![image](https://hackmd.io/_uploads/SJOg1jwvbg.png)

Chúng ta có 3 file sau 
![image](https://hackmd.io/_uploads/Hk2QliwD-l.png)

```python
# File: ATULA.exe.1shot.seq (Python 3.13)
# Source generated by Pyarmor-Static-Unpack-1shot (v0.2.2), powered by Decompyle++ (pycdc)

# Note: Decompiled code can be incomplete and incorrect.
# Please also check the correct and complete disassembly file: ATULA.exe.1shot.das

'__pyarmor_enter_57797__(...)'
__assert_armored__ = '__pyarmor_assert_57796__'

def transform_char(c, position, seed):
    '__pyarmor_enter_57800__(...)'
    __assert_armored__ = '__pyarmor_assert_57799__'
    _var_var_0 = None(ord, c)
    _var_var_1 = _var_var_0 ^ position * 7 + seed
    return _var_var_1 % 26 + 65
    None(None)
    return None
    '__pyarmor_exit_57801__(...)'
    '__pyarmor_exit_57801__(...)'


def calculate_checksum(data):
    '__pyarmor_enter_57803__(...)'
    __assert_armored__ = '__pyarmor_assert_57802__'
    _var_var_2 = 4919
# WARNING: Decompyle incomplete


def generate_key(username):
    '__pyarmor_enter_57806__(...)'
    __assert_armored__ = '__pyarmor_assert_57805__'
    if None(len, username) < 3:
        return None
    return None
    _var_var_5 = None(len, username) * 13
    _var_var_1 = []
# WARNING: Decompyle incomplete


def verify_key(username, key):
    '__pyarmor_enter_57809__(...)'
    __assert_armored__ = '__pyarmor_assert_57808__'
    _var_var_13 = None(generate_key, username)
# WARNING: Decompyle incomplete


def main():
    '__pyarmor_enter_57812__(...)'
    __assert_armored__ = '__pyarmor_assert_57811__'
    None(print, 'Nhiệm vụ: Tìm key hợp lệ cho username của bạn')
    None(print, '  - Key có format: XXXX-XXXX-XXXX-XXXX')
    None(print, '------------------------------------------------------------')
    None(print, '\n[1] Nhập username và key để kiểm tra')
    None(print, '[2] Thoát')
    _var_var_14 = None(None(input, '\nLựa chọn: ').strip)
# WARNING: Decompyle incomplete

if __name__ == '__main__':
    pass
main()
return None
return None
'__pyarmor_exit_57798__(...)'
'__pyarmor_exit_57798__(...)'

```
File .py này chỉ cho ta biết bao quát chương trình làm gì, nhưng logic check thì không rõ. Vậy nên ta cần xem file .das (dissamble) để xem logic check

[.das](https://ideone.com/TRnGYO)

Sau khi đọc qua chương trình thì luồng chương trình sẽ là : 
- Khi run thì prog sẽ yêu cầu username, sau khi điền username xong, nó sẽ bắt ta điền key để check
- Logic check của verify_key(username, key)
    - gen = generate_key(username), nếu gen is None thì trả False
    - cmp  key.upper() == gen.upper()
    - tức là username quá ngắn thì trả false luôn và key không phân biệt hoa thường vì được gọi hàm upper().
    -  => muốn pass thì cần tạo đúng key theo generate_key()

- Logic tạo key của generate_key(username)
    - len(username) < 3 thì return None
    - seed = len(username) * 13
    - tạo danh sách L từ username
    - tính acc từ tối đa 4 phần tử đầu của L
    - tính checksum từ username gốc (không upper)
    - tạo 2 giá trị còn lại và format key

Vì verify_key() chỉ làm : 
- gen = generate_key(username)
- so sánh upper()

Đề bài nói luôn là user là `doituyenattt2026` nên ta sẽ cần tính toán key của nó

Code solve : 
```python 
def keygen(u: str):
    if len(u) < 3:
        return None
    seed = len(u) * 13
    L = [((ord(ch) ^ (i * 7 + seed)) % 26) + 65
         for i, ch in enumerate(u.upper()) if ch.isalnum()]
    acc = 0
    for v in L[:4]:
        acc = (acc * 31 + v) & 0xFFFF
    x = 4919
    for i, ch in enumerate(u):
        x = ((x << 3) | (x >> 13)) & 0xFFFF
        x ^= ord(ch) * (i + 1)
    chk = x & 0xFFFF
    p3 = (acc ^ chk ^ 0xDEAD) & 0xFFFF
    p4 = ((acc + chk + p3) ^ 0xBEEF) & 0xFFFF
    return f"{acc:04X}-{chk:04X}-{p3:04X}-{p4:04X}"

print(keygen("doituyenattt2026"))
```

<details>
<summary><b>FLAG</b></summary>
    InfosecPTIT{0C24-52B6-803F-61F6}
</details>