• 大小: 0.75M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-16
  • 语言: Python
  • 标签: 其他  

资源简介

Violent-Python-Source.zip

资源截图

代码片段和文件信息

#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
import os
import sys


def retBanner(ip port):
    try:
        socket.setdefaulttimeout(2)
        s = socket.socket()
        s.connect((ip port))
        banner = s.recv(1024)
        return banner
    except:
        return


def checkVulns(banner filename):

    f = open(filename ‘r‘)
    for line in f.readlines():
        if line.strip(‘\n‘) in banner:
            print ‘[+] Server is vulnerable: ‘ +\
                banner.strip(‘\n‘)


def main():

    if len(sys.argv) == 2:
        filename = sys.argv[1]
        if not os.path.isfile(filename):
            print ‘[-] ‘ + filename +\
                ‘ does not exist.‘
            exit(0)

        if not os.access(filename os.R_OK):
            print ‘[-] ‘ + filename +\
                ‘ access denied.‘
            exit(0)
    else:   
        print ‘[-] Usage: ‘ + str(sys.argv[0]) +\
            ‘ 
        exit(0)

    portList = [21222580110443]
    for x in range(147 150):
        ip = ‘192.168.95.‘ + str(x)
        for port in portList:
            banner = retBanner(ip port)
            if banner:
                print ‘[+] ‘ + ip + ‘ : ‘ + banner
                checkVulns(banner filename)


if __name__ == ‘__main__‘:
    main()

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-12-16 20:35  Violent-Python-Examples\
     目录           0  2012-12-16 20:35  Violent-Python-Examples\Chapter-1\
     文件        1297  2012-12-16 20:35  Violent-Python-Examples\Chapter-1\1-vulnScanner.py
     文件         755  2012-12-16 20:35  Violent-Python-Examples\Chapter-1\2-passwdCrack.py
     文件        1026  2012-12-16 20:35  Violent-Python-Examples\Chapter-1\3-zipCrack.py
     文件          57  2012-12-16 20:35  Violent-Python-Examples\Chapter-1\dictionary.txt
     文件       35755  2012-12-16 20:35  Violent-Python-Examples\Chapter-1\evil.zip
     文件         122  2012-12-16 20:35  Violent-Python-Examples\Chapter-1\passwords.txt
     文件         400  2012-12-16 20:35  Violent-Python-Examples\Chapter-1\vuln-banners.txt
     目录           0  2012-12-16 20:35  Violent-Python-Examples\Chapter-2\
     文件        1665  2012-12-16 20:35  Violent-Python-Examples\Chapter-2\1-portScan.py
     文件         948  2012-12-16 20:35  Violent-Python-Examples\Chapter-2\2-nmapScan.py
     文件        1101  2012-12-16 20:35  Violent-Python-Examples\Chapter-2\3-botNet.py
     文件        2379  2012-12-16 20:35  Violent-Python-Examples\Chapter-2\3-bruteKey.py
     文件         419  2012-12-16 20:35  Violent-Python-Examples\Chapter-2\3-pxsshCommand.py
     文件        1854  2012-12-16 20:35  Violent-Python-Examples\Chapter-2\3-sshBrute.py
     文件        1064  2012-12-16 20:35  Violent-Python-Examples\Chapter-2\3-sshCommand.py
     文件         455  2012-12-16 20:35  Violent-Python-Examples\Chapter-2\4-anonLogin.py
     文件         791  2012-12-16 20:35  Violent-Python-Examples\Chapter-2\4-bruteLogin.py
     文件         646  2012-12-16 20:35  Violent-Python-Examples\Chapter-2\4-defaultPages.py
     文件         645  2012-12-16 20:35  Violent-Python-Examples\Chapter-2\4-injectPage.py
     文件        3512  2012-12-16 20:35  Violent-Python-Examples\Chapter-2\4-massCompromise.py
     文件        3206  2012-12-16 20:35  Violent-Python-Examples\Chapter-2\5-conficker.py
     文件        3126  2012-12-16 20:35  Violent-Python-Examples\Chapter-2\6-freeFloat.py
     文件          40  2012-12-16 20:35  Violent-Python-Examples\Chapter-2\pass.txt
     文件          69  2012-12-16 20:35  Violent-Python-Examples\Chapter-2\userpass.txt
     目录           0  2012-12-16 20:35  Violent-Python-Examples\Chapter-3\
     文件        2387  2012-12-16 20:35  Violent-Python-Examples\Chapter-3\1-discoverNetworks.py
     文件        1013  2012-12-16 20:35  Violent-Python-Examples\Chapter-3\2-dumpRecycleBin.py
     文件         770  2012-12-16 20:35  Violent-Python-Examples\Chapter-3\3-pdfRead.py
     文件        1760  2012-12-16 20:35  Violent-Python-Examples\Chapter-3\4-exifFetch.py
............此处省略65个文件信息

评论

共有 条评论