calebstewart / pwncat

Fancy reverse and bind shell handler
https://pwncat.readthedocs.io
MIT License
2.58k stars 250 forks source link

Blank `XDG_CONFIG_HOME` not handled correctly #239

Open ChocolateOverflow opened 2 years ago

ChocolateOverflow commented 2 years ago

Bug Description

XDG_CONFIG_HOME is not set but running pwncat without -c doesn't apply ~/.config/pwncat/pwncatrc.

pwncat version

I'm using Arch Linux, installed using the BlackArch package pwncat-caleb

$ pwncat --version
0.5.1

Steps to Reproduce

  1. XDG_CONFIG_HOME is blank
  2. Run pwncat without specifying -c.

Expected Behavior

~/.config/pwncat/pwncatrc is used

Actual behavior

~/.config/pwncat/pwncatrc not used. Tested by having alias q exit123 in pwncatrc and seeing pwncat not complaining about it.

calebstewart commented 2 years ago

I can replicate this. It seems I was incorrectly using $XDG_DATA_HOME by mistake (which means it was looking in ~/.local/share/pwncatrc which is incorrect).

I've implemented some updates to fix this, and improve configuration and custom module handling in general over in #242. If you have the time/ability to check out that branch and let me know if it addresses your issue, I'd appreciate it! If not, I understand. I have tested that (at least for me) it loads configurations correctly now from ~/.config/pwncat/pwncatrc as it should (and also from places like /etc/pwncat/pwncatrc since it is obeying the XDG spec now).

AnubisSec commented 1 year ago

So this fixed some of the issues I was having, unrelated to OP. I see this branch properly parses the config file within ~/.config/pwncat/, but the only thing i still can't get to work is the function on_load.

image image