python扫描端口hack_python脚本–扫描匿名FTP服务器

66b39cefea89699334f2cf28c29bb452.gif

这几天没有写什么脚本,今天写了个扫描匿名FTP服务器的脚本,其实用处感觉不是很大,但也有某一次测试就会用到,以备日后在用吧。

=============分割线=============

#!/usr/bin/env python

# -*- coding: utf-8 -*-

# @Author: IcySun

# 脚本功能:匿名FTP扫描

from Queue import Queue

import threading,sys

import ftplib

def use():

print '#' * 50

print '/t Scan Anonymous FTP'

print '/t/t Code By: IcySun'

print '#' * 50

def anonTest(hostname):

try:

ftp = ftplib.FTP(hostname)

ftp.login('anonymous','me@xx.com')

print '/n[*] ' + str(hostname)  +  '/tFTP Anonymous Logon Succeeded!'

ftp.quit()

return True

except Exception, e:

pass

class MyThread(threading.Thread):

def __init__(self):

threading.Thread.__init__(self)

def run(self):

global queue

while not queue.empty():

hostname = queue.get()

anonTest(hostname)

def main():

use()

global hostname,queue

queue = Queue()

f = open('ip.txt','r')

for host in f.readlines():

host = host.strip('/n')

queue.put(host)

for i in range(100):

c = MyThread()

c.start()

if __name__ == '__main__':

main()

=============分割线=============

代码如图

66b39cefea89699334f2cf28c29bb452.gif

测试如图:

66b39cefea89699334f2cf28c29bb452.gif

66b39cefea89699334f2cf28c29bb452.gif

备注:需要自行提前扫描某IP段的21端口,如果你喜欢也可以继续修改脚本。

66b39cefea89699334f2cf28c29bb452.gif

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值