水木清华,telnet挂积分,工具
windows程序下载地址: https://download.csdn.net/download/liuzhuchen/10591915
第一步
smth.exe同一目录,shift+鼠标右击破。在打开的选项-选择-〉**在此处打开命令窗口(W)**
第二步
查看帮助
smth.exe
前台运行
smth.exe -u 用户名 -p 密码 -l 输出日志文件 -t 请求时间间隔单位分钟
后台运行
start /b smth.exe -u 用户名 -p 密码 -l 输出日志文件 -t 请求时间间隔单位分钟
源码:
from time import sleep
import telnetlib
import datetime
import sys
from optparse import OptionParsersleeptime=3
glog=sys.stdout
debugLevel=0def do_telnet(Host, username, password):'''''Telnet远程登录:Windows客户端连接Linux服务器'''global sleeptimeglobal glogglobal debugLevel# 连接Telnet服务器tn = telnetlib.Telnet(Host, timeout=10)tn.set_debuglevel(debugLevel)# 输入登录用户名# finish = '请输入代号:'# print(finish)res = tn.read_until(b'\xc7\xeb\xca\xe4\xc8\xeb\xb4\xfa\xba\xc5:')print(res.decode('GBK'), file=glog, flush=True)tn.write(bytes(username + '\n', encoding = "utf8") )## # 输入登录密码# finish="请输入密码:".encode("GBK")res = tn.read_until(b'\xc7\xeb\xca\xe4\xc8\xeb\xc3\xdc\xc2\xeb:')print(res.decode('GBK'), file=glog, flush=True)tn.write(bytes(password + '\n', encoding = "utf8") )try: # 抓取OSError: [Errno 99] Cannot assign requested address 异常res = tn.read_until(b'\xb0\xb4 [RETURN] \xbc\xcc\xd0\xf8')print(res.decode('GBK'), file=glog, flush=True)tn.write(bytes('\n', encoding = "utf8") )print('1', file=glog, flush=True)res = tn.read_until(b'\xb0\xb4\xc8\xce\xba\xce\xbc\xfc\xbc\xcc\xd0\xf8 ..')print(res.decode('GBK'), file=glog, flush=True)tn.write(bytes('\n', encoding = "utf8") )print('2', file=glog, flush=True)res = tn.read_until(bytes(' ' + str(datetime.datetime.now().year) , encoding='utf8')+b'\x1b[K\x1b[C')print(res.decode('GBK'), file=glog, flush=True)tn.write(bytes('\n', encoding = "utf8") )print('3', file=glog, flush=True)res = tn.read_until(b'\xb0\xb4\xc8\xce\xd2\xe2\xbc\xfc\xbc\xcc\xd0\xf8...')print(res.decode('GBK'), file=glog, flush=True)tn.write(bytes('\n', encoding = "utf8") )print('4', file=glog, flush=True)res = tn.read_until(b'\n\x1b[K\n\x1b[K\n\x1b[K\n\x1b[K\n\x1b[K\n\x1b[K\n\x1b[K\x1b[24;20H')print(res.decode('GBK'), file=glog, flush=True)tn.write(bytes('\n', encoding = "utf8") )print('5', file=glog, flush=True)res = tn.read_until(b'(n)\xbc\xcc\xd0\xf8 [n]:')print(res.decode('GBK'), file=glog, flush=True)tn.write(bytes('\n', encoding = "utf8") )print('6', file=glog, flush=True)except Exception as link_fault:print(link_fault, file=glog, flush=True)exit(1)return tn# 按任何键继续 .., 按 [RETURN] 继续,☆ 上次连线时间为 Sat Aug 4 13:51:12 2018# ,☆ 按任意键继续... 2次# 如何处理以上密码输入错误记录 (m)邮回信箱 (y)清除 (n)继续 [n]:def do_cmd(tn, cmd,h,m):# 停留[ 0:11]finish=b'\xcd\xa3\xc1\xf4[%3d:%d]\x1b[K\x1b[2;25H'%(h,m)# res = tn.read_until(finish)res = tn.read_some()# print(res.decode('GBK'))tn.write(bytes(cmd, encoding="utf8"))passdef do_loop(username, password):global sleeptimeglobal glogHost = 'bbs.newsmth.net' # Telnet服务器IPtn = do_telnet(Host, username, password)if tn is None:print("telnet link error", file=glog, flush=True)exit()print('++++++++++++++', file=glog, flush=True)print('link ok', file=glog, flush=True)print('keep live interval %d minutes'%(sleeptime/60), file=glog, flush=True)print('++++++++++++++', file=glog, flush=True)# 记录开始时间starttime = datetime.datetime.now()# 3分钟操作一次while(True):sleep(sleeptime)curMinutes=(datetime.datetime.now()-starttime).seconds/60try: # 抓取OSError: [Errno 99] Cannot assign requested address 异常do_cmd(tn,"0",curMinutes/60,curMinutes%60)print('keep live','| login time[%d:%d]'%(curMinutes/60,curMinutes%60), file=glog, flush=True)except Exception as link_fault:print('login time[%d:%d]'%(curMinutes/60,curMinutes%60), file=glog, flush=True)print('do_cmd error: ',link_fault, file=glog, flush=True)breakpasstn.close() # tn.write('exit\n')if __name__ == '__main__':global sleeptimeglobal glogglobal debugLevel# finish="请输入密码:".encode("GBK")# print(finish)# assert False# 配置选项parse = OptionParser()parse.add_option("-u", "--username", action = "store",type="string",dest = "username", default="")parse.add_option("-p", "--password", action = "store",type="string",dest = "password", default="")parse.add_option("-l", "--log", action="store", type="string", dest="log", default="", help="日志输出,默认为终端")parse.add_option("-t", "--timeout", action="store", type="int", dest="timeout", default=3, help="单位分钟,请求间隔")parse.add_option("-d", "--debugLevel", action="store", type="int", dest="debugLevel", default=0, help="debug 级别 0-5")(option, arges) = parse.parse_args()if(len(option.username) == 0 or len(option.password) == 0):parse.print_help()exit()if(len(option.log) != 0):glog = open(option.log, 'a', encoding='utf8')print(type(option.timeout), option.timeout)sleeptime=60*option.timeoutdebugLevel=option.debugLevelwhile True:do_loop(option.username, option.password)sleep(sleeptime)
水木清华,telnet挂积分,工具相关推荐
- 奥鹏刷分软件_奥鹏挂积分软件下载|
奥鹏自动积分软件帮助你自动挂学分的软件,让你人不在身边也能涨学分.软件主要是以仿真的形式来应对,根据不同的要求对应不同的解决方案,成功率非常高,让你安心去做别的事情.不过好事要以学习为重.快来当易网下 ...
- Origin——积分工具
文章目录 1.矩形积分 1.1.导入数据并绘图 1.2.选择以矩形进行积分 1.3.更改积分区域 1.4.显示积分结果在脚本窗口 2.带有数据基线的图形积分 2.1.导入数据并绘图 2.2.进行积分 ...
- python写一个求导积分工具_方便快捷的求导求积分解方程在线工具sage介绍
有时候我们需要进行一些复杂的数学计算,比如求导, 求积分,解方程,还是用abcd字母代表变量的方程等,这就需要进行复杂的数学运算还需要具备良好的数学基础.不过现在有一个非常方便的在线工具,只需要几秒钟 ...
- linux telnet远程登录工具,Linux 远程登录(telnet ssh)
Linux 远程登录(telnet ssh) telnet [root@rhel6 ~]# rpm -qa | grep telnet telnet-server-0.17-47.el6.x86_64 ...
- mysql2000清除挂起工具_安装SQL SERVER2000提示注册表文件被挂起的解决方案
在安装SQL SERVER 2000时出现如下的提示: "以前的某个程序安装已在安装计算机上创建挂起的文件操作.运行安装程序之前必须重新启动计算机." 按照提示重启计算机,再安装, ...
- 积分签到,连续签到积分工具
小松师傅:
- win7 telnet命令无法使用
很多做网络测试的同学发现安装win7后,无法使用telnet命令了,提示"telnet不是内部或外部命令,也不是可运行的程序",但是很需要在win7中使用telnet工具,怎么办? ...
- Linux下使用SSH、Crontab、Rsync三工具实现数据自动备份
Linux下使用SSH.Crontab.Rsync三工具实现数据自动备份 作为网管人员大概都无一例外的经历过系统备份,尤其是重要系统的备份.重要数据库系统的备份工作.由于备份是个频繁而琐碎的工作,如何 ...
- 织梦网站被黑客生成html,dedecms网站被挂马怎么处理
dedecms被批量挂马后如何处理?我们知道一般站长选择织梦系统是因为其支持生成静态页面以便于seo优化.但是根据西部数码west263.com开发工程师刘工介绍,一般被挂马的网站不单单是一个页面,目 ...
最新文章
- jaxb和dozer简介
- Servlet开发(二)
- windows server 2016 docker 之创建使用虚拟交换机
- gradient设置上下渐变_PaintCode Mac使用教程:如何使用渐变色
- OpenShift 4 - DevSecOps (4) - 实现一个 CICD Pipeline,并用 RHACS 发现安全隐患
- RabbitMQ的基础知识与使用
- mysql执行sql批处理
- 安装idea(最新版IntelliJ IDEA)编译器(详细到每步)
- cad四级计算机考试,国家CAD等级考试(AutoCAD_II).doc
- python 简单 socket 编程
- C#中的IntPtr
- vue json对象转数组_Vue优秀表单组件,用Vue构建表单的最简单方法——Vue Formulate
- selenium下载图片
- 纯CSS的导航下拉菜单
- ArcGIS 图像合并至新栅格图层
- excel生成随机手机号
- ISTP会议论文检索
- 非战之罪,从永中Office谈起
- Android开发获取ImageView显示的图片尺寸
- html excel 在线编辑,利用js实现在线编辑excel表格代码
热门文章
- 中国最有意境的33句
- 花费多少钱能创建百度百科词条?
- 写个续集,填坑来了!关于“Thread.sleep(0)这一行‘看似无用’的代码”里面留下的坑。
- 托管调试助手 “LoaderLock“:“正尝试在 OS 加载程序锁内执行托管代码。不要尝试在 DllMain 或映像初始化函数内运行托管代码,这样做会导致应用程序挂起。”
- 明星热图|高圆圆、颖儿、杨蓉等演绎服饰新品;张雨绮、刘嘉玲代言新品牌;李佳琦入选《时代》全球下一代百位影响力人物榜...
- 论文翻译:Pose estimation at night in infrared images using a lightweight multi-stage attention network
- 携创教育:自考本科有用吗?有什么优势?
- Android高德地图添加点连点画线
- 做XRD有什么用途?
- linux 修改 usb-serial.c 提升3G上网速度