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
IoT owl is light face detection and recognition system made for small IoT devices like raspberry pi.

IoT Owl IoT owl is light face detection and recognition system made for small IoT devices like raspberry pi. Versions Heavy with mask detection withou

Ret2Me 6 Jun 06, 2022
Dnspython is a DNS toolkit for Python.

dnspython is a DNS toolkit for Python. It supports almost all record types. It can be used for queries, zone transfers, and dynamic updates. It supports TSIG authenticated messages and EDNS0.

Bob Halley 2.1k Jan 06, 2023
Cobalt Strike C2 Reverse proxy that fends off Blue Teams, AVs, EDRs, scanners through packet inspection and malleable profile correlation

Cobalt Strike C2 Reverse proxy that fends off Blue Teams, AVs, EDRs, scanners through packet inspection and malleable profile correlation

Mariusz B. 715 Dec 25, 2022
Desktop application for checking sites connection in a background mode

Site connectivity checker Desktop application for checking site connection in a background mode by sending ICMP messages. Problem and solution Usually

Karina Singatullina 26 Dec 19, 2022
Wifijammer - Continuously jam all wifi clients/routers

wifijammer Continuously jam all wifi clients and access points within range. The effectiveness of this script is constrained by your wireless card. Al

Dan McInerney 3.5k Dec 31, 2022
AdaFruit Funhouse publishing Temperature, Humidity and Pressure to MQTT / Apache Pulsar

pulsar-adafruit-funhouse AdaFruit Funhouse publishing Temperature, Humidity and Pressure to MQTT / Apache Pulsar Device Get your own from adafruit Ada

Timothy Spann 1 Dec 30, 2021
AV Evasion, a Red Team Tool - Fiber, APC, PNG and UUID

AV Evasion, a Red Team Tool - Fiber, APC, PNG and UUID

9 Mar 07, 2022
This is a Client-Server-System which can share the screen from the server to client and in the other direction.

Screenshare-Streaming-Python This is a Client-Server-System which can share the screen from the server to client and in the other direction. You have

VFX / Videoeffects Creator 1 Nov 19, 2021
A vpn that sits in your browser, accessible via a website

VPNInYourBrowser A vpn that sits in your browser, accessible via a website Example setup: https://VPNInBrowser.jaffa42.repl.co Setup Put the code onto

1 Jan 20, 2022
IP-Escaner - A Python Tool to obtain information from an IP address

IP-Escaner Herramienta para obtener informacion de una direccion IP Opciones de

4 Apr 09, 2022
Simple P2P application for sending files over open and forwarded network ports.

FileShareV2 A major overhaul to the V1 (now deprecated) FileShare application. V2 brings major improvements in both UI and performance. V2 is now base

Michael Wang 1 Nov 23, 2021
Converts Cisco formatted MAC Addresses to PC formatted MAC Addresses

Cisco-MAC-to-PC-MAC Converts a file with a list of Cisco formatted MAC Addresses to PC formatted MAC Addresses... Ex: abcd.efgh.ijkl to AB:CD:EF:GH:I

Stew Alexander 0 Jan 04, 2022
An automatic reaction network generator for reactive molecular dynamics simulation.

ReacNetGenerator An automatic reaction network generator for reactive molecular dynamics simulation. ReacNetGenerator: an automatic reaction network g

Tong Zhu Research Group 35 Dec 14, 2022
A script to automatically update the github's proxy IP in hosts file.

updateHostsGithub A script to automatically update the github's proxy IP in hosts file. Now only Mac and Linux are supported. (脚本自动更新本地hosts文件,目前仅支持Ma

2 Jul 06, 2022
Tiny JSON RPC via HTTP library.

jrpc Simplest ever possible Asynchronous JSON RPC via HTTP library for Python, backed by httpx. Installation pip install async-jrpc Usage Import JRPC

Onigiri Team 2 Jan 31, 2022
A python tool auto change proxy or ip after dealy time set by user

Auto proxy Ghost This tool auto change proxy or ip after dealy time set by user how to run 1. Install required file ./requirements.sh 2.Enter command

Harsh Tagra 0 Feb 23, 2022
Simple self-hosted server to receive files from remote systems

Badtray This is a very simple self-hosted server to receive files from remote systems. This works similar to Bintray (RIP) and primarily designed to d

Alex Taradov 1 Nov 22, 2021
A simple electrical network analyzer, BASED ON computer-aided design.

Electrical Network Analyzer A simple electrical network analyzer. Given the oriented graph of the electrical network (circut), BASED ON computer-aided

Ahmad Abdulrahman 4 Oct 15, 2022
Makes dynamically updating your Cloudflare DNS records a bit easier ⏩👍😎

Easy Dynamic Cloudflare DNS Updater Makes dynamically updating your Cloudflare DNS records a bit easier ⏩ 👍 😎 If using it as a 'Dynamic DNS' client,

Zac Koch 3 Dec 19, 2021
Event-driven networking engine written in Python.

Twisted For information on changes in this release, see the NEWS file. What is this? Twisted is an event-based framework for internet applications, su

Twisted Matrix Labs 4.9k Jan 08, 2023