{"id":2543,"date":"2023-10-24T11:54:46","date_gmt":"2023-10-24T09:54:46","guid":{"rendered":"https:\/\/security.humanativaspa.it\/?p=2543"},"modified":"2025-09-15T13:24:01","modified_gmt":"2025-09-15T13:24:01","slug":"customizing-sliver-part-2","status":"publish","type":"post","link":"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/","title":{"rendered":"Customizing Sliver &#8211; Part 2"},"content":{"rendered":"<p class=\"graf graf--p\">Hello! This is the second part of the three-part blog <a href=\"https:\/\/hnsecurity.it\/tag\/sliver\/\">series<\/a> explaining how to customize <a href=\"https:\/\/github.com\/BishopFox\/sliver\">Sliver C2<\/a> by adding your own commands.<\/p>\n<p class=\"graf graf--p\">In this part I\u2019m going to provide an <strong>overview of the communication model<\/strong> in Sliver C2, by examining the flow of function calls performed by the components when an operator launches a command.<\/p>\n<p class=\"graf graf--p\">In <a href=\"https:\/\/hnsecurity.it\/customizing-sliver-part-3\/\">part 3<\/a>, I\u2019ll provide a tutorial showing how to create the first simple command from scratch in Sliver C2.<\/p>\n<h2 class=\"graf graf--h3\">Communication model overview<\/h2>\n<p class=\"graf graf--p\">As explained <a href=\"https:\/\/github.com\/BishopFox\/sliver\/wiki\/Architecture\">here<\/a>, Sliver works in the following way:<\/p>\n<figure class=\"graf graf--figure\">\n<p><figure style=\"width: 828px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"graf-image\" src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/1*yv3zWNq_EK4QPUU9fqAEng.png\" alt=\"\" width=\"828\" height=\"151\" data-image-id=\"1*yv3zWNq_EK4QPUU9fqAEng.png\" data-width=\"828\" data-height=\"151\" \/><figcaption class=\"wp-caption-text\">Communication model diagram<\/figcaption><\/figure><figcaption class=\"imageCaption\">1. When the operator types a command in the console, the client serializes the command in a protobuf request and sends it, through gRPC, to the server.<\/p>\n<p class=\"graf graf--p\">2. The server processes the message and forwards the protobuf request to the implant, through the <strong class=\"markup--strong markup--p-strong\">communication channel<\/strong> <strong class=\"markup--strong markup--p-strong\">in use with the implant<\/strong> (could be HTTP\/S, DNS, Wireguard; in the diagram above it&#8217;s HTTP).<\/p>\n<p class=\"graf graf--p\">3. The implant <strong class=\"markup--strong markup--p-strong\">unserializes <\/strong>the protobuf request, executes the specified task, <strong class=\"markup--strong markup--p-strong\">serializes the output<\/strong> again in a<strong class=\"markup--strong markup--p-strong\"> protobuf message<\/strong>, and sends it to the server through the <strong class=\"markup--strong markup--p-strong\">same communication channel used at step 2<\/strong>.<\/p>\n<p class=\"graf graf--p\">4. The server receives the protobuf response and forwards it to the client through <strong class=\"markup--strong markup--p-strong\">gRPC<\/strong>. At this point the client simply unserializes the <strong class=\"markup--strong markup--p-strong\">protobuf response <\/strong>and prints the output to the screen.<\/p>\n<\/figcaption><\/figure>\n<h3 class=\"graf graf--h4\">Client-server communication<\/h3>\n<p>The <strong>services.proto <\/strong>file, by importing <strong class=\"markup--strong markup--p-strong\">client.proto<\/strong> and <strong class=\"markup--strong markup--p-strong\">sliver.proto, <\/strong>defines The<strong class=\"markup--strong markup--p-strong\"> gRPC messages<\/strong> <strong class=\"markup--strong markup--p-strong\">and methods <\/strong>exchanged between client and server.<\/p>\n<p class=\"graf graf--p\">The client stores all the commands in <a href=\"https:\/\/github.com\/BishopFox\/sliver\/blob\/master\/client\/command\/sliver.go\">client\/command\/sliver.go<\/a>. All commands stored in the file will call functions defined under <strong class=\"markup--strong markup--p-strong\">client\/command\/&lt;command folder&gt;\/&lt;command_name&gt;.go<\/strong>. For example, sliver.go defines the command <strong class=\"markup--strong markup--p-strong\">execute-assembly<\/strong>, that when typed in by the operator, invokes function <strong class=\"markup--strong markup--p-strong\">ExecuteAssemblyCmd()<\/strong>, defined in <a href=\"https:\/\/github.com\/BishopFox\/sliver\/blob\/master\/client\/command\/exec\/execute-assembly.go\">client\/command\/exec\/execute-assembly.go<\/a>.<\/p>\n<p class=\"graf graf--p\">All these functions will end up calling <strong class=\"markup--strong markup--p-strong\">gRPC functions<\/strong> defined in <a href=\"https:\/\/github.com\/BishopFox\/sliver\/blob\/master\/protobuf\/rpcpb\/services.proto\">services.proto<\/a>. For example, <strong class=\"markup--strong markup--p-strong\">ExecuteAssemblyCmd() <\/strong>calls <strong class=\"markup--strong markup--p-strong\">con.Rpc.ExecuteAssembly() <\/strong>defined in services.proto.<\/p>\n<figure class=\"graf graf--figure\">\n<p><figure style=\"width: 1000px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"graf-image\" src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/1*2DWIHeNftjljtKCLNncPYQ.png\" alt=\"\" width=\"1000\" height=\"370\" data-image-id=\"1*2DWIHeNftjljtKCLNncPYQ.png\" data-width=\"1816\" data-height=\"672\" \/><figcaption class=\"wp-caption-text\">Mapping between con.Rpc.ExecuteAssembly() and definition in services.proto<\/figcaption><\/figure><\/figure>\n<p>Actually, <a href=\"https:\/\/github.com\/BishopFox\/sliver\/blob\/master\/protobuf\/rpcpb\/services_grpc.pb.go\">services_grpc.pb.go<\/a>\u00a0defines <strong class=\"markup--strong markup--p-strong\">con.Rpc.ExecuteAssembly()<\/strong>. <strong>Protoc<\/strong> automatically builds the file services_grpc.pb.go starting from the definitions inside services.proto.<\/p>\n<p class=\"graf graf--p\"><em class=\"markup--em markup--p-em\">As I&#8217;ll outline later, we will only have to <\/em><strong class=\"markup--strong markup--p-strong\"><em class=\"markup--em markup--p-em\">modify services.proto, sliver.proto, and client.proto and then rebuild services_grpc.pb.go<\/em><\/strong><em class=\"markup--em markup--p-em\"> by just running <strong>m<\/strong><\/em><strong><em class=\"markup--em markup--p-em\">ake pb<\/em><\/strong><em class=\"markup--em markup--p-em\">\u00a0, in order to add our custom commands.<\/em><\/p>\n<p class=\"graf graf--p\">These gRPC functions send protobuf messages to the server through gRPC, where <a href=\"https:\/\/github.com\/BishopFox\/sliver\/tree\/master\/server\/rpc\">server\/rpc\/rpc-*.go<\/a> defines the corresponding server-side handlers for these gRPC functions. For example, <a href=\"https:\/\/github.com\/BishopFox\/sliver\/blob\/master\/server\/rpc\/rpc-tasks.go\">server\/rpc\/rpc-tasks.go<\/a> defines <a href=\"https:\/\/github.com\/BishopFox\/sliver\/blob\/master\/server\/rpc\/rpc-tasks.go#L127\">ExecuteAssembly()<\/a>, the server-side function that handles the <strong class=\"markup--strong markup--p-strong\">con.Rpc.ExecuteAssembly() <\/strong>request performed by the client.<\/p>\n<p class=\"graf graf--p\">These server functions handling the gRPC requests will perform the required processing and then send the response with the statement:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"golang\">return resp, nil<\/pre>\n<p class=\"graf graf--p\">For the <strong class=\"markup--strong markup--p-strong\">ExecuteAssembly() <\/strong>handler function, this sends a protobuf message to the implant and then returns the response, as we will see in the following section.<\/p>\n<h3 class=\"graf graf--h4\">Server-implant communication<\/h3>\n<p>The <strong>sliver.proto<\/strong> file defines the messages that are exchanged between server and implant. Server and implant exchange these messages not through gRPC but through HTTP\/S, DNS depending on how the implant was generated, as previously mentioned.<\/p>\n<p class=\"graf graf--p\">Let\u2019s inspect the function <a href=\"https:\/\/github.com\/BishopFox\/sliver\/blob\/master\/server\/rpc\/rpc-tasks.go#L127\">ExecuteAssembly()<\/a> in order to explain what the server is going to do in this case:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"golang\">\/\/\u00a0ExecuteAssembly\u00a0-\u00a0Execute\u00a0a\u00a0.NET\u00a0assembly\u00a0on\u00a0the\u00a0remote\u00a0system\u00a0in-memory\u00a0(Windows\u00a0only)\r\nfunc\u00a0(rpc\u00a0*Server)\u00a0ExecuteAssembly(ctx\u00a0context.Context,\u00a0req\u00a0*sliverpb.ExecuteAssemblyReq)\u00a0(*sliverpb.ExecuteAssembly,\u00a0error)\u00a0{\r\n\u00a0var\u00a0session\u00a0*core.Session\r\n\u00a0var\u00a0beacon\u00a0*models.Beacon\r\n\u00a0var\u00a0err\u00a0error\r\n\u00a0if\u00a0!req.Request.Async\u00a0{\r\n\u00a0\u00a0session\u00a0=\u00a0core.Sessions.Get(req.Request.SessionID)\r\n\u00a0\u00a0if\u00a0session\u00a0==\u00a0nil\u00a0{\r\n\u00a0\u00a0\u00a0return\u00a0nil,\u00a0ErrInvalidSessionID\r\n\u00a0\u00a0}\r\n\u00a0}\u00a0else\u00a0{\r\n\u00a0\u00a0beacon,\u00a0err\u00a0=\u00a0db.BeaconByID(req.Request.BeaconID)\r\n\u00a0\u00a0if\u00a0err\u00a0!=\u00a0nil\u00a0{\r\n\u00a0\u00a0\u00a0tasksLog.Errorf(\"%s\",\u00a0err)\r\n\u00a0\u00a0\u00a0return\u00a0nil,\u00a0ErrDatabaseFailure\r\n\u00a0\u00a0}\r\n\u00a0\u00a0if\u00a0beacon\u00a0==\u00a0nil\u00a0{\r\n\u00a0\u00a0\u00a0return\u00a0nil,\u00a0ErrInvalidBeaconID\r\n\u00a0\u00a0}\r\n\u00a0}\r\n\r\n\u00a0shellcode,\u00a0err\u00a0:=\u00a0generate.DonutFromAssembly(\r\n\u00a0\u00a0req.Assembly,\r\n\u00a0\u00a0req.IsDLL,\r\n\u00a0\u00a0req.Arch,\r\n\u00a0\u00a0req.Arguments,\r\n\u00a0\u00a0req.Method,\r\n\u00a0\u00a0req.ClassName,\r\n\u00a0\u00a0req.AppDomain,\r\n\u00a0)\r\n\u00a0if\u00a0err\u00a0!=\u00a0nil\u00a0{\r\n\u00a0\u00a0tasksLog.Errorf(\"Execute\u00a0assembly\u00a0failed:\u00a0%s\",\u00a0err)\r\n\u00a0\u00a0return\u00a0nil,\u00a0err\r\n\u00a0}\r\n\r\n\u00a0resp\u00a0:=\u00a0&amp;sliverpb.ExecuteAssembly{Response:\u00a0&amp;commonpb.Response{}}\r\n\u00a0if\u00a0req.InProcess\u00a0{\r\n\u00a0\u00a0tasksLog.Infof(\"Executing\u00a0assembly\u00a0in-process\")\r\n\u00a0\u00a0invokeInProcExecAssembly\u00a0:=\u00a0&amp;sliverpb.InvokeInProcExecuteAssemblyReq{\r\n\u00a0\u00a0\u00a0Data:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0req.Assembly,\r\n\u00a0\u00a0\u00a0Runtime:\u00a0\u00a0\u00a0\u00a0req.Runtime,\r\n\u00a0\u00a0\u00a0Arguments:\u00a0\u00a0strings.Split(req.Arguments,\u00a0\"\u00a0\"),\r\n\u00a0\u00a0\u00a0AmsiBypass:\u00a0req.AmsiBypass,\r\n\u00a0\u00a0\u00a0EtwBypass:\u00a0\u00a0req.EtwBypass,\r\n\u00a0\u00a0\u00a0Request:\u00a0\u00a0\u00a0\u00a0req.Request,\r\n\u00a0\u00a0}\r\n\u00a0\u00a0err\u00a0=\u00a0rpc.GenericHandler(invokeInProcExecAssembly,\u00a0resp)\r\n\u00a0}\u00a0else\u00a0{\r\n\u00a0\u00a0invokeExecAssembly\u00a0:=\u00a0&amp;sliverpb.InvokeExecuteAssemblyReq{\r\n\u00a0\u00a0\u00a0Data:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0shellcode,\r\n\u00a0\u00a0\u00a0Process:\u00a0\u00a0\u00a0\u00a0\u00a0req.Process,\r\n\u00a0\u00a0\u00a0Request:\u00a0\u00a0\u00a0\u00a0\u00a0req.Request,\r\n\u00a0\u00a0\u00a0PPid:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0req.PPid,\r\n\u00a0\u00a0\u00a0ProcessArgs:\u00a0req.ProcessArgs,\r\n\u00a0\u00a0}\r\n\u00a0\u00a0err\u00a0=\u00a0rpc.GenericHandler(invokeExecAssembly,\u00a0resp)\r\n\r\n\u00a0}\r\n\u00a0if\u00a0err\u00a0!=\u00a0nil\u00a0{\r\n\u00a0\u00a0return\u00a0nil,\u00a0err\r\n\u00a0}\r\n\u00a0return\u00a0resp,\u00a0nil\r\n}<span class=\"pre--content\">\u00a0<\/span><\/pre>\n<p class=\"graf graf--p\">The req parameter passed as input corresponds to the protobuf message <strong class=\"markup--strong markup--p-strong\">ExecuteAssemblyReq, <\/strong>defined in <a href=\"https:\/\/github.com\/BishopFox\/sliver\/blob\/master\/protobuf\/sliverpb\/sliver.proto\">sliver.proto<\/a>, in the following way (commonpb.Request is defined in <a href=\"https:\/\/github.com\/BishopFox\/sliver\/blob\/master\/protobuf\/commonpb\/common.proto\">common.proto <\/a>but I added it here for clarity):<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">common.proto\r\n...\r\n...\r\n\/\/ Request - Common fields used in all gRPC requests\r\nmessage Request {\r\n  bool Async = 1;\r\n  int64 Timeout = 2;\r\n\r\n  string BeaconID = 8;\r\n  string SessionID = 9;\r\n}\r\n...\r\n...\r\n\r\n---------------------------------------------------------------------\r\nsliver.proto\r\n...\r\n...\r\nmessage ExecuteAssemblyReq {\r\n  bytes Assembly = 1;\r\n  string Arguments = 2;\r\n  string Process = 3;\r\n  bool IsDLL = 4;\r\n  string Arch = 5;\r\n  string ClassName = 6;\r\n  string Method = 7;\r\n  string AppDomain = 8;\r\n  uint32 PPid = 10;\r\n  repeated string ProcessArgs = 11;\r\n  \/\/ In process specific fields\r\n  bool InProcess = 12;\r\n  string Runtime = 13;\r\n  bool AmsiBypass = 14;\r\n  bool EtwBypass = 15;\r\n  commonpb.Request Request = 9;\r\n}\r\n...\r\n...<\/pre>\n<p class=\"graf graf--p\">So what happens is that the handler performs the following actions:<\/p>\n<ol class=\"postList\">\n<li class=\"graf graf--li\">retrieve the implant ID through req.Request.SessionID\/req.Request.BeaconID and check if it is valid.<\/li>\n<li>create the go struct <strong class=\"markup--strong markup--p-strong\">sliverpb.ExecuteAssembly<\/strong> that corresponds to the <strong class=\"markup--strong markup--p-strong\">ExecuteAssembly <\/strong>protobuf message defined in <strong class=\"markup--strong markup--p-strong\">sliver.proto. This struct will contain the response from the implant<\/strong>.<\/li>\n<li>create the go struct <strong class=\"markup--strong markup--p-strong\">sliverpb.InvokeInProcExecuteAssemblyReq<\/strong> that corresponds to the <strong class=\"markup--strong markup--p-strong\">InvokeInProcExecuteAssemblyReq <\/strong>protobuf message defined in <strong class=\"markup--strong markup--p-strong\">sliver.proto <\/strong>(we suppose the we executed execute-assembly in process, with the -i flag, otherwise the server will create ExecuteAssemblyReq). <strong class=\"markup--strong markup--p-strong\">The implant will receive this struct as a request to process<\/strong>.<\/li>\n<li>call <strong class=\"markup--strong markup--p-strong\">rpc.GenericHandler(),<\/strong> <strong class=\"markup--strong markup--p-strong\">passing as input the request and the response created at steps 2 and 3<\/strong>.<\/li>\n<li>return <strong class=\"markup--strong markup--p-strong\">resp<\/strong>, the response struct that the rpc.GenericHandler function populates with the response of the implant.<\/li>\n<\/ol>\n<p>Here&#8217;s the body of function <strong class=\"markup--strong markup--p-strong\">rpc.GenericHandler()<\/strong>, defined inside <a href=\"https:\/\/github.com\/BishopFox\/sliver\/blob\/master\/server\/rpc\/rpc.go\">server\/rpc\/rpc.go<\/a>:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"golang\">\/\/ GenericHandler - Pass the request to the Sliver\/Session\r\nfunc (rpc *Server) GenericHandler(req GenericRequest, resp GenericResponse) error {\r\n    var err error\r\n    request := req.GetRequest()\r\n    if request == nil {\r\n        return ErrMissingRequestField\r\n    }\r\n    if request.Async {\r\n        err = rpc.asyncGenericHandler(req, resp)\r\n        return err\r\n    }\r\n\r\n    \/\/ Sync request\r\n    session := core.Sessions.Get(request.SessionID)\r\n    if session == nil {\r\n        return ErrInvalidSessionID\r\n    }\r\n\r\n    \/\/ Overwrite unused implant fields before re-serializing\r\n    request.SessionID = \"\"\r\n    request.BeaconID = \"\"\r\n\r\n    reqData, err := proto.Marshal(req)\r\n    if err != nil {\r\n        return err\r\n    }\r\n\r\n    data, err := session.Request(sliverpb.MsgNumber(req), rpc.getTimeout(req), reqData)\r\n    if err != nil {\r\n        return err\r\n    }\r\n    err = proto.Unmarshal(data, resp)\r\n    if err != nil {\r\n        return err\r\n    }\r\n    return rpc.getError(resp)\r\n}<\/pre>\n<p class=\"graf graf--p\">You may notice that the function retrieves the beacon\/session implant, <strong class=\"markup--strong markup--p-strong\">serializes the request, sends the serialized request to the implant<\/strong>, and finally <strong class=\"markup--strong markup--p-strong\">returns the response from the implant inside the resp input parameter<\/strong>.<\/p>\n<p class=\"graf graf--p\">On the implant-side, the functions in charge of handling the requests coming from the server are defined inside <strong class=\"markup--strong markup--p-strong\">handlers_&lt;OS&gt;.go<\/strong> and <strong class=\"markup--strong markup--p-strong\">handlers.go. <\/strong>The file <strong class=\"markup--strong markup--p-strong\">handlers.go contains handlers for tasks that can be executed on any OS<\/strong>, while <strong class=\"markup--strong markup--p-strong\">handlers_&lt;OS&gt;.go contains handlers for tasks that can be executed only on a specific OS<\/strong>. For example, <a href=\"https:\/\/github.com\/BishopFox\/sliver\/blob\/master\/implant\/sliver\/handlers\/handlers_windows.go\">handlers_windows.go<\/a> contains<strong class=\"markup--strong markup--p-strong\"> impersonateHandler()<\/strong> that implements the impersonate command that would be <strong class=\"markup--strong markup--p-strong\">useful only with a Windows OS<\/strong>, while <strong class=\"markup--strong markup--p-strong\">handlers.go contains dirListHandler()<\/strong> that implements the ls command that is <strong class=\"markup--strong markup--p-strong\">useful with any OS<\/strong>.<\/p>\n<p class=\"graf graf--p\">Let\u2019s inspect the <strong class=\"markup--strong markup--p-strong\">inProcExecuteAssemblyHandler() <\/strong>defined in <a href=\"https:\/\/github.com\/BishopFox\/sliver\/blob\/master\/implant\/sliver\/handlers\/handlers_windows.go\">implant\/sliver\/handlers_windows.go<\/a>:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"golang\">func inProcExecuteAssemblyHandler(data []byte, resp RPCResponse) {\r\n    execReq := &amp;sliverpb.InvokeInProcExecuteAssemblyReq{}\r\n    err := proto.Unmarshal(data, execReq)\r\n    if err != nil {\r\n        \/\/ {{if .Config.Debug}}\r\n        log.Printf(\"error decoding message: %v\", err)\r\n        \/\/ {{end}}\r\n        return\r\n    }\r\n    output, err := taskrunner.InProcExecuteAssembly(execReq.Data, execReq.Arguments, execReq.Runtime, execReq.AmsiBypass, execReq.EtwBypass)\r\n    execAsm := &amp;sliverpb.ExecuteAssembly{Output: []byte(output)}\r\n    if err != nil {\r\n        execAsm.Response = &amp;commonpb.Response{\r\n            Err: err.Error(),\r\n        }\r\n    }\r\n    data, err = proto.Marshal(execAsm)\r\n    resp(data, err)\r\n}<\/pre>\n<p class=\"graf graf--p\">It takes as input <strong class=\"markup--strong markup--p-strong\">data<\/strong>, the serialized request, as an array of bytes, and <strong class=\"markup--strong markup--p-strong\">resp <\/strong>corresponding to a<strong class=\"markup--strong markup--p-strong\"> callback<\/strong>.<\/p>\n<p class=\"graf graf--p\">The function <strong class=\"markup--strong markup--p-strong\">unserializes data in the struct InvokeInProcExecuteAssemblyReq<\/strong> (this corresponds to the request sent by the server). Now the implant processes the request (the variable <strong class=\"markup--strong markup--p-strong\">execReq<\/strong>) and calls taskrunner.InProcExecuteAssembly(), passing as input the parameters contained in execReq.<\/p>\n<p class=\"graf graf--p\">At this point, the implant performs the following operations:<\/p>\n<ul>\n<li class=\"graf graf--p\">save the output inside a struct of type <strong class=\"markup--strong markup--p-strong\">sliverpb.ExecuteAssembly<\/strong>, again defined in <strong class=\"markup--strong markup--p-strong\">sliver.proto<\/strong>.<\/li>\n<li class=\"graf graf--p\">serialize the struct.<\/li>\n<li class=\"graf graf--p\">call the callback resp, passing as input the serialized struct.<\/li>\n<\/ul>\n<p class=\"graf graf--p\">The <strong class=\"markup--strong markup--p-strong\">callback resp <\/strong>will <strong class=\"markup--strong markup--p-strong\">end up returning the serialized struct to the server<\/strong>, <strong class=\"markup--strong markup--p-strong\">as a response to the initial request<\/strong>, through the communication channel in use (that again could be HTTP\/S, DNS, WireGuard, etc.).<\/p>\n<p class=\"graf graf--p\">At this point, on the server-side, the <a href=\"https:\/\/github.com\/BishopFox\/sliver\/blob\/master\/implant\/sliver\/handlers\/handlers_windows.go\">rpc.GenericHandler()<\/a> function receives the response, and returns it to <a href=\"https:\/\/github.com\/BishopFox\/sliver\/blob\/master\/server\/rpc\/rpc-tasks.go#L127\">ExecuteAssembly()<\/a>, which finally sends it back to the client through gRPC.<\/p>\n<p class=\"graf graf--p\">In the end, the client receives and processes the response, and prints data on screen for the operator.<\/p>\n<p class=\"graf graf--p\">By now you should have a basic understanding of the internals of Sliver. Be ready for the third and final part of this <a href=\"https:\/\/hnsecurity.it\/tag\/sliver\/\">series<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello! This is the second part of the three-part blog series explaining how to customize Sliver C2 by adding your [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":159957,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[91,88],"tags":[131,135,190,191,192],"class_list":["post-2543","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles","category-tools","tag-golang","tag-windows","tag-c2","tag-red-teaming","tag-sliver"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>HN Security Customizing Sliver - Part 2<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HN Security Customizing Sliver - Part 2\" \/>\n<meta property=\"og:description\" content=\"Hello! This is the second part of the three-part blog series explaining how to customize Sliver C2 by adding your [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/\" \/>\n<meta property=\"og:site_name\" content=\"HN Security\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-24T09:54:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-15T13:24:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hnsecurity.it\/wp-content\/uploads\/2025\/09\/SILVER.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1600\" \/>\n\t<meta property=\"og:image:height\" content=\"836\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Alessandro Iandoli\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hnsec\" \/>\n<meta name=\"twitter:site\" content=\"@hnsec\" \/>\n<meta name=\"twitter:label1\" content=\"Scritto da\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alessandro Iandoli\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tempo di lettura stimato\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minuti\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/\"},\"author\":{\"name\":\"Alessandro Iandoli\",\"@id\":\"https:\/\/hnsecurity.it\/it\/#\/schema\/person\/7883a9c36dac7694ca101137125d5fff\"},\"headline\":\"Customizing Sliver &#8211; Part 2\",\"datePublished\":\"2023-10-24T09:54:46+00:00\",\"dateModified\":\"2025-09-15T13:24:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/\"},\"wordCount\":1085,\"publisher\":{\"@id\":\"https:\/\/hnsecurity.it\/it\/#organization\"},\"image\":{\"@id\":\"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/hnsecurity.it\/wp-content\/uploads\/2025\/09\/SILVER.jpg\",\"keywords\":[\"golang\",\"windows\",\"c2\",\"red teaming\",\"sliver\"],\"articleSection\":[\"Articles\",\"Tools\"],\"inLanguage\":\"it-IT\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/\",\"url\":\"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/\",\"name\":\"HN Security Customizing Sliver - Part 2\",\"isPartOf\":{\"@id\":\"https:\/\/hnsecurity.it\/it\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/hnsecurity.it\/wp-content\/uploads\/2025\/09\/SILVER.jpg\",\"datePublished\":\"2023-10-24T09:54:46+00:00\",\"dateModified\":\"2025-09-15T13:24:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/#primaryimage\",\"url\":\"https:\/\/hnsecurity.it\/wp-content\/uploads\/2025\/09\/SILVER.jpg\",\"contentUrl\":\"https:\/\/hnsecurity.it\/wp-content\/uploads\/2025\/09\/SILVER.jpg\",\"width\":1600,\"height\":836,\"caption\":\"Silver Framework logo\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/hnsecurity.it\/it\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Customizing Sliver &#8211; Part 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/hnsecurity.it\/it\/#website\",\"url\":\"https:\/\/hnsecurity.it\/it\/\",\"name\":\"HN Security\",\"description\":\"Offensive Security Specialists\",\"publisher\":{\"@id\":\"https:\/\/hnsecurity.it\/it\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/hnsecurity.it\/it\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"it-IT\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/hnsecurity.it\/it\/#organization\",\"name\":\"HN Security\",\"url\":\"https:\/\/hnsecurity.it\/it\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\/\/hnsecurity.it\/it\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/hnsecurity.it\/wp-content\/uploads\/2026\/01\/hn-libellula.jpg\",\"contentUrl\":\"https:\/\/hnsecurity.it\/wp-content\/uploads\/2026\/01\/hn-libellula.jpg\",\"width\":696,\"height\":696,\"caption\":\"HN Security\"},\"image\":{\"@id\":\"https:\/\/hnsecurity.it\/it\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/hnsec\",\"https:\/\/www.linkedin.com\/company\/hnsecurity\/\",\"https:\/\/github.com\/hnsecurity\",\"https:\/\/infosec.exchange\/@hnsec\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/hnsecurity.it\/it\/#\/schema\/person\/7883a9c36dac7694ca101137125d5fff\",\"name\":\"Alessandro Iandoli\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/644822f5d8329ca419a50c1f39c97de5ccd163d1932e4cdc60a6cc8cb64ed29e?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/644822f5d8329ca419a50c1f39c97de5ccd163d1932e4cdc60a6cc8cb64ed29e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/644822f5d8329ca419a50c1f39c97de5ccd163d1932e4cdc60a6cc8cb64ed29e?s=96&d=mm&r=g\",\"caption\":\"Alessandro Iandoli\"},\"url\":\"https:\/\/hnsecurity.it\/it\/blog\/author\/ale98\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HN Security Customizing Sliver - Part 2","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/","og_locale":"it_IT","og_type":"article","og_title":"HN Security Customizing Sliver - Part 2","og_description":"Hello! This is the second part of the three-part blog series explaining how to customize Sliver C2 by adding your [&hellip;]","og_url":"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/","og_site_name":"HN Security","article_published_time":"2023-10-24T09:54:46+00:00","article_modified_time":"2025-09-15T13:24:01+00:00","og_image":[{"width":1600,"height":836,"url":"https:\/\/hnsecurity.it\/wp-content\/uploads\/2025\/09\/SILVER.jpg","type":"image\/jpeg"}],"author":"Alessandro Iandoli","twitter_card":"summary_large_image","twitter_creator":"@hnsec","twitter_site":"@hnsec","twitter_misc":{"Scritto da":"Alessandro Iandoli","Tempo di lettura stimato":"5 minuti"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/#article","isPartOf":{"@id":"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/"},"author":{"name":"Alessandro Iandoli","@id":"https:\/\/hnsecurity.it\/it\/#\/schema\/person\/7883a9c36dac7694ca101137125d5fff"},"headline":"Customizing Sliver &#8211; Part 2","datePublished":"2023-10-24T09:54:46+00:00","dateModified":"2025-09-15T13:24:01+00:00","mainEntityOfPage":{"@id":"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/"},"wordCount":1085,"publisher":{"@id":"https:\/\/hnsecurity.it\/it\/#organization"},"image":{"@id":"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/#primaryimage"},"thumbnailUrl":"https:\/\/hnsecurity.it\/wp-content\/uploads\/2025\/09\/SILVER.jpg","keywords":["golang","windows","c2","red teaming","sliver"],"articleSection":["Articles","Tools"],"inLanguage":"it-IT"},{"@type":"WebPage","@id":"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/","url":"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/","name":"HN Security Customizing Sliver - Part 2","isPartOf":{"@id":"https:\/\/hnsecurity.it\/it\/#website"},"primaryImageOfPage":{"@id":"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/#primaryimage"},"image":{"@id":"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/#primaryimage"},"thumbnailUrl":"https:\/\/hnsecurity.it\/wp-content\/uploads\/2025\/09\/SILVER.jpg","datePublished":"2023-10-24T09:54:46+00:00","dateModified":"2025-09-15T13:24:01+00:00","breadcrumb":{"@id":"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/"]}]},{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/#primaryimage","url":"https:\/\/hnsecurity.it\/wp-content\/uploads\/2025\/09\/SILVER.jpg","contentUrl":"https:\/\/hnsecurity.it\/wp-content\/uploads\/2025\/09\/SILVER.jpg","width":1600,"height":836,"caption":"Silver Framework logo"},{"@type":"BreadcrumbList","@id":"https:\/\/hnsecurity.it\/it\/blog\/customizing-sliver-part-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hnsecurity.it\/it\/"},{"@type":"ListItem","position":2,"name":"Customizing Sliver &#8211; Part 2"}]},{"@type":"WebSite","@id":"https:\/\/hnsecurity.it\/it\/#website","url":"https:\/\/hnsecurity.it\/it\/","name":"HN Security","description":"Offensive Security Specialists","publisher":{"@id":"https:\/\/hnsecurity.it\/it\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hnsecurity.it\/it\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"it-IT"},{"@type":"Organization","@id":"https:\/\/hnsecurity.it\/it\/#organization","name":"HN Security","url":"https:\/\/hnsecurity.it\/it\/","logo":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/hnsecurity.it\/it\/#\/schema\/logo\/image\/","url":"https:\/\/hnsecurity.it\/wp-content\/uploads\/2026\/01\/hn-libellula.jpg","contentUrl":"https:\/\/hnsecurity.it\/wp-content\/uploads\/2026\/01\/hn-libellula.jpg","width":696,"height":696,"caption":"HN Security"},"image":{"@id":"https:\/\/hnsecurity.it\/it\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/hnsec","https:\/\/www.linkedin.com\/company\/hnsecurity\/","https:\/\/github.com\/hnsecurity","https:\/\/infosec.exchange\/@hnsec"]},{"@type":"Person","@id":"https:\/\/hnsecurity.it\/it\/#\/schema\/person\/7883a9c36dac7694ca101137125d5fff","name":"Alessandro Iandoli","image":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/secure.gravatar.com\/avatar\/644822f5d8329ca419a50c1f39c97de5ccd163d1932e4cdc60a6cc8cb64ed29e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/644822f5d8329ca419a50c1f39c97de5ccd163d1932e4cdc60a6cc8cb64ed29e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/644822f5d8329ca419a50c1f39c97de5ccd163d1932e4cdc60a6cc8cb64ed29e?s=96&d=mm&r=g","caption":"Alessandro Iandoli"},"url":"https:\/\/hnsecurity.it\/it\/blog\/author\/ale98\/"}]}},"jetpack_featured_media_url":"https:\/\/hnsecurity.it\/wp-content\/uploads\/2025\/09\/SILVER.jpg","_links":{"self":[{"href":"https:\/\/hnsecurity.it\/it\/wp-json\/wp\/v2\/posts\/2543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hnsecurity.it\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hnsecurity.it\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hnsecurity.it\/it\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/hnsecurity.it\/it\/wp-json\/wp\/v2\/comments?post=2543"}],"version-history":[{"count":1,"href":"https:\/\/hnsecurity.it\/it\/wp-json\/wp\/v2\/posts\/2543\/revisions"}],"predecessor-version":[{"id":160124,"href":"https:\/\/hnsecurity.it\/it\/wp-json\/wp\/v2\/posts\/2543\/revisions\/160124"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hnsecurity.it\/it\/wp-json\/wp\/v2\/media\/159957"}],"wp:attachment":[{"href":"https:\/\/hnsecurity.it\/it\/wp-json\/wp\/v2\/media?parent=2543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hnsecurity.it\/it\/wp-json\/wp\/v2\/categories?post=2543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hnsecurity.it\/it\/wp-json\/wp\/v2\/tags?post=2543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}