| Command | WinDbg | LLDB |
|---|---|---|
| Start | windbg {executable} [{args}] |
lldb {executable} [--args] |
| Attach | windbg -p {pid} |
lldb --attach-pid {pid} |
| Command | WinDbg | LLDB |
|---|---|---|
| (Re)load symbols | lb {module-name} |
target symbols add {symbol-file-path} |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using System.IO; | |
| using System.Net.Sockets; | |
| using System.Runtime.InteropServices; | |
| namespace testing_bytes_for_the_binary |
| #include <ctype.h> | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <ctype.h> | |
| void *encrypt(char *str, int32_t key) { | |
| uint32_t length = strlen(str); | |
| void* result = malloc(length + 1); |
| var CryptoJS = require("crypto-js"); | |
| var http = require("http"); | |
| var axios = require("axios"); | |
| const { URLSearchParams } = require("url"); | |
| let alphabet = "abcdefghijklmnopqrstuvwxyz"; | |
| let fixedKey = "zyxwvutsrqponmlkjihgfedcba"; | |
| function isUpperCase(letter) { | |
| let charCode = letter.charCodeAt(0); |
| # openssl req -newkey rsa:2048 -nodes -keyout server.key -x509 -days 365 -out server.crt | |
| import http.server | |
| import ssl | |
| from http.server import HTTPServer, SimpleHTTPRequestHandler | |
| host = '0.0.0.0' | |
| port = 8000 | |
| certfile = 'server.crt' | |
| keyfile = 'server.key' |
| from flask import Flask, request | |
| from flask_ipfilter import IPFilter, Whitelist | |
| import requests | |
| app = Flask(__name__) | |
| HTTP_METHODS = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'] # getting all methods work on the target | |
| ip_filter = IPFilter(app, ruleset=Whitelist()) | |
| ip_filter.ruleset.permit("xxx.xxx.xx.x") # whitelisting my office public IP |
| # running vulnserver in wine | |
| # debug it on winedbg with gef plugin enabled | |
| from pwn import * | |
| import string | |
| from struct import pack | |
| context.log_level = "DEBUG" | |
| r = remote("127.0.0.1", 9999) | |
| ''' | |
| else if (strncmp(RecvBuf, "TRUN ", 5) == 0) { |
| #!/bin/bash | |
| convert_ip_address() { | |
| IFS=':' read -ra parts <<< "$1" | |
| ip="" | |
| for part in "${parts[@]:0:4}"; do | |
| ip+=$(printf "%d." 0x$part) | |
| done | |
| ip=${ip::-1} | |
| port=$(printf "%d" 0x${parts[4]}) |
| var cryptojs = require("crypto-js"); | |
| var axios = require("axios"); | |
| var cheerio = require("cheerio"); | |
| var readline = require("readline"); | |
| function decrypt(data) { | |
| const key = cryptojs.enc.Hex.parse("0123456789abcdef0123456789abcdef"); | |
| const iv = cryptojs.enc.Hex.parse("abcdef9876543210abcdef9876543210"); | |
| const bytes = cryptojs.AES.decrypt({ciphertext: cryptojs.enc.Base64.parse(data)}, key, {iv: iv}); | |
| return console.log(bytes.toString(cryptojs.enc.Utf8)); |