[SHEHZADE//ABDULLAH ANSARI]
Red Team Consultant @ Google | MS in Cybersecurity @ NYU
● Notice //GitHub (@shehzade) is temporarily suspended pending an automated false-positive review. All tools are hosted on this Code Mirror and available on request (contact); GitHub links will return once reinstated.
PUBLIC MIRRORGo v1.0
Multi-protocol network egress assessment and DLP verification framework featuring automated L4 sweeps, corporate proxy traversal, and covert protocol smuggling across 20+ channels.
$
git clone https://shehzade.io/repos/contraband.git
Copy
Source ZIP (1.93 MB)
153 lines · 6.1 KB
| 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. |
| 2 | // versions: |
| 3 | // - protoc-gen-go-grpc v1.6.2 |
| 4 | // - protoc v3.21.12 |
| 5 | // source: proto/exfil.proto |
| 6 | |
| 7 | package proto |
| 8 | |
| 9 | import ( |
| 10 | context "context" |
| 11 | grpc "google.golang.org/grpc" |
| 12 | codes "google.golang.org/grpc/codes" |
| 13 | status "google.golang.org/grpc/status" |
| 14 | ) |
| 15 | |
| 16 | // This is a compile-time assertion to ensure that this generated file |
| 17 | // is compatible with the grpc package it is being compiled against. |
| 18 | // Requires gRPC-Go v1.64.0 or later. |
| 19 | const _ = grpc.SupportPackageIsVersion9 |
| 20 | |
| 21 | const ( |
| 22 | ExfilService_UploadChunk_FullMethodName = "/contraband.ExfilService/UploadChunk" |
| 23 | ExfilService_UploadStream_FullMethodName = "/contraband.ExfilService/UploadStream" |
| 24 | ) |
| 25 | |
| 26 | // ExfilServiceClient is the client API for ExfilService service. |
| 27 | // |
| 28 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. |
| 29 | type ExfilServiceClient interface { |
| 30 | UploadChunk(ctx context.Context, in *ChunkRequest, opts ...grpc.CallOption) (*ChunkResponse, error) |
| 31 | UploadStream(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[ChunkRequest, ChunkResponse], error) |
| 32 | } |
| 33 | |
| 34 | type exfilServiceClient struct { |
| 35 | cc grpc.ClientConnInterface |
| 36 | } |
| 37 | |
| 38 | func NewExfilServiceClient(cc grpc.ClientConnInterface) ExfilServiceClient { |
| 39 | return &exfilServiceClient{cc} |
| 40 | } |
| 41 | |
| 42 | func (c *exfilServiceClient) UploadChunk(ctx context.Context, in *ChunkRequest, opts ...grpc.CallOption) (*ChunkResponse, error) { |
| 43 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 44 | out := new(ChunkResponse) |
| 45 | err := c.cc.Invoke(ctx, ExfilService_UploadChunk_FullMethodName, in, out, cOpts...) |
| 46 | if err != nil { |
| 47 | return nil, err |
| 48 | } |
| 49 | return out, nil |
| 50 | } |
| 51 | |
| 52 | func (c *exfilServiceClient) UploadStream(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[ChunkRequest, ChunkResponse], error) { |
| 53 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 54 | stream, err := c.cc.NewStream(ctx, &ExfilService_ServiceDesc.Streams[0], ExfilService_UploadStream_FullMethodName, cOpts...) |
| 55 | if err != nil { |
| 56 | return nil, err |
| 57 | } |
| 58 | x := &grpc.GenericClientStream[ChunkRequest, ChunkResponse]{ClientStream: stream} |
| 59 | return x, nil |
| 60 | } |
| 61 | |
| 62 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. |
| 63 | type ExfilService_UploadStreamClient = grpc.ClientStreamingClient[ChunkRequest, ChunkResponse] |
| 64 | |
| 65 | // ExfilServiceServer is the server API for ExfilService service. |
| 66 | // All implementations must embed UnimplementedExfilServiceServer |
| 67 | // for forward compatibility. |
| 68 | type ExfilServiceServer interface { |
| 69 | UploadChunk(context.Context, *ChunkRequest) (*ChunkResponse, error) |
| 70 | UploadStream(grpc.ClientStreamingServer[ChunkRequest, ChunkResponse]) error |
| 71 | mustEmbedUnimplementedExfilServiceServer() |
| 72 | } |
| 73 | |
| 74 | // UnimplementedExfilServiceServer must be embedded to have |
| 75 | // forward compatible implementations. |
| 76 | // |
| 77 | // NOTE: this should be embedded by value instead of pointer to avoid a nil |
| 78 | // pointer dereference when methods are called. |
| 79 | type UnimplementedExfilServiceServer struct{} |
| 80 | |
| 81 | func (UnimplementedExfilServiceServer) UploadChunk(context.Context, *ChunkRequest) (*ChunkResponse, error) { |
| 82 | return nil, status.Error(codes.Unimplemented, "method UploadChunk not implemented") |
| 83 | } |
| 84 | func (UnimplementedExfilServiceServer) UploadStream(grpc.ClientStreamingServer[ChunkRequest, ChunkResponse]) error { |
| 85 | return status.Error(codes.Unimplemented, "method UploadStream not implemented") |
| 86 | } |
| 87 | func (UnimplementedExfilServiceServer) mustEmbedUnimplementedExfilServiceServer() {} |
| 88 | func (UnimplementedExfilServiceServer) testEmbeddedByValue() {} |
| 89 | |
| 90 | // UnsafeExfilServiceServer may be embedded to opt out of forward compatibility for this service. |
| 91 | // Use of this interface is not recommended, as added methods to ExfilServiceServer will |
| 92 | // result in compilation errors. |
| 93 | type UnsafeExfilServiceServer interface { |
| 94 | mustEmbedUnimplementedExfilServiceServer() |
| 95 | } |
| 96 | |
| 97 | func RegisterExfilServiceServer(s grpc.ServiceRegistrar, srv ExfilServiceServer) { |
| 98 | // If the following call panics, it indicates UnimplementedExfilServiceServer was |
| 99 | // embedded by pointer and is nil. This will cause panics if an |
| 100 | // unimplemented method is ever invoked, so we test this at initialization |
| 101 | // time to prevent it from happening at runtime later due to I/O. |
| 102 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { |
| 103 | t.testEmbeddedByValue() |
| 104 | } |
| 105 | s.RegisterService(&ExfilService_ServiceDesc, srv) |
| 106 | } |
| 107 | |
| 108 | func _ExfilService_UploadChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 109 | in := new(ChunkRequest) |
| 110 | if err := dec(in); err != nil { |
| 111 | return nil, err |
| 112 | } |
| 113 | if interceptor == nil { |
| 114 | return srv.(ExfilServiceServer).UploadChunk(ctx, in) |
| 115 | } |
| 116 | info := &grpc.UnaryServerInfo{ |
| 117 | Server: srv, |
| 118 | FullMethod: ExfilService_UploadChunk_FullMethodName, |
| 119 | } |
| 120 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 121 | return srv.(ExfilServiceServer).UploadChunk(ctx, req.(*ChunkRequest)) |
| 122 | } |
| 123 | return interceptor(ctx, in, info, handler) |
| 124 | } |
| 125 | |
| 126 | func _ExfilService_UploadStream_Handler(srv interface{}, stream grpc.ServerStream) error { |
| 127 | return srv.(ExfilServiceServer).UploadStream(&grpc.GenericServerStream[ChunkRequest, ChunkResponse]{ServerStream: stream}) |
| 128 | } |
| 129 | |
| 130 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. |
| 131 | type ExfilService_UploadStreamServer = grpc.ClientStreamingServer[ChunkRequest, ChunkResponse] |
| 132 | |
| 133 | // ExfilService_ServiceDesc is the grpc.ServiceDesc for ExfilService service. |
| 134 | // It's only intended for direct use with grpc.RegisterService, |
| 135 | // and not to be introspected or modified (even as a copy) |
| 136 | var ExfilService_ServiceDesc = grpc.ServiceDesc{ |
| 137 | ServiceName: "contraband.ExfilService", |
| 138 | HandlerType: (*ExfilServiceServer)(nil), |
| 139 | Methods: []grpc.MethodDesc{ |
| 140 | { |
| 141 | MethodName: "UploadChunk", |
| 142 | Handler: _ExfilService_UploadChunk_Handler, |
| 143 | }, |
| 144 | }, |
| 145 | Streams: []grpc.StreamDesc{ |
| 146 | { |
| 147 | StreamName: "UploadStream", |
| 148 | Handler: _ExfilService_UploadStream_Handler, |
| 149 | ClientStreams: true, |
| 150 | }, |
| 151 | }, |
| 152 | Metadata: "proto/exfil.proto", |
| 153 | } |