I don't know that much about programming but I am trying to practice. I am trying to learn to work with Python and some of the current exploits that are in BT. I am practicing taking some of the exploits out of Metasploit and convert them over to Python.
On some of the stack overflows, a stack adjustment is made because there is not enough free code to enclose a usable payload.
After doing research the 'StackAdjustment' causes the framework to prepend an add esp, -3500 to the payload.
'Space' => 250,
'BadChars' => \x00\x20\x0a\x0d",
'StackAdjustment' => -3500,
My question is what would be the coding syntax be in Python?
(3500 - len(shellcode)) ?
Or would it be something like the example I found here: h t t p://en.wikipedia.org/wiki/Stack_(data_structure)? Or is there a simpler way to do this? Any info is appreciated.
self.stack_pointer = None
def push(self, element):
self.stack_pointer = Node(element, self.stack_pointer)
e = self.stack_pointer.element
self.stack_pointer = self.stack_pointer.next
i = 0
sp = self.stack_pointer
i += 1
sp = sp.next
def __init__(self, element=None, next=None):
self.element = element
self.next = next
if __name__ == '__main__':
# small use example
s = Stack()
[s.push(i) for i in xrange(10)]
print [s.pop() for i in xrange(len(s))]