Skip to content

Commit

Permalink
Merge pull request hacklcx#28 from hacklcx/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
sanjinhub authored Sep 8, 2019
2 parents 70b908f + 0980a01 commit 3439eab
Show file tree
Hide file tree
Showing 49 changed files with 2,383 additions and 1,275 deletions.
695 changes: 674 additions & 21 deletions LICENSE

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# 介绍

> 本项目使用 **GPL** 协议,未经授权,禁止使用商业用途。
>
> *本 Team 研发此平台,仅为企业安全测试使用,禁止其他人员使用非法用途!一切行为与本 Team 无关。*
**HFish** 是一款基于 Golang 开发的跨平台多功能主动诱导型蜜罐框架系统,为了企业安全防护测试做出了精心的打造
Expand Down Expand Up @@ -207,7 +209,6 @@ URL(Get): http://localhost:9001/api/v1/get/fish_info
- [ ] 蜜罐高交互完善
- [ ] 支持 Ngrok 一键映射
- [ ] 支持更多的图表统计
- [ ] Mysql 支持
- [ ] 规划更多的功能...

# 关于
Expand Down
22 changes: 11 additions & 11 deletions admin/colony.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ <h4 class="page-title">分布式集群</h4>
</thead>
<tbody id="tableList">
<tr style="text-align: center;">
<td style="line-height: 200px;font-size: 20px;color: #a9a9a9;" colspan="5">暂无数据</td>
<td style="line-height: 200px;font-size: 20px;color: #a9a9a9;" colspan="11">暂无数据</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -120,7 +120,7 @@ <h4 class="page-title">分布式集群</h4>
for (var i = 0; i < data.length; i++) {
_h += '<tr>';

var last_update_time = data[i].last_update_time;
var last_update_time = data[i].last_update_time.replace("T", " ").replace("+08:00", "").replace("Z", "");
last_update_time = last_update_time.substring(0, 19);
last_update_time = last_update_time.replace(/-/g, '/');
var timestamp = new Date(last_update_time).getTime();
Expand All @@ -131,55 +131,55 @@ <h4 class="page-title">分布式集群</h4>
_h += ' <td class="td agent_name"><span class="openx"></span>' + data[i].agent_name + '</td>';
_h += ' <td class="td"><span>' + data[i].agent_ip + '</span></td>';

if (data[i].plug_status == "1") {
if (data[i].plug_status == 1) {
_h += ' <td class="td" style="text-align: center;"><span class="openx"></span></td>';
} else {
_h += ' <td class="td" style="text-align: center;"><span class="closex"></span></td>';
}

if (data[i].web_status == "1") {
if (data[i].web_status == 1) {
_h += ' <td class="td" style="text-align: center;"><span class="openx"></span></td>';
} else {
_h += ' <td class="td" style="text-align: center;"><span class="closex"></span></td>';
}

if (data[i].dart_status == "1") {
if (data[i].deep_status == 1) {
_h += ' <td class="td" style="text-align: center;"><span class="openx"></span></td>';
} else {
_h += ' <td class="td" style="text-align: center;"><span class="closex"></span></td>';
}

if (data[i].ssh_status == "1") {
if (data[i].ssh_status == 1 || data[i].ssh_status == 2) {
_h += ' <td class="td" style="text-align: center;"><span class="openx"></span></td>';
} else {
_h += ' <td class="td" style="text-align: center;"><span class="closex"></span></td>';
}

if (data[i].redis_status == "1") {
if (data[i].redis_status == 1) {
_h += ' <td class="td" style="text-align: center;"><span class="openx"></span></td>';
} else {
_h += ' <td class="td" style="text-align: center;"><span class="closex"></span></td>';
}

if (data[i].mysql_status == "1") {
if (data[i].mysql_status == 1) {
_h += ' <td class="td" style="text-align: center;"><span class="openx"></span></td>';
} else {
_h += ' <td class="td" style="text-align: center;"><span class="closex"></span></td>';
}

if (data[i].telnet_status == "1") {
if (data[i].telnet_status == 1) {
_h += ' <td class="td" style="text-align: center;"><span class="openx"></span></td>';
} else {
_h += ' <td class="td" style="text-align: center;"><span class="closex"></span></td>';
}

if (data[i].ftp_status == "1") {
if (data[i].ftp_status == 1) {
_h += ' <td class="td" style="text-align: center;"><span class="openx"></span></td>';
} else {
_h += ' <td class="td" style="text-align: center;"><span class="closex"></span></td>';
}

if (data[i].mem_cache_status == "1") {
if (data[i].mem_cache_status == 1) {
_h += ' <td class="td" style="text-align: center;"><span class="openx"></span></td>';
} else {
_h += ' <td class="td" style="text-align: center;"><span class="closex"></span></td>';
Expand Down
32 changes: 17 additions & 15 deletions admin/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ <h2 class="m-b-10"><span data-plugin="counterup">{{.deepSum}}</span></h2>

{{if eq .sshStatus "1"}}
<p><span class="openx"></span>SSH</p>
{{ else if eq .sshStatus "2"}}
<p><span class="openx"></span>SSH</p>
{{else}}
<p><span class="closex"></span>SSH</p>
{{end}}
Expand Down Expand Up @@ -463,42 +465,42 @@ <h2 class="m-b-10"><span data-plugin="counterup">{{.deepSum}}</span></h2>

for (var item in d.mysql) {
var index = xdata.indexOf(item);
mysqlData[index] = d.mysql[item];
mysqlData[index] = parseInt(d.mysql[item]);
}

for (var item in d.redis) {
var index = xdata.indexOf(item);
redisData[index] = d.redis[item];
redisData[index] = parseInt(d.redis[item]);
}

for (var item in d.ssh) {
var index = xdata.indexOf(item);
sshData[index] = d.ssh[item];
sshData[index] = parseInt(d.ssh[item]);
}

for (var item in d.web) {
var index = xdata.indexOf(item);
webData[index] = d.web[item];
webData[index] = parseInt(d.web[item]);
}

for (var item in d.deep) {
var index = xdata.indexOf(item);
deepData[index] = d.deep[item];
deepData[index] = parseInt(d.deep[item]);
}

for (var item in d.ftp) {
var index = xdata.indexOf(item);
ftpData[index] = d.ftp[item];
ftpData[index] = parseInt(d.ftp[item]);
}

for (var item in d.telnet) {
var index = xdata.indexOf(item);
telnetData[index] = d.telnet[item];
telnetData[index] = parseInt(d.telnet[item]);
}

for (var item in d.memCache) {
var index = xdata.indexOf(item);
memCacheData[index] = d.memCache[item];
memCacheData[index] = parseInt(d.memCache[item]);
}


Expand Down Expand Up @@ -610,13 +612,13 @@ <h2 class="m-b-10"><span data-plugin="counterup">{{.deepSum}}</span></h2>
url: "/get/dashboard/pie_data",
dataType: "json",
success: function (e) {
var d = e;
var d = e.data;

console.log(d);

var option = {
title: {
text: '攻击地区',
text: '[攻击地区] TOP10',
x: 'left'
},
tooltip: {
Expand All @@ -627,8 +629,8 @@ <h2 class="m-b-10"><span data-plugin="counterup">{{.deepSum}}</span></h2>
{
name: '来源地区',
type: 'pie',
radius: '70%',
center: ['50%', '50%'],
radius: '60%',
center: ['50%', '60%'],
data: d.regionList,
itemStyle: {
emphasis: {
Expand All @@ -646,7 +648,7 @@ <h2 class="m-b-10"><span data-plugin="counterup">{{.deepSum}}</span></h2>

var option = {
title: {
text: ' IP',
text: '[攻击IP] TOP10',
x: 'left'
},
tooltip: {
Expand All @@ -657,8 +659,8 @@ <h2 class="m-b-10"><span data-plugin="counterup">{{.deepSum}}</span></h2>
{
name: '攻击者IP',
type: 'pie',
radius: '70%',
center: ['50%', '50%'],
radius: '60%',
center: ['50%', '60%'],
data: d.ipList,
itemStyle: {
emphasis: {
Expand Down
30 changes: 30 additions & 0 deletions admin/data.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div id="p">

</div>

<script>
var ws = new WebSocket('ws://127.0.0.1:9001/data/ws');

ws.onopen = function () {
ws.send("ping");
};

ws.onmessage = function (evt) {
var received_msg = evt.data;
document.getElementById("p").innerHTML = "<p>" + received_msg + "</p>"
};

ws.onclose = function () {
// 关闭 websocket
console.log("close")
};
</script>
</body>
</html>
64 changes: 33 additions & 31 deletions admin/fish.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,17 @@ <h4 class="page-title">上钩列表</h4>
<th width="11%">项目</th>
<th width="8%">集群名称</th>
<th width="8%">来源 IP</th>
<th width="8%">地理信息</th>
<th width="9%">地理信息</th>
<th width="5%">信息</th>
<th width="5%">长度</th>
<th width="8%">上钩时间</th>
</tr>
</thead>
<tbody id="tableList"></tbody>
<tbody id="tableList">
<tr style="text-align: center;">
<td style="line-height: 200px;font-size: 20px;color: #a9a9a9;" colspan="8">暂无数据</td>
</tr>
</tbody>
</table>
</div>
<button type="button" id="delbtn" class="btn btn-danger waves-effect waves-light btn-sm"
Expand Down Expand Up @@ -226,8 +230,7 @@ <h6 class="modal-title" id="myModalLabel">上钩信息</h6>
success: function (e) {
if (e.code == 200) {
var data = e.data;
var str = data[0].info.replace(/&&/g, "<br>");
console.log(str);
var str = data.info.replace(/&&/g, "<br>");
$(".pre").html(str);
} else {
}
Expand Down Expand Up @@ -274,7 +277,7 @@ <h6 class="modal-title" id="myModalLabel">上钩信息</h6>
url: "/get/fish/typeList",
dataType: "json",
success: function (e) {
var data = e.resultInfoType;
var data = e.data.resultInfoType;
var _h = '<option value="all">请选择类型</option>';

for (var i = 0; i < data.length; i++) {
Expand All @@ -283,12 +286,11 @@ <h6 class="modal-title" id="myModalLabel">上钩信息</h6>

$("#selectType").html(_h);

var data1 = e.resultColonyName;
var data1 = e.data.resultColonyName;
var _h1 = '<option value="all">请选择集群</option>';
_h1 += '<option value="本机">本机</option>';

for (var i = 0; i < data1.length; i++) {
_h1 += '<option value="' + data1[i].agent_name + '">' + data1[i].agent_name + '</option>';
_h1 += '<option value="' + data1[i].agent + '">' + data1[i].agent + '</option>';
}
$("#selectColony").html(_h1);
},
Expand Down Expand Up @@ -348,48 +350,48 @@ <h6 class="modal-title" id="myModalLabel">上钩信息</h6>
var data = e.data;
var _h = '';

for (var i = 0; i < data.length; i++) {
for (var i = 0; i < data.result.length; i++) {
_h += '<tr>';
_h += ' <td class="td"><div class="checkbox checkbox-single checkbox-danger"><input type="checkbox" value="' + data[i].id + '" name="check_x" onchange="changedel()"><label></label></div></td>'
_h += ' <td class="td"><div class="checkbox checkbox-single checkbox-danger"><input type="checkbox" value="' + data.result[i].id + '" name="check_x" onchange="changedel()"><label></label></div></td>'
_h += ' <td class="td">';
if (data[i].type == "WEB") {
if (data.result[i].type == "WEB") {
_h += ' <span class="label label-primary">WEB</span> ';
} else if (data[i].type == "SSH") {
} else if (data.result[i].type == "SSH") {
_h += ' <span class="label lb_ssh">SSH</span> ';
} else if (data[i].type == "REDIS") {
} else if (data.result[i].type == "REDIS") {
_h += ' <span class="label lb_redis">REDIS</span> ';
} else if (data[i].type == "MYSQL") {
} else if (data.result[i].type == "MYSQL") {
_h += ' <span class="label lb_mysql">MYSQL</span> ';
} else if (data[i].type == "FTP") {
} else if (data.result[i].type == "FTP") {
_h += ' <span class="label lb_ftp">FTP</span> ';
} else if (data[i].type == "TELNET") {
} else if (data.result[i].type == "TELNET") {
_h += ' <span class="label lb_telnet">TELNET</span> ';
} else if (data[i].type == "DEEP") {
} else if (data.result[i].type == "DEEP") {
_h += ' <span class="label lb_deep">DEEP</span> ';
} else if (data[i].type == "MEMCACHE") {
} else if (data.result[i].type == "MEMCACHE") {
_h += ' <span class="label lb_mem_cache">MEMCACHE</span> ';
} else if (data[i].type == "PLUG") {
} else if (data.result[i].type == "PLUG") {
_h += ' <span class="label lb_plug">PLUG</span> ';
}

_h += ' <span class="project">' + data[i].project_name + '</span>';
_h += ' <span class="project">' + data.result[i].project_name + '</span>';
_h += ' </td>';
_h += ' <td class="td"><span class="agent_name">' + data[i].agent + '</span></td>';
_h += ' <td class="td" style="font-weight: bold;">' + data[i].ip + '</td>';
_h += ' <td class="td"><span class="agent_name">' + data.result[i].agent + '</span></td>';
_h += ' <td class="td" style="font-weight: bold;">' + data.result[i].ip + '</td>';

// country,region,city
if (data[i].country == "本机地址") {
if (data.result[i].country == "本机地址") {
_h += ' <td class="td"><span class="ipinfo">本机地址</span></td>';
} else if (data[i].country == "局域网") {
} else if (data.result[i].country == "局域网") {
_h += ' <td class="td"><span class="ipinfo">局域网</span></td>';
}
else {
_h += ' <td class="td"><span class="ipinfo">' + data[i].country + ' ' + data[i].region + ' ' + data[i].city + '</span></td>';
_h += ' <td class="td"><span class="ipinfo">' + data.result[i].country + ' ' + data.result[i].region + ' ' + data.result[i].city + '</span></td>';
}

_h += ' <td><span class="info" onclick="show(' + data[i].id + ')">点击查看</span></td>';
_h += ' <td class="td"><span class="cinfo">' + data[i].info.length + '</span></td>';
_h += ' <td class="td">' + data[i].create_time + '</td>';
_h += ' <td><span class="info" onclick="show(' + data.result[i].id + ')">点击查看</span></td>';
_h += ' <td class="td"><span class="cinfo">' + data.result[i].info.length + '</span></td>';
_h += ' <td class="td">' + data.result[i].create_time.replace("T", " ").replace("+08:00", " ").replace("Z", "") + '</td>';
_h += '</tr>';
}

Expand All @@ -399,9 +401,9 @@ <h6 class="modal-title" id="myModalLabel">上钩信息</h6>

$("#tableList").html(_h);

var pageCount = e.pageCount;
var totalCount = e.totalCount;
var page = e.page;
var pageCount = data.pageCount;
var totalCount = data.totalCount;
var page = data.page;


$("#myPage").sPage({
Expand Down
7 changes: 7 additions & 0 deletions admin/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
<div class="tab-content">
<div class="tab-pane fade in active" id="home-2">
<div class="timeline-2">
<div class="time-item">
<div class="item-info">
<small class="text-muted">2019-09-09</small>
<p>发布 v0.3.1 版本</p>
</div>
</div>
<div class="time-item">
<div class="item-info">
<small class="text-muted">2019-08-27</small>
Expand Down Expand Up @@ -63,6 +69,7 @@
<script src="/static/libs/switchery/switchery.min.js"></script>
<script src="/static/libs/waypoints/lib/jquery.waypoints.js"></script>
<script src="/static/libs/counterup/jquery.counterup.min.js"></script>
<script src="/static/libs/moment/moment.min.js"></script>

<!-- App js -->
<script src="/static/js/jquery.core.js"></script>
Expand Down
Loading

0 comments on commit 3439eab

Please sign in to comment.