File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -101,8 +101,21 @@ func (httpServer *Server) Init(channel channel.Channel) bool {
101101
102102 return false
103103 }
104- httpServer .HTTPAddr = channel .HTTPAddr
105- httpServer .HTTPPort = channel .HTTPPort
104+
105+ switch {
106+ case channel .HTTPPort == 0 && channel .Port != 0 :
107+ // must be stand-alone invocation of HTTPServeFile
108+ httpServer .HTTPAddr = channel .IPAddr
109+ httpServer .HTTPPort = channel .Port
110+ case channel .HTTPPort != 0 :
111+ // must be used with another C2
112+ httpServer .HTTPAddr = channel .HTTPAddr
113+ httpServer .HTTPPort = channel .HTTPPort
114+ default :
115+ output .PrintFrameworkError ("Called HTTPServeFile without specifying a bind port." )
116+
117+ return false
118+ }
106119
107120 // split the provided files, read them in, and store them in the map
108121 files := strings .Split (httpServer .FilesToServe , "," )
You can’t perform that action at this time.
0 commit comments