Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save macabeus/50d2abe781c7e642471e71004635ff9d to your computer and use it in GitHub Desktop.
Save macabeus/50d2abe781c7e642471e71004635ff9d to your computer and use it in GitHub Desktop.
Step by step to setup a bsim server using PostgreSQL and Docker for Ghidra 11.4

Since Ghidra 11.4, we have entrypoints to use Ghidra from official docker scripts.

But it's lacking a beginning-friendly tutorial to setup a bsim server using PostreSQL. Here's how to make it step by step:

  1. Go to the Ghidra root folder

  2. Build the docker images:

./docker/build-docker-image.sh
  1. Create an empty folder to store the postgres database files:
mkdir db
  1. Start the container using bsim-server mode:
docker run \
    --env MODE=bsim-server \
    --rm \
    -it \
    --volume ./db:/ghidra/bsim_datadir \
    -p 5432:5432 \
    ghidra/ghidra:_ \
    /ghidra/bsim_datadir
  1. In a new terminal tab, start a bash session on the above container:
docker exec -it $(docker ps -q --filter "ancestor=ghidra/ghidra:_" | head -n 1) bash
  1. Create a new database on postgres
cd support
./bsim createdatabase postgresql://ghidra@localhost:5432/mydb medium_32
  1. On Ghidra UI, go to BSim -> Manage Servers. If you can't see this menu, make sure you've enabled BSim.
image
  1. Click on + and fill out the form with the following values:
  • DB Name: mydb
  • User: ghidra
  • Host: localhost
image

Done! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment