Skip to content

Commit

Permalink
Merge pull request #10 from wikiZ/main
Browse files Browse the repository at this point in the history
Update kunyu v1.3
  • Loading branch information
0x7Fancy committed Aug 13, 2021
2 parents 956535e + 5afcfb7 commit 8a759d4
Show file tree
Hide file tree
Showing 20 changed files with 178 additions and 48 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# virtual environments
venv/
build/
dist/
kunyu.egg-info/
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v1.3] - 2021-8-12
### Added
- Calculate hex/base64/mmh3/md5 Command : [EncodeHash]
- Optimized the problem of red font garbled output in the terminal
- Added public method of encode function
- Support calling pocsuite components

## [v1.2] - 2021-8-2
### Added
- optimizedthe problem of outputting an empty table when no data is returned
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ include MANIFEST.in
include README.md
include CHANGELOG
recursive-include kunyu *
include *.txt
recursive-exclude kunyu __pycache__
recursive-exclude kunyu *.py[co]
39 changes: 36 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ Windows:
cd kunyu
python3 console.py
P.S. Windows also supports python3 setup.py install
P.S. Windows also supports python3 setup.py install.
You can also use pip install kunyu to install and update.
```

# 0x02 Configuration instructions
Expand Down Expand Up @@ -73,13 +74,15 @@ Global commands:
SearchBatch <File> Batch search Host
SearchCert <Domain> SSL certificate Search
SearchDomain <Domain> Domain name associated/subdomain search
EncodeHash <encryption> <query> Encryption method interface
Seebug <Query> Search Seebug vulnerability information
set <Option> Set arguments values
ExportPath Returns the path of the output file
Pocsuite3 Invoke the pocsuite component
ExportPath Returns the path of the output file
clear Clear the console screen
show Show can set options
help Print Help info
exit Exit KunYu &
exit Exit KunYu &
```

**OPTIONS**
Expand Down Expand Up @@ -129,6 +132,12 @@ Search for associated domain names and subdomains, and query associated domain n

![](./images/searchdomain.png)

**Encoding hash calculation**

In some scenarios, you can use this command to perform common HASH encryption/encoding, such as BASE64, MD5, mmh3, HEX encoding, and debug in this way.

![](./images/encode.png)

**Seebug vulnerability query**

You can query historical related vulnerabilities by entering information about the framework and equipment you want to find, but you need to note that only English is supported, and improvements and upgrades will be made later.
Expand All @@ -145,6 +154,12 @@ The configurable parameters and the current values of the parameters are display

![](./images/set.png)

**Pocsuite linkage**

In versions after v1.3.1, you can use kunyu to link the console mode of pocsuite3 for integrated use.

![](./images/pocsuite.png)

**Data result**

All search results are saved in the user's root directory, and the directory is created based on the current timestamp. All query results of a single start are stored in an Excel format under one directory, giving a more intuitive experience. The output path can be returned through the ExportPath command.
Expand Down Expand Up @@ -194,6 +209,24 @@ By default, your query data is in the Kunyu folder under the user directory. You

Kunyu's auto-completion supports upper and lower case, command logging, etc., use Tab to complete, please refer to Metasploit for usage.

**8. Regarding the error when using pip install kunyu**

The following error was reported when using pip install kunyu:
`File "C:\Users\风起\AppData\Local\Programs\Python\Python37\Scripts\kunyu-script.py", line 1 SyntaxError: Non-UTF-8 code starting with'\xb7' in file C: \Users\风起\AppData\Local\Programs\Python\Python37\Scripts\kunyu-script.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details`

**solution:**
Modify the C:\Users\风起\AppData\Local\Programs\Python\Python37\Scripts\kunyu-script.py file and add # encoding: utf-8 at the beginning of the file.

Then save it and you can use it normally. The bug appears because there is a Chinese name in the user's directory path, which usually appears on windows.

**9. Pocsuite3 module POC storage directory**

When using the pocsuite3 module, if you want to add a new POC module, you can add a POC file in **project directory/pocsuite3/pocs/**.

**10. Pocsuite3 module POC missing issue**

When using the Pocsuite command linkage, if it is a packaged Kunyu version, the poc has been fixed. At this time, modifying the poc directory cannot add new modules. At this time, you can repackage it or use the **project directory/kunyu /console.py** Run kunyu to update the poc module in real time.

# 0x06 Contributions

[风起@knownsec 404](https://github.com/wikiZ)
Expand Down
37 changes: 34 additions & 3 deletions doc/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Windows:
cd kunyu
python3 console.py
P.S. Windows同样支持python3 setup.py install
P.S. Windows同样支持python3 setup.py install,也可以使用pip install kunyu进行安装更新
```

# 0x02 配置说明
Expand Down Expand Up @@ -72,13 +72,15 @@ Global commands:
SearchBatch <File> Batch search Host
SearchCert <Domain> SSL certificate Search
SearchDomain <Domain> Domain name associated/subdomain search
EncodeHash <encryption> <query> Encryption method interface
Seebug <Query> Search Seebug vulnerability information
set <Option> Set arguments values
ExportPath Returns the path of the output file
Pocsuite3 Invoke the pocsuite component
ExportPath Returns the path of the output file
clear Clear the console screen
show Show can set options
help Print Help info
exit Exit KunYu &
exit Exit KunYu &
```

**OPTIONS**
Expand Down Expand Up @@ -128,6 +130,12 @@ ZoomEye:

![](../images/searchdomain.png)

**编码哈希计算**

在一些场景下,可以通过该命令进行常用的HASH加密/编码,如:BASE64、MD5、mmh3、HEX编码,通过这种方式进行调试。

![](../images/encode.png)

**Seebug漏洞查询**

通过输入想要查找的框架、设备等信息,查询历史相关漏洞,但是需要注意仅支持英文,这里后期会进行改进,升级。
Expand All @@ -144,6 +152,12 @@ ZoomEye:

![](../images/set.png)

**Pocsuite3 联动**

在v1.3.1之后的版本中,您可以使用kunyu进行联动pocsuite3的console模式进行一体化的使用。

![](../images/pocsuite.png)

**数据结果**

搜索的所有结果都保存在用户根目录下,并根据当前时间戳创建目录。单次启动的所有查询结果都在一个目录下,保存为Excel格式,给予更加直观的体验。可以通过ExportPath命令返回输出路径。
Expand Down Expand Up @@ -193,6 +207,23 @@ ico图标搜索既支持URL检索,又支持本地ico图标文件搜索,这

Kunyu的自动补全支持大小写,命令记录等,使用Tab进行补全,用法参见Metasploit即可。

**8、关于pip install kunyu使用时报错的问题**

在使用pip install kunyu时报以下错误:
`File "C:\Users\风起\AppData\Local\Programs\Python\Python37\Scripts\kunyu-script.py", line 1 SyntaxError: Non-UTF-8 code starting with '\xb7' in file C:\Users\风起\AppData\Local\Programs\Python\Python37\Scripts\kunyu-script.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details`

解决方案:
修改C:\Users\风起\AppData\Local\Programs\Python\Python37\Scripts\kunyu-script.py文件,在文件开头添加# encoding: utf-8
然后保存即可正常使用,该bug出现原因为用户目录路径存在中文名,通常出现在windows上。

**9、Pocsuite3模块POC存放目录**

对于使用pocsuite3模块时,如果想要新增POC模块,则可以在 **项目目录/pocsuite3/pocs/** 添加POC文件。

**10、Pocsuite3模块POC缺失问题**

使用Pocsuite命令联动时,如果是已经打包好的Kunyu版本,则poc已经被固定,这时修改poc目录是无法新增模块的,这时可以通过重新打包的方式,或者使用 **项目目录/kunyu/console.py** 运行kunyu可实时更新poc模块。

# 0x06 Contributions

[风起@knownsec 404](https://github.com/wikiZ)
Expand Down
Binary file added images/encode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/infos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pocsuite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/searchhost.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/setinfo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions kunyu/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
__name__ = 'kunyu'
__package__ = 'kunyu'
__site__ = "https://www.zoomeye.org/doc"

__site__ = "https://www.zoomeye.org/doc"
Binary file added kunyu/config/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file not shown.
22 changes: 11 additions & 11 deletions kunyu/config/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
__python_version__ = sys.version.split()[0]
__platform__ = platform.platform()
__url__ = "https://github.com/knownsec/Kunyu"
__version__ = '1.2'
__version__ = '1.3.5'
__author__ = '风起'
__Team__ = 'KnownSec 404 Team'
__author_email__ = 'onlyzaliks@gmail.com'
Expand All @@ -30,7 +30,7 @@
\/_|:|~~|~ \:\ \ /:/ / \/__|:|/:/ / /:/~~/~ \:\ \ /:/ /
|:| | \:\ /:/ / |:/:/ / /:/ / \:\ /:/ /
|:| | \:\/:/ / |::/ / \/__/ \:\/:/ /
|:| | \::/ / /:/ / \::/ / -V {version} Alpha
|:| | \::/ / /:/ / \::/ / -V {version} Beta
\|__| \/__/ \/__/ \/__/
Expand All @@ -49,23 +49,23 @@
| . \ |_| | | | | |_| | |_| |
|_|\_\__,_|_| |_|\__, |\__,_| -v{version}
|___/
GitHub: https://github.com/
GitHub: https://github.com/knownsec/Kunyu/
kunyu is Cyberspace Resources Surveying and Mapping auxiliary tools
{{datil}}
""".format(version=__version__)

usage = """
Usage:
python3 console.py -h
python3 console.py console
kunyu -h
kunyu console
""".format(module="ZoomEye")

init = """
Usage:
python3 console.py -h
python3 console.py init -h
python3 console.py init --apikey "01234567-acbd-00000-1111-22222222222"
python3 console.py init --username "404@knownsec.com" -password "P@ssword"
python3 console.py init --seebug "012345200157abcdef981bcc89a1452c34d62b8c"
python3 console.py init --apikey "01234567-acbd-0000" --seebug "a73503200157"(推荐)
kunyu -h
kunyu init -h
kunyu init --apikey "01234567-acbd-00000-1111-22222222222"
kunyu init --username "404@knownsec.com" --password "P@ssword"
kunyu init --seebug "012345200157abcdef981bcc89a1452c34d62b8c"
kunyu init --apikey "01234567-acbd-0000" --seebug "a73503200157"(推荐)
"""
2 changes: 1 addition & 1 deletion kunyu/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
module_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.insert(1, module_path)


from kunyu.config.__version__ import __help__, init
from kunyu.core.console import KunyuInterpreter
from kunyu.utils.log import logger_console
Expand All @@ -30,5 +29,6 @@ def main():
except Exception:
logger_console.info(__help__.format(datil=init))


if __name__ == "__main__":
main()
14 changes: 9 additions & 5 deletions kunyu/core/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import platform
import subprocess

from colorama import init
from kunyu.config import setting
from rich.console import Console
from kunyu.utils.log import logger
Expand All @@ -20,9 +21,10 @@
from kunyu.utils import readineng as readline
from kunyu.config.__version__ import __introduction__


init(autoreset=True)
PLATFORM = platform.system()
#Determine the operating system clear screen command

# Determine the operating system clear screen command
cmd = "cls" if PLATFORM == "Windows" else "clear"
console = Console(color_system="auto")

Expand All @@ -34,6 +36,7 @@ def readline_available():
"""
return readline._readline is not None


# TAB auto completion
def auto_completion(completion=None, console=None):
if not readline_available():
Expand All @@ -47,7 +50,6 @@ class BaseInterpreter(object):
global_help = ""
OUTPUT_PATH = None


def __init__(self):
self.module = "ZoomEye"
self.complet = eval(self.module).Command_Info
Expand Down Expand Up @@ -85,7 +87,7 @@ def getter(self, line):
@property
def prompt(self):
""" Returns prompt string """
return "kunyu\033[31;1m ({})\033[0m > ".format(self.module)
return "Kunyu (\033[31;1m{}\033[0m) > ".format(self.module)

def get_command_handler(self, command):
""" Parsing command and returning appropriate handler.
Expand Down Expand Up @@ -158,6 +160,7 @@ def auxiliary(self, command, line=None):
def start(self):
# logger_console(self.global_help)
while True:
self.setup()
try:
command, args = self.parse_line(input(self.prompt))
command = command.lower()
Expand All @@ -176,7 +179,8 @@ def start(self):
except OSError:
pass
sys.exit(0)
except Exception:
except Exception as err:
print(err)
continue


Expand Down
Loading

0 comments on commit 8a759d4

Please sign in to comment.