Huawei firewall automatically updates Chinese ip to target IP group.

Overview

前言

还在初始阶段,有很多内容没添加,例如:日志系统操作日志、连接方式支持telnet、多线程模式并发操作等,不过目前基本能用,后面再慢慢补充吧...

  • 测试机型:华为USG6000
  • 运行环境:Python3

使用

1、打开config.ini进行配置【详见配置文件注释

在【device_info】项中输入想要连接的设备信息

例如:

ip=192.168.1.1
connection_method=ssh
port=23
username = test
password = test123

注意事项:目前暂时只支持ssh连接,后续考虑增加其他

在【chinaip_config】中输入部分自定义设置

例如:

write_text_switch = 0
ip_number = 3000
remote_name = vrpcfg.cfg
local_path = FW_vrpcfg

注意事项:务必使ip组分为两个组,目前部分代码只针对两个组进行了操作

在【custom_script】中确认自定义脚本模式

例如:

custom_script_mode = 0
script_file = scripts.txt

注意事项:需要输入脚本文件的绝对路径,若放在程序运行目录可以不用写绝对路径

2、确认python环境已部署

构建环境使用python3,不确定python2能否运行

3、第一次运行

第一次打开会判断lock.ini文件是否存在,不存在即为第一次运行本程序,默认新建两个ip组,并向内插入数据

注意:为保证每条命令插入成功,建议添加每条命令执行后的延时为0.5,总共预计5600多条命令,运行时间大概47分钟

提示:若觉得过慢,第一次可手动插入,只要保证命名的ip组与下方所示两个ip组相同,且在插入数据后,在程序目录新建一个lock.ini即可

  • china_ip_group_1
  • china_ip_group_2

4、第二次运行:

第二次检测到lock.ini文件存在后,将直接拉取防火墙上的配置文件,并读取两个IP组的数据,同时拉取互联网最新的中国IP段数据,两者进行比对,生成两个列表

  • 添加列表:防火墙中不存在的IP数据
  • 删除列表:防火墙中存在但互联网中已过时的IP数据

预计比对更新时间5秒(根据变动数据的多少来决定)

申明

当你查阅、下载了本项目源代码或二进制程序,即代表你接受了以下条款

  • 本软件仅供技术交流,学术交流使用
  • 本软件作者编写出该软件旨在学习 Python
  • 用户在使用本软件时,若用户在当地产生一切违法行为由用户承担
  • 严禁用户将本软件使用于商业和个人其他意图
  • 若用户不同意上述条款任意一条,请勿使用本软件

结束

有问题可联系邮箱:[email protected]

Owner
Lundaa
Lundaa
Ipscanner - A simple threaded IP-Scanner written in python3 that can monitor local IP's in your network

IPScanner 🔬 A simple threaded IP-Scanner written in python3 that can monitor lo

4 Dec 12, 2022
pfSense integration with Home Assistant

hass-pfsense Join pfSense with home-assistant! hass-pfsense uses the built-in xmlrpc service of pfSense for all interactions. No special plugins or so

Travis Glenn Hansen 105 Dec 24, 2022
9SPY: a Windows RAT built in Python using sockets

9SPY 👁‍🗨 9SPY is a Windows RAT built in Python using sockets Features Features will be listed here soon, there are currenly 14 Information This is a

doop 12 Dec 01, 2022
Very simple FTP client, sync folder to FTP server, use python, opensource

ftp-sync-python Opensource, A way to safe your data, avoid lost data by Virus, Randsomware Some functions: Upload a folder automatically to FTP server

4 Sep 13, 2022
A python shell / chat bot for XMPP and cloud services

XMPP_Shell_Bot A python shell / chat bot for XMPP and cloud services, designed for penetration testers to bypass network filters. To better understand

Abdulkareem Aldeek 1 Jan 09, 2022
An opensource library to use SNMP get/bulk/set/walk in Python

SNMP-UTILS An opensource library to use SNMP get/bulk/set/walk in Python Features Work with OIDS json list [Find Here](#OIDS List) GET command SET com

Alexandre Gossard 3 Aug 03, 2022
CSP-style concurrency for Python

aiochan Aiochan is a library written to bring the wonderful idiom of CSP-style concurrency to python. The implementation is based on the battle-tested

Ziyang Hu 127 Dec 23, 2022
LGPL Pure Python OPC-UA Client and Server

LGPL Pure Python OPC-UA Client and Server

Free OPC-UA Library 1.2k Jan 04, 2023
SMS Based Headless Browsing

Browse the internet without a network connection - Submission for ConUHacks VI

Zafir Khalid 2 Feb 07, 2022
This script aims to make the dynamic public ip of your local server, public.

EZ DDNS CLOUDFLARE This script aims to make the dynamic ip of your local server, public. It does this by regularly updating cloudflare's dns record. B

3 Feb 13, 2022
Very simple and tiny file sharing service written in python

Simple File sharing tool Sharing client usage (You will need to use python3 for linux) main.py --send -f file/path Optionnal flags : pwd : set a passw

2 Jul 26, 2022
mitm6 is a pentesting tool that exploits the default configuration of Windows to take over the default DNS server.

mitm6 is a pentesting tool that exploits the default configuration of Windows to take over the default DNS server.

Fox-IT 1.3k Jan 05, 2023
SonicWall SSL-VPN Exploit

VisualDoor SonicWall SSL-VPN Exploit, as used by Phineas Fisher to hack Cayman Trust Bank and Hacking Team.

169 Nov 15, 2022
Script and library to wait for a DNS authority server to get its configuration.

DNSWait dnswait is a small script to wait for the "propagation" of a namserver configuration. Installing It's as easy as: python -m pip install dnswai

Julien Palard 14 Jan 17, 2022
Library containing the core modules for the kingdom-python-server.

🏰 Kingdom Core Library containing the core modules for the kingdom-python-server. Installation Use the package manager pip to install kingdom-core. p

T10 4 Dec 27, 2021
A benchmark for stateful fuzzing of network protocols

A benchmark for stateful fuzzing of network protocols

3 Apr 25, 2022
🐛 SSH self spreading worm written in python3 to propagate a botnet.

Mirkat SSH self spreading worm written in python3 to propagate a botnet. Install tutorial. cd ./script && sh setup.sh Support me. ⚠️ If this reposito

Ѵιcнч 58 Nov 01, 2022
A gRPC-Web implementation for Python

Sonora Sonora is a Python-first implementation of gRPC-Web built on top of standard Python APIs like WSGI and ASGI for easy integration. Why? Regular

Alex Stapleton 216 Dec 30, 2022
A Python framework for interacting with Solana's Pyth network.

Pyth Network A basic Python framework for reading and decoding data regarding the Pyth network

1 Nov 29, 2021
OptiPLANT is a cloud-based based system that empowers professional and non-professional data scientists to build high-quality predictive models

OptiPLANT OptiPLANT is a cloud-based based system that empowers professional and non-professional data scientists to build high-quality predictive mod

Intellia ICT 1 Jan 26, 2022