How it works...

Let's look at some print API calls, which will be useful to us while writing Meterpreter scripts:

  • print_line("message"): This call will print the output and add a carriage return at the end.
  • print_status("message"): This call is used most often in the scripting language. It will provide a carriage return and prints the status of whatever is executing with a [*] prefixed at the beginning:
>> print_status("HackingAlert")[*] HackingAlert=> nil
  • print_good("message"): This call is used to provide a result of any operation. The message is displayed with a [+] prefixed at the beginning, indicating that the action is successful:
>> print_good("HackingAlert")[+] HackingAlert=> nil
  • print_error("message"): This call is used to ...

Get Metasploit Penetration Testing Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.