Jump to content
pyth0n3

Deface creator in python

Recommended Posts

It will take an HTML file and will deface

Use: deface.py yourpage.html

#!/usr/bin/python
#Date:10.08.2010
#Purpose: Deface HTML files
#Author: pyth0n3
#Blog: http://pyth0n3.blogspot.com/


import sys
import time
if len(sys.argv) < 2:
print 'Usage deface.py index.html , this will create an index.html file with deface .'
sys.exit()


file = sys.argv[1]
myfile = open(file,'w')

print ' Colors: '
print '================================================================'
print ' | black | white | '
print '================================================================'
while True:
var = raw_input ('1.Type the color for background here => ')
if var in ['black','white','other']: break
else:
print 'Wrong color..!'
print >> myfile, '<body bgcolor=','"',(var),'"','>'
print '================================================================'
print ' Colors '
print ' | black | white | green | red | purple | blue | gray | '
print '================================================================'

while True:
var1 = raw_input ('2.Type the text color here => ')
if var1 in ['black','white','green','orange','red','purple','blue','gray']: break
else:
print 'Wrong color..!'
print >> myfile, '<p align="center"><b><font color=','"',(var1),'"','size="3">'

if var == 'black':
print '================================================================'
print ' Choose an image : '
print '| hacked1 | fingerprint | spy | hacked2 | silence | gameover |'
print '| leg | hand | hitman | smoke | hacked3 | '
print ' | other | '
print '================================================================'

while True:
var4 = raw_input ('3.Put the image name here => ')
if var4 in ['hacked1','fingerprint','spy','hacked2','silence','gameover','leg','hand','hitman','smoke','hacked3','other']: break
else:
print 'Wrong image name..! '
print '================================================================'
if var4 == 'fingerprint':
print >> myfile,' <center><img src="http://www.mandel.ro/logos/animFingerprintBlack.gif"></center>'
if var4 == 'hacked1':
print >> myfile,' <center><img src="http://site.mynet.com/the_chip/hacked2323.jpg"></center>'
if var4 == 'spy':
print >> myfile,' <center><img src="http://www.bluesilk.hu/images/stories/spy.gif"></center>'
if var4 == 'hacked2':
print >> myfile,' <center><img src="http://expclan.comli.com/index_files/43084476ii9.png"></center>'
if var4 == 'silence':
print >> myfile,' <center><img src="http://demafmipauns.files.wordpress.com/2010/05/sayu0i.jpg"></center>'
if var4 == 'gameover':
print >> myfile, '<center><img src="http://img10.imageshack.us/img10/4974/yumaqalt.jpg"></center>'
if var4 == 'leg':
print >> myfile, '<center><img src="http://img268.imageshack.us/img268/6802/thehackerericborgozone1.jpg"></center>'
if var4 == 'hand':
print >> myfile, '<center><img src="http://i728.photobucket.com/albums/ww286/vyc0d/owned.jpg"></center>'
if var4 == 'hitman':
print >> myfile, '<center><img src="http://t0.gstatic.com/images?q=tbn:lYCsFDr4o7mh1M:http://www.renoascensori.it/hacked.jpg&t=1"></center>'
if var4 == 'smoke':
print >> myfile, '<center><img src="http://t1.gstatic.com/images?q=tbn:YgDh8qCPAtwgoM:http://i46.tinypic.com/2gtxdo1.jpg&t=1"></center>'
if var4 == 'hacked3':
print >> myfile, '<center><img src="http://img.webme.com/pic/c/cobbra-g3ncii/hacked.jpg"></center>'
if var4 == 'other':
while True:
var4 = raw_input ('Please enter the URL of your picture here: ' )
if var4.endswith(('.jpg','.png','.gif','.JPG','.PNG','.GIF')) : break
else:
print 'Wrong image name..! '
print >> myfile,'<center><img src="',(var4),'"></center>'

if var == 'white':
print '================================================================'
print ' Choose an image : '
print ' | eye | door | fingerprint | wanted | sleep | other | '
print '================================================================'
while True:
var4 = raw_input ('3.Put the image name here => ')
if var4 in ['door','fingerprint','wanted','sleep','eye','other']: break
else:
print 'Wrong image...'
print '================================================================'
if var4 == 'door':
print >> myfile,'<center><img src="http://www.cdscreative.com/images/door.jpg"></center>'
if var4 == 'fingerprint':
print >> myfile,' <center><img src="http://www.idfpr.com/DPR/images/fingerprint.gif"></center>'
if var4 == 'wanted':
print >> myfile,' <center><img src="http://www.allstarcardsinc.com/_derived/buy_list.htm_txt_wanted1.gif"></center>'
if var4 == 'sleep' :
print >> myfile,' <center><img src="http://www.do2learn.com/picturecards/images/imageschedule/sleep_l.gif"></center>'
if var4 == 'eye' :
print >> myfile,' <center><img src="http://www.christina-reysen.com/images/eye_open.gif"></center>'
if var4 == 'other':
while True:
var4 = raw_input ('Please enter the URL of your picture here: ' )
if var4.endswith(('.jpg','.png','.gif','.JPG','.PNG','.GIF')) : break
else:
print 'Must enter an URL that contains an image file..! '
print >> myfile,'<center><img src="',(var4),'"></center>'


print '================================================================'
while True:
var2 = raw_input ('4.put your signature here => ')
if len(var2) < 30 : break
else:
print 'Signature too large..!'
print >> myfile, '<script>'
print >> myfile, 'if (document.layers)'
print >> myfile, 'var ns4def=""'
print >> myfile, '</script>'
print >> myfile, '<p align="center"><b><font size="4">'
print >> myfile, '<h2 id="flyin"style="position:relative;left:-400;font-style:italic"'
print >> myfile, 'style=&{ns4def};>'
print >> myfile, '<font face="Arial">','Owned by',(var2),'</font></h2>'
print >> myfile, '</font></b></p>'
print >> myfile, '<script language="JavaScript1.2">'
print >> myfile, 'if (document.getElementById||document.all)'
print >> myfile, 'var crossheader=document.getElementById? document.getElementById("flyin").style : document.all.flyin.style'
print >> myfile, 'function animatein(){'
print >> myfile, 'if (parseInt(crossheader.left)<0)'
print >> myfile, 'crossheader.left=parseInt(crossheader.left)+20'
print >> myfile, 'else{'
print >> myfile, 'crossheader.left=0'
print >> myfile, 'crossheader.fontStyle="normal"'
print >> myfile, 'clearInterval(start)'
print >> myfile, '}'
print >> myfile, '}'
print >> myfile, 'if (document.getElementById||document.all)'
print >> myfile, 'start=setInterval("animatein()",50)'
print >> myfile, '</script>'
print >> myfile, '<p>'
print >> myfile, '<font face="Tahoma"><a target="_blank"'
print '================================================================'
print ' Choose: '
print ' | yes | no | '
print '================================================================'
while True:
var7 = raw_input ('Do you want to add some other text message?: ')
if var7.lower() == 'no' :
print '================================================================'
print ' Wait...'
time.sleep(1)
myfile.close()
print 'Your HTML file is ready ,I will exit now... '
time.sleep(2)
sys.exit()
elif var7.lower() == 'yes' : break
else:
print ("Please enter 'yes' or 'no' ...!")
print '================================================================'
print ' Choose one of the color from the list '
print ' | black | white | green | red | purple | blue | gray | '
print '================================================================'
while True:
var8 = raw_input ('Type the text color that you want here => ')
if var8 in ['black','white','green','orange','red','purple','blue','gray ']:break
else:
print 'Wrong color..!'
print >> myfile, '<p align="center"><b><font color=','"',(var8),'"','size="3">'
print '================================================================'
while True:
var9 = raw_input ('Put your comments here => ')
if len(var9) < 150 : break
else:
print 'Comments are too large..!'
print >> myfile, var9
print >> myfile, '</font></b></p>'
print '================================================================'
print 'Processing your HTML file please wait... '
time.sleep(2)
print '...'
time.sleep(2)
myfile.close()
print ' Work done ,your HTML file was defaced , i will exit... '
time.sleep(1)
sys.exit()




#END

Download file ===>>> here

md5sum 31a5f85b90bf7cf80ef91e4a4d8f1a9b deface.py

Edited by pyth0n3
Link to comment
Share on other sites

Cool, ai lucrat ceva la el nu gluma.

Dar! De ce limitarile respective?

var9 = raw_input ('Put your comments here => ')

if len(var9) < 150 : break

else:

print 'Comments are too large..!'

Si... de ce:


print >> myfile, '<p align="center"><b><font color=','"',(var8),'"','size="3">'

Si nu:


myfile.write('<p align="center"><b><font color=','"',(var8),'"','size="3">')

?

Este putin ciudat felul tau de a progama in Python, dar isi face treaba.

Link to comment
Share on other sites

Cool, ai lucrat ceva la el nu gluma.

Dar! De ce limitarile respective?

var9 = raw_input ('Put your comments  here => ')
if len(var9) < 150 : break
else:
print 'Comments are too large..!'

Chiar dac? bucata de cod nu are prea mult sens , userul va pune in input doar ceea ce ii permit eu

In multe limbaje de programare majoritatea las? ca userul sa poat? introduce ceea ce vrea in input ?i cat vrea , in cazul meu nu este nici o problema pt ca scriptul va scrie intrun file HTML ceea ce ia in input de la user , dar in majoritatea cazurilor programatori gresesc foarte mult ?i las? orice ca s? poat? fi introdus ca input

Cînd vine vorba de securitate este important s? se aplice in orice caz

de ce asa

print >> myfile, '<p align="center"><b><font color=','"',(var8),'"','size="3">'

de ce nu asa


myfile.write('<p align="center"><b><font color=','"',(var8),'"','size="3">')

Se poate face cum vrei , prefer s? folosesc print >> îmi este mai comod deoarece in BASH vin folosite des caracterele >> care fac cam acela?i lucru

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...