HFish/view/colony/view.go
SanJin 259b400150 ~ Telnet 高交互完善
~ Redis 蜜罐高交互完善
~ MemCache 蜜罐支持,支持高交互
~ HFish 插件支持,后续会开放超强蜜罐生态
2019-08-25 15:22:37 +08:00

51 lines
846 B
Go

package colony
import (
"github.com/gin-gonic/gin"
"net/http"
"HFish/core/dbUtil"
"HFish/error"
)
func Html(c *gin.Context) {
c.HTML(http.StatusOK, "colony.html", gin.H{})
}
// 获取蜜罐分类信息
func GetColony(c *gin.Context) {
sql := `
SELECT
id,
agent_name,
agent_ip,
web_status,
deep_status,
ssh_status,
redis_status,
mysql_status,
http_status,
telnet_status,
ftp_status,
mem_cache_status,
plug_status,
last_update_time
FROM
hfish_colony
ORDER BY
id DESC;
`
result := dbUtil.Query(sql)
c.JSON(http.StatusOK, error.ErrSuccess(result))
}
// 删除集群
func PostColonyDel(c *gin.Context) {
id := c.PostForm("id")
sqlDel := `delete from hfish_colony where id=?;`
dbUtil.Delete(sqlDel, id)
c.JSON(http.StatusOK, error.ErrSuccessNull())
}