1 Star 0 Fork 46

alex/qytang_Python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
2016.05.23 ACS自动添加用户脚本 2.29 KB
一键复制 编辑 原始数据 按行查看 历史
现任明教教主-乾颐堂 提交于 2016-05-23 09:08 . new file
#!python3
# -*- coding=utf-8 -*-
#本脚由亁颐堂现任明教教主编写,用于乾颐盾Python课程!
#教主QQ:605658506
#亁颐堂官网www.qytang.com
#乾颐盾是由亁颐堂现任明教教主开发的综合性安全课程
#包括传统网络安全(防火墙,IPS...)与Python语言和黑客渗透课程!
import pyautogui as GUI
from time import sleep
#move mouse to FF address blank:
#sleep(2)
username = 'acsadmin'
pwd = 'Cisc0123'
GUI.click(x=223,y=46,button='left')
GUI.hotkey('ctrl','a')
GUI.press('del')
GUI.typewrite('https://202.100.1.241/acsadmin')
GUI.press('enter')
GUI.click(x=124,y=312,button='left')
#locate the username blank:
#username_blank = GUI.locateOnScreen('logon.png')
#username_x, username_y = GUI.center(username_blank)
#GUI.click(username_x,(username_y - 20),button='left')
GUI.typewrite(username)
GUI.press('tab')
GUI.typewrite(pwd)
GUI.press('enter')
sleep(1)
#users and identity Stores
location = GUI.locateOnScreen('users_id.png')
l_x, l_y = GUI.center(location)
GUI.click(l_x, l_y, button='left')
sleep(1)
#user account
#location = GUI.locateOnScreen('internal_user.png')
#l_x, l_y = GUI.center(location)
#GUI.click(l_x, l_y , button='left')
location = GUI.locateOnScreen('users.png')
l_x, l_y = GUI.center(location)
GUI.click(l_x, l_y, button='left')
sleep(1)
#create user
create_location = GUI.locateOnScreen('create.png')
create_x, create_x_y = GUI.center(create_location)
#GUI.click(create_x, create_x_y, button='left')
sleep(1)
users_dict = {'user1':'Cisc0123',
'user2':'Cisc0123',
'user3':'Cisc0123',
'user4':'Cisc0123',
'user5':'Cisc0123',}
#username
for username,password in users_dict.items():
sleep(1)
GUI.click(create_x, create_x_y, button='left')
sleep(1)
location = GUI.locateOnScreen('name.png')
l_x, l_y = GUI.center(location)
GUI.click(l_x+100, l_y, button='left')
GUI.typewrite(username)
#sleep(1)
#password
pwd_btn = GUI.locateOnScreen('pwd.png')
pwd_x,pwd_y = GUI.center(pwd_btn)
GUI.click(pwd_x+30, pwd_y, button='left')
GUI.typewrite(password)
GUI.press('tab')
GUI.typewrite(password)
#submit
sbm_btn = GUI.locateOnScreen('sbm.png')
sbm_x,sbm_y = GUI.center(sbm_btn)
GUI.click(sbm_x, sbm_y, button='left')
GUI.alert("Add users!!!")
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/alexzhang666/qytang_Python.git
git@gitee.com:alexzhang666/qytang_Python.git
alexzhang666
qytang_Python
qytang_Python
master

搜索帮助