reverse-engineering

How to mimic rand() function of C in python?

How to mimic rand() function of C in python? Question: I am trying to reverse a logic of a C program with python. Part of the C program is the following : timeVar = time((time_t *)0x0) seed = (uint)timeVar; srand(seed); random_value1 = rand(); random_value2 = rand(); random_value3 = rand(); There is no upper bound given …

Total answers: 3

Host header differs from Target in handshake request for WebSocket

Host header differs from Target in handshake request for WebSocket Question: I am intercepting WebSocket traffic from the garage door opener app called Linear (iOS/Android) and it looks to use Azure guessing by the domain names (trafficmanager.net, cloudapp.net, etc…). When it makes it’s initial HTTP request to upgrade to WebSocket, it sends this request to …

Total answers: 1

ret2libc attack MOVAPS segfault

ret2libc attack MOVAPS segfault Question: I am trying to exploit a ret2libc vulnerable code in my own machine. Here is the source code. #include <unistd.h> #include <stdio.h> #include <string.h> #include <stdlib.h> void vuln(char *input); int main(int argc, char **argv) { if (argc > 1){ vuln(argv[1]); }; return 0; } void vuln(char *input){ char buffer[256]; memcpy(buffer, …

Total answers: 1

Clean Angr disassemble output

Clean Angr disassemble output Question: I’m developing a python script for Angr that has to print as output something in the form of: Instruction_disassembled opcode_bytes_of_instruction This is my python script: f = open(sys.argv[2], ‘w’) base_addr = 0x100000 p = angr.Project(sys.argv[1], auto_load_libs = False, load_options = {‘main_opts’:{‘base_addr’: base_addr}}) cfg = p.analyses.CFGFast() cfg.normalize() for func_node in cfg.functions.values(): …

Total answers: 1

How to log CPU instructions executed by a Python program?

How to log CPU instructions executed by a Python program? Question: I understand that Python source code is compiled into bytecode which is then interpreted by the Python VM (let’s say CPython). If I understand correctly, this mean that the VM parses the bytecode instructions and decides (at runtime) what CPU instructions should be executed …

Total answers: 2