Personal tools
You are here: Home 鯖缶 ふぁいるず update_bl_ssh.py
Document Actions

update_bl_ssh.py

by maru last modified 2008-02-16 18:15

IPホイホイ用(sshに攻撃を掛けてきたIPをPloneの専用ページ(?)に晒すときに使う)

Click here to get the file

Size 1 kB - File type text/python-source

File contents

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

def main():
    #import pdb
    #pdb.set_trace()

    #
    # Please set some information,(host of mail server,etc) to use
    #

    import sys
    import urllib

    if len(sys.argv) < 3:
        print 'Usage: %s ip date\n' % sys.argv[0]
        sys.exit(0)

    ip   = sys.argv[1]
    date = sys.argv[2]
    tgt = 'blacklist_ssh'

    urlbase='http://username:pass@www.maruz.net/server_admin/' + tgt + '/'

    dt = urllib.urlencode({'tgtid':tgt,
                           'ip':ip,
                           'date':date})
    a = urllib.urlopen(urlbase+'auto_update_iplist',dt)

    return

if __name__ == '__main__':
    main()