Scan-T简介

前言

看着自己编写的代码没有说明的确不方便别人开发,便写了部分说明在这边。简单的记录该项目的相关说明。

关于Scan-T项目的说明

  • 文件分布:详细文件分类
  • 功能使用:大致的功能描述
  • 效果展示: 初步的界面效果
  • TODO: 进一步需要做的事情
  • 其他: 补充的地方

简介

  Scan-T是一个网络空间指纹扫描工具,用于记录主机上的端口信息。以分布的方式,方便数据的抓取以及呈现,未来将会添加统计以及总结这些数据潜在的意义(暂时思路比较模糊)。有愿意指点我的,可以提供一点思路,谢谢。

整体架构

  Scan-T的整体架构为nginx+Django+uwsgi,主体语言为python,抓取信息时,使用线程,进程,协程相互配合方式,检索数据使用ES配合redis,提高检索效率.

项目地址

  https://github.com/nanshihui/Scan-T

效果展示

首页

PS-PNG-main

检索结果

PS-PNG-result

后台

PS-PNG-work

统计分析页面

PS-PNG-analyse

主机位置明细页面

PS-PNG-analyse



整体思路

  整个项目是一个分布式的形式。如果在单台机子上,就是一个WEB项目,如果在多台机上面,就是一个主从的运行模式,由主机从用户的输入以及定时产生的任务产生数据,自己在处理数据的同时,如果从机有响应任务请求。主机会将一部分的任务发送给从机。待从机执行完任务后,将结果反馈给主机。主机再将结果返回给用户以及数据库里。由于所有的消息都是异步的,所以在实现的时候,大部分都是异步,以任务的形式分发,执行。

安装方法

Prepare the environment

1
2
3
4
5
6
apt-get update 
apt-get install -y nmap
apt-get install -y libjson-c-dev libjson-c2 libjson0 libjson0-dev
apt-get install -y redis-server zmap libffi-dev libssl-dev python-pip libmysqlclient-dev
apt-get install -y wget unzip
apt-get install mysql-server

Get the code

1
2
3
wget https://github.com/nanshihui/Scan-T/archive/master.zip
unzip master.zip
cd Scan-T-master/

Install package

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pip install MySQL-python
pip install BeautifulSoup==3.2.1
pip install beautifulsoup4==4.4.1
pip install Django==1.9
pip install python-nmap==0.5.0.post1
pip install DBUtils==1.1
pip install paramiko==1.16.0
pip install ruamel.ordereddict==0.4.9
pip install scapy==2.3.2
pip install scapy-http==1.7
pip install objgraph==2.0.1
pip install pycrypto==2.6.1
pip install dozer
pip install faulthandler
pip install apscheduler

Set the mysql config

  • create table
1
mysql -uroot -p -e 'create database datap'
  • change password

change you sql password both in spidermanage/spidertool/config.py
toolforspider/spidermanage/spidermanage/settings.py

  • import the data structure
1
mysql -uroot -p datap -e 'source /toolforspider-master/spidermanage/sqldata/Dump20160331.sql'
  • add your username

add your username and password in usertable

Add css file

  • PATH:/toolforspider-master/spidermanage/common_static/nmaptool/css/bootstrap/

create floder named lib and download css below

1
2
http://cine9deabril.com.br/fn/jquery/jquery-ui-1.10.2.custom/css/custom-theme/jquery-ui-1.10.2.custom.css
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.css

Add logfile

1
2
3

mkdir spidermanage/lib/
touch spidermanage/lib/__init__.py

add the following code to spidermanage/lib/logger.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

#!/usr/bin/python
# encoding=utf-8


import logging

def initLog(logfile, level=2, verbose=False):
'''
日志记录函数,日志等级默认为2,即INFO级别的日志
verbose - 是否屏幕输出,默认False
'''

logLevel = logging.INFO
if level == 0:
logLevel = logging.NOTSET
elif level == 1:
logLevel = logging.DEBUG
elif level == 2:
logLevel = logging.INFO
elif level == 3:
logLevel = logging.WARNING
elif level == 4:
logLevel = logging.ERROR
elif level == 5:
logLevel = logging.CRITICAL
logger = logging.getLogger('pocdect')
console = logging.FileHandler(logfile)
formatter = logging.Formatter('[%(asctime)s]%(filename)s-%(process)d-%(thread)d-%(lineno)d-%(levelname)8s-"%(message)s"','%Y-%m-%d %a %H:%M:%S')
console.setFormatter(formatter)
logger.addHandler(console)
logger.setLevel(logLevel)

if verbose:
console = logging.StreamHandler()
console.setLevel(logLevel) # always debug mode to screen
formatter = logging.Formatter('%(name)-8s: %(levelname)-8s %(message)s')
console.setFormatter(formatter)
logger.addHandler(console)

return logger

Start

1
python spidermanage/manage.py runserver 0.0.0.0:80 --insecure

使用方法

软件不需要用户手动的创建任务便会在后台随机产生任务,并在互联网上抓取,也可以直接创建任务抓取信息.
  暂时先这样,未完待续。。。

文章目录
  1. 1. 前言
    1. 1.1. 关于Scan-T项目的说明
  2. 2. 简介
  3. 3. 整体架构
    1. 3.1. 项目地址
  4. 4. 效果展示
    1. 4.1. 首页
    2. 4.2. 检索结果
    3. 4.3. 后台
    4. 4.4. 统计分析页面
    5. 4.5. 主机位置明细页面
  5. 5. 整体思路
  6. 6. 安装方法
    1. 6.1. Prepare the environment
    2. 6.2. Get the code
    3. 6.3. Install package
    4. 6.4. Set the mysql config
    5. 6.5. Add css file
    6. 6.6. Add logfile
    7. 6.7. Start
  7. 7. 使用方法
收藏文章
表情删除后不可恢复,是否删除
取消
确定
图片正在上传,请稍后...
评论内容为空!
  • 评论
79人参与,29条评论
  • 最新评论
2018年5月23日 9:22 一生都为你 潜水 [河北省石家庄市网友]

AttributeError: 'module' object has no attribute 'raise_from' 小白问一句,,这报错是为啥,setup.sh 安装的

2017年8月25日 7:38 冒泡 [上海市网友]
1 [山东省临沂市网友]

时隔半年,又一次搭建,成功了,但后台登录密码是啥,加密是啥,前辈求解,很看好你这程序

默认是 admin admin

2017年8月25日 7:37 冒泡 [上海市网友]
1 [山东省临沂市网友]

刚看到了sql请求语句,换了个表,加了个明文账户登录进去了,但用户权限和用户作用怎么填写

1权限 最低

2017年7月21日 17:15 冒泡 [山东省临沂市网友]

附成功图

2017年7月21日 17:14 冒泡 [山东省临沂市网友]

刚看到了sql请求语句,换了个表,加了个明文账户登录进去了,但用户权限和用户作用怎么填写

2017年7月21日 17:03 冒泡 [山东省临沂市网友]

时隔半年,又一次搭建,成功了,但后台登录密码是啥,加密是啥,前辈求解,很看好你这程序

2017年2月4日 4:11 Sherwel 潜水

如果是kali,使用安装文件没问题,其他系统请按wiki说明,安装

2017年2月4日 4:10 Sherwel 潜水

有一个简单指纹模块,详细web指纹模块,暂未开源

2017年1月22日 9:34 nanshihui.github.io网友 冒泡

用的bash environment.sh 安装的,打开后点击登录报错500!怎么破?

2017年1月22日 5:40 nanshihui.github.io网友 冒泡

请问有web指纹模块么?

2016年12月18日 0:23 Sherwel 潜水

可能你没安装好吧,有哪些 安装问题 可以提到 issue

2016年10月15日 19:32 猥琐叔 潜水

前辈,我安装完之后界面显示不完整哎,就一个登陆 / 关于








2016年7月8日 13:58 Sherwel 潜水

主要的是你的回复 的内容 过于扭曲, 会被标记 需要审核, 你在git上面的issue 写会更清晰一点

2016年7月8日 2:54 nanshihui.github.io网友 冒泡

另外你的博客发布评论之后不能立即显示

2016年7月8日 2:51 nanshihui.github.io网友 冒泡

cd spidermanage, run:

-----------------------

Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
存在内容,进入elasticsearch 检索
No module named elasticsearch_dsl.query
ERROR:django.request:Internal Server Error: /search/searchdetail/

File /root/Scan-T-master/spidermanage/fontsearch/searchroute.py, line 54, in detailpage
ports, portcount, portpagecount = getattr(portcontrol, 'portabstractshow', 'portabstractshow')(**jsoncontent)
TypeError: portabstractshow() argument after ** must be a mapping, not NoneType

2016年7月8日 2:49 nanshihui.github.io网友 冒泡

cd spidermanage 目录下 run:

___________________________

error:

Django version 1.9, using settings 'spidermanage.settings'
Starting development server at //0.0.0.0:80/
Quit the server with CONTROL-C.
init schedule
[08/Jul/2016 10:45:29] GET / HTTP/1.1 200 5589
[08/Jul/2016 10:45:34] GET /search/searchmain/?page=0&searchcontent=a HTTP/1.1 200 18880
WARNING:django.request:Not Found: /static/img/bgs/landscape.jpg
[08/Jul/2016 10:45:34] GET /static/img/bgs/landscape.jpg HTTP/1.1 404 102
Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
存在内容,进入elasticsearch 检索
No module named elasticsearch_dsl.query
ERROR:django.request:Internal Server Error: /search/searchdetail/
Traceback (most recent call last):
File /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py, line 149, in get_response
response = self.process_exception_by_middleware(e, request)
File /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py, line 147, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File /root/Scan-T-master/spidermanage/fontsearch/searchroute.py, line 54, in detailpage
ports, portcount, portpagecount = getattr(portcontrol, 'portabstractshow', 'portabstractshow')(**jsoncontent)
TypeError: portabstractshow() argument after ** must be a mapping, not NoneType
[08/Jul/2016 10:45:34] POST /search/searchdetail/ HTTP/1.1 500 27

2016年7月8日 2:47 nanshihui.github.io网友 冒泡

issue ?

cd spidermanage 目录下 run:

____________________________________

error question:[衰]

System check identified 1 issue (0 silenced).
July 08, 2016 - 10:45:26
Django version 1.9, using settings 'spidermanage.settings'
Starting development server at //0.0.0.0:80/
Quit the server with CONTROL-C.
init schedule
[08/Jul/2016 10:45:29] GET / HTTP/1.1 200 5589
[08/Jul/2016 10:45:34] GET /search/searchmain/?page=0&searchcontent=a HTTP/1.1 200 18880
WARNING:django.request:Not Found: /static/img/bgs/landscape.jpg
[08/Jul/2016 10:45:34] GET /static/img/bgs/landscape.jpg HTTP/1.1 404 102
Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
存在内容,进入elasticsearch 检索
No module named elasticsearch_dsl.query
ERROR:django.request:Internal Server Error: /search/searchdetail/
Traceback (most recent call last):
File /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py, line 149, in get_response
response = self.process_exception_by_middleware(e, request)
File /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py, line 147, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File /root/Scan-T-master/spidermanage/fontsearch/searchroute.py, line 54, in detailpage
ports, portcount, portpagecount = getattr(portcontrol, 'portabstractshow', 'portabstractshow')(**jsoncontent)
TypeError: portabstractshow() argument after ** must be a mapping, not NoneType
[08/Jul/2016 10:45:34] POST /search/searchdetail/ HTTP/1.1 500 27

2016年7月7日 11:52 Sherwel 潜水

git

2016年7月7日 11:21 Sherwel 潜水

你在运行的时候.没有在spidermanage 目录下.
建议到issue上面提问题

2016年7月7日 9:43 nanshihui.github.io网友 冒泡

error question:

Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
存在内容,进入elasticsearch 检索
No module named elasticsearchmanage
ERROR:django.request:Internal Server Error: /search/searchdetail/

2016年7月7日 2:00 nanshihui.github.io网友 冒泡

wiki在哪里呀

2016年6月18日 5:55 Sherwel 潜水

建议参考wiki 的说明安装。

2016年6月17日 18:03 nanshihui.github.io网友 冒泡

总是在排队额

2016年6月13日 9:45 Sherwel 潜水

建议参考wiki 的说明安装。

2016年6月13日 5:46 王鹏飞_Cloud 潜水

迁移数据库的时候提示 AttributeError: 'tuple' object has no attribute 'public' 貌似好多人提示这个错误……

2016年5月30日 23:55 Sherwel 潜水

他们可以完全分离,如有需要,可以参考https://github.com/nanshihui/normal_hack,这个是 完全 独立出来的,但是 更新进度会慢一点, 如果 你只想要漏洞 扫描框架,可以使用https://github.com/nanshihui/normal_hark_lite

2016年5月30日 15:41 nanshihui.github.io网友 冒泡

网络空间指纹扫描是和web打包的吗? 方便分离出来吗?
我想试试这个扫描的

2016年5月28日 3:22 Sherwel 潜水

谢谢,目前是把最核心的功能加上去了,其他的外围 比如 注册这些功能, 需要大家一起完善。我把使用说明放在wiki 上了 你可以去看了

2016年5月27日 6:36 nanshihui.github.io网友 冒泡

给作者点建议:
1. 写一下安装过程,或者编写一个安装脚本。这有助于更多的朋友加入到这个项目。手工摸索搭建太麻烦了。
2. 完善基础功能。系统竟然没有注册功能!让人没办法下手啊!功能可以少一些,但是基础的东西一定要做好。
3. 做一个使用教程。虽然艰难的搭建起来了系统。但是已经没有使用的欲望了。因为随处点击都会出现404.
不清楚怎么下手,该怎么用
4. 解决github 屏蔽lib的问题。
5. 谢谢作者的开源精神!加油!

按钮 内容不能为空!
立刻说两句吧! 查看29条评论
|
Fork me on GitHub