AlessandroZ / BeRoot

Privilege Escalation Project - Windows / Linux / Mac

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NameError: name 'unicode' is not defined AND TypeError: a bytes-like object is required, not 'str'

mark0100 opened this issue · comments

If I run the BeRoot for linux script I get:

python3 ./beroot.py

|====================================================================|
| |
| Linux Privilege Escalation |
| |
| ! BANG BANG ! |
| |
|====================================================================|

Traceback (most recent call last):
File "/mnt/ubie/mark/secur/BeRoot/Linux/beroot/modules/services.py", line 50, in _get_services_systemd
argv0 = unicode(argv0)
NameError: name 'unicode' is not defined

Getting permissions of sensitive files. Could take some time...
Checking for suid bins. Could take some time...

################ Suid Binaries ################

/usr/bin/chsh
/usr/bin/chfn
/usr/bin/fusermount
/usr/bin/mount
[+] gtfobins found:
- sudo mount -o bind /bin/sh /bin/mount
- sudo mount
/usr/bin/newgrp
/usr/bin/gpasswd
/usr/bin/pkexec
/usr/bin/sudo
/usr/bin/umount
/usr/bin/passwd
/usr/bin/su
/usr/sbin/pppd
/usr/sbin/mount.nfs
/usr/share/skypeforlinux/chrome-sandbox
/usr/share/teams/chrome-sandbox
/usr/lib/eject/dmcrypt-get-device
/usr/lib/policykit-1/polkit-agent-helper-1
/usr/lib/cupsPPD/prlinuxcupsppd
/usr/lib/xorg/Xorg.wrap
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/chromium-browser/chrome-sandbox
/usr/lib/openssh/ssh-keysign

Traceback (most recent call last):
File "./beroot.py", line 28, in
run(arguments.password)
File "/mnt/ubie/mark/secur/BeRoot/Linux/beroot/run.py", line 192, in run
results = c()
File "/mnt/ubie/mark/secur/BeRoot/Linux/beroot/run.py", line 74, in sudo_list
rules = self.sudolist.rules_from_sudo_ll()
File "/mnt/ubie/mark/secur/BeRoot/Linux/beroot/modules/sudo/sudo_list.py", line 53, in rules_from_sudo_ll
sudo_rules = self._parse_sudo_list(sudo_list)
File "/mnt/ubie/mark/secur/BeRoot/Linux/beroot/modules/sudo/sudo_list.py", line 65, in _parse_sudo_list
if 'LD_PRELOAD' in sudo_list:
TypeError: a bytes-like object is required, not 'str'

I'm on Ubuntu 20.04.
uname -a
Linux fusion 5.8.0-36-generic #40~20.04.1-Ubuntu SMP Wed Jan 6 10:15:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

python3 --version
Python 3.8.5

Should be fixed now 👍

confirmed. :-)