Speed up the rootkit
This commit is contained in:
		@@ -48,19 +48,21 @@ export async function main(ns) {
 | 
				
			|||||||
	ns.tprint(`Rooting: ${args['device']}`);
 | 
						ns.tprint(`Rooting: ${args['device']}`);
 | 
				
			||||||
	await slowPrint(ns, '===================================================');
 | 
						await slowPrint(ns, '===================================================');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						let spacer = false;
 | 
				
			||||||
	try {
 | 
						try {
 | 
				
			||||||
		// Run exploits
 | 
							// Run exploits
 | 
				
			||||||
		await slowPrint(ns, `Attacking over SSH (${args['device']}:22)...`, 1, 2);
 | 
					 | 
				
			||||||
		ns.brutessh(args['device']);
 | 
							ns.brutessh(args['device']);
 | 
				
			||||||
		await slowPrint(ns, `Attacking over FTP (${args['device']}:24)...`, 1, 2);
 | 
							await slowPrint(ns, `Attacking over SSH (${args['device']}:22)...`, 1, 2);
 | 
				
			||||||
 | 
							spacer = true;
 | 
				
			||||||
		ns.ftpcrack(args['device']);
 | 
							ns.ftpcrack(args['device']);
 | 
				
			||||||
		await slowPrint(ns, `Attacking over SMTP (${args['device']}:25)...`, 1, 2);
 | 
							await slowPrint(ns, `Attacking over FTP (${args['device']}:24)...`, 1, 2);
 | 
				
			||||||
		ns.relaysmtp(args['device']);
 | 
							ns.relaysmtp(args['device']);
 | 
				
			||||||
 | 
							await slowPrint(ns, `Attacking over SMTP (${args['device']}:25)...`, 1, 2);
 | 
				
			||||||
	} catch {
 | 
						} catch {
 | 
				
			||||||
	} finally {
 | 
						} finally {
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			// Attempt root
 | 
								// Attempt root
 | 
				
			||||||
			ns.tprint('');
 | 
								if(spacer) ns.tprint('');
 | 
				
			||||||
			ns.nuke(args['device'])
 | 
								ns.nuke(args['device'])
 | 
				
			||||||
			ns.tprint(`Root: Success!`);
 | 
								ns.tprint(`Root: Success!`);
 | 
				
			||||||
			ns.tprint('');
 | 
								ns.tprint('');
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user