Default Credentials
A service installed with a factory username/password pair that nobody changed is the cheapest way in there is: no exploit, no brute force, nothing to break. All you need is to know which version of which product is answering on the other side, which is what makes turning a version into a vector more than a formality.
The pattern shows up in three different places:
- Web administration panels. Tomcat Manager (
tomcat:s3cret,admin:admin), Request Tracker (root:password), Jenkins, phpMyAdmin, Zabbix (Admin:zabbix), osTicket, routers and cameras. From there there is almost always a documented path to RCE: a WAR deployment in Tomcat, the Jenkins script console, the WordPress theme editor. - Network services with a console of their own. The Apache James admin console on 4555 (
root:root), Redis with no password, unauthenticated MongoDB, SNMP with thepubliccommunity (SNMP enumeration), databases withsaand no password. - Machine and service accounts. The guest account,
anonymouson FTP, or an application user whose name is the product's.
There is no command that exploits this: what there is, is a habit. Before looking for an exploit for the version that just showed up in the banner, look for its factory credentials in the product's own documentation, which is where they live and where the vendor publishes them so the administrator changes them.
nxc smb <ip> -u <user> -p <pass> # validate the pair against every service
hydra -C <user:pass.txt> <ip> http-get /manager/htmlTwo nuances that save time:
- A default credential rarely works only for its own service. The first thing after it gets you in is trying it everywhere else (credential reuse), because whoever did not change one password did not change the others either.
- The pair may be on the machine, not on the internet. A sample configuration file, a
docker-compose.ymlor the deploymentREADMEcarries the initial password in writing (credentials in source).
Requirements#
That the service still runs with its installation configuration. Nothing else: no vulnerable version, no hidden path, no flaw. In a lab it is almost always the intended route; in a real environment it is the finding that turns up most often on the devices nobody administers (printers, NAS boxes, cameras, backup consoles).
How to detect it. On the service side, a successful login with the factory account from an address that is not the administration one: it is a valid authentication event, so no brute-force detector fires and you have to look for it by account name (admin, root, sa, tomcat, guest). On Windows, a 4624 for the guest account or for a service account coming from a client workstation. And for inventory, what really closes it is a sweep of your own: run the list of known pairs against the services on the network and see which ones answer.
Defence. Change the password at deployment time, not later, and verify it with a job that fails if the factory pair is still alive. Installation accounts get disabled, not renamed. And administration panels do not belong on the user-facing interface: a Tomcat Manager reachable from the internet is a decision, not an oversight by the vendor.
Machines where it's used
- BillybossProving Grounds Practice
- ExfiltratedProving Grounds Practice
- ExtplorerProving Grounds Practice
- HawatProving Grounds Practice
- JerryHackTheBox
- KeeperHackTheBox
- LevramProving Grounds Practice
- MarketingProving Grounds Practice
- NibblesProving Grounds Practice
- SolidStateHackTheBox
- SpiderSocietyProving Grounds Practice
- SquidProving Grounds Practice