Python - setting / getting environment variables and additions
I need to set an environment variable in Python and find the address in memory where it resides. Since this is on Linux, I don't mind using libraries that only work sequentially on Linux (if that's the only way). How do you do it?
Edit: The problem is this: I'm trying to hack a program for a class, and essentially I put my shellcode in an environment variable and then overwrite one byte per victim code with the address of my environment variable. I need to find a way to automate this in Python, so my question is twofold:
-
Is there a way to get the address into memory of an environment variable?
-
Can I only do this in bash / C or can I do it exclusively in Python?
+1
source to share
3 answers