Lunarpedia:BWABOM LMEES

From Lunarpedia
Revision as of 15:41, 10 October 2007 by Strangelv (talk | contribs) (script for banning bulk IPs for 1 month each)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

It is recommended to it 'edit' and copy from between the <PRE> tags, as they let some mangling happen that may result in a corrupted copy of the source code.

#!/usr/bin/python

#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%#
#                                 #
# Bulk-Wiki-Attacker-Block-O-Mat  #
#                                 #
#          version 0.1            #
#                                 #
#    Developed for LPedia.org     #
#    by James Gholston, 2007      #
#                                 #
#    Version for annoying pure    #
#  vandal using anonymous botnet  #
#    attacking five space wikis   #
#         Public Domain           #
#                                 #
#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%#

# This is completely non-interactive, unlike the proper version of BWABOM -- a result 
# of the ungency of the situation that caused its creation


# torque       -- how much to squeeze (rule of thumb: 
#                 single attack is 3 years, multiple per name is 5 --
#                 this helps to identify attack severity when looking at
#                 the logfile)
# roster       -- list of offending accounts entered
# reason       -- hardwired as "SPAM"
# blockheads   -- holding list while assembling roster
# whack_a_pest -- iteration through roster
# venue        -- location of output html file with links
# implement    -- output html
# range        -- is the output successfully saved to the firing range?
# gallery      -- file object

reason="zombie node of extra-annoying botnet" ##"SPAM"

# Select duration
torque = "1 month"

#####
#####
##### paste in list of bulk usernames to block * * * HERE * * *
#####
#####

roster = ["12.72.56.31","122.252.226.40","147.83.101.28","170.211.210.30","170.211.216.8","196.20.65.210","199.245.188.252","200.18.39.123","201.12.178.33","203.69.39.251","208.109.123.121","209.58.83.178","212.11.191.67","212.72.56.31","216.23.162.164","4.27.5.49","59.14.174.100","64.27.5.49","64.34.180.180","66.46.148.201","70.87.7.56","72.232.181.202","72.249.45.76","74.231.24.2","81.0.232.77","83.236.135.140","85.17.186.161","86.109.163.26"]

#####
#####


blockheads = "1"

##print "Paste and/or type in list of destructive accounts; press return more than once if necessary."
### if line != "" keep going
##while(blockheads):
##          blockheads = raw_input(">>>>")
##          if(blockheads): roster += [blockheads]

# Output html page with list of links to open to block them

implement = "<HTML><HEAD><TITLE>Bulk-Wiki-Attacker-Block-O-Mat shooting gallery</TITLE></HEAD><BODY>\n"

#http://www.exoplatz.org/index.php?title=Special:Blockip&wpBlockAddress=216.73.53.2&wpBlockOther=1%20week&wpBlockReason=zombie%20node%20of%20extra-annoying%20botnet&wpBlock=

for whack_a_pest in roster:
    implement += "<A href=\"http://www.exoplatz.org/index.php?title=Special:Blockip&wpBlockAddress=" + whack_a_pest + "&wpBlockOther=" + torque + "&wpBlockReason=" + reason + "&wpBlock=\"Block this user\"\">Open in new tab to ban " + whack_a_pest + " for " + torque + " from Exoplatz</A><BR/>\n" 
    implement += "<A href=\"http://www.exodictionary.org/index.php?title=Special:Blockip&wpBlockAddress=" + whack_a_pest + "&wpBlockOther=" + torque + "&wpBlockReason=" + reason + "&wpBlock=\"Block this user\"\">Open in new tab to ban " + whack_a_pest + " for " + torque + " from ExoDictionary</A><BR/>\n" 
    implement += "<A href=\"http://www.scientifiction.org/index.php?title=Special:Blockip&wpBlockAddress=" + whack_a_pest + "&wpBlockOther=" + torque + "&wpBlockReason=" + reason + "&wpBlock=\"Block this user\"\">Open in new tab to ban " + whack_a_pest + " for " + torque + " from Scientifiction.org</A><BR/>\n" 
    implement += "<A href=\"http://www.marspedia.org/index.php?title=Special:Blockip&wpBlockAddress=" + whack_a_pest + "&wpBlockOther=" + torque + "&wpBlockReason=" + reason + "&wpBlock=\"Block this user\"\">Open in new tab to ban " + whack_a_pest + " for " + torque + " from Marspedia.org</A><BR/>\n" 
    implement += "<A href=\"http://www.lunarpedia.org/index.php?title=Special:Blockip&wpBlockAddress=" + whack_a_pest + "&wpBlockOther=" + torque + "&wpBlockReason=" + reason + "&wpBlock=\"Block this user\"\">Open in new tab to ban " + whack_a_pest + " for " + torque + " from Lunarpedia.org</A><BR/>\n" 
implement += "</BODY></HTML>\n"

# print implement

# save file to disk (or possibly disc, although *I* can't save 
# a file directly to disc right now)

# commented out fault tolerance code not tested yet

range = 0

##print "save html file as (path and filename) -- .html extension suggested"
while not range:


#####
#####
##### PASTE OUTPUT HTML FILE NAME * * * HERE * * *
#####
#####

      venue = "/home/strangelv/bbeesm02.net.html"

#####
#####

##raw_input("file and path to save:")
      #try:
      gallery=open(venue, "w")
      gallery.write(implement)
      gallery.close()
      range=1
      #except:
      #if gallery: gallery.close()
      #print "Something went wrong.  Let's try that again."

# Enjoy!

print "open "+venue+" in your preferred tab-capable web browser and have a blast!"