{"id":5168,"date":"2019-03-26T14:49:00","date_gmt":"2019-03-26T09:19:00","guid":{"rendered":"https:\/\/www.getastra.com\/blog\/cms\/meterpreter-commands-post-exploitation\/"},"modified":"2025-09-03T17:16:52","modified_gmt":"2025-09-03T11:46:52","slug":"meterpreter-commands-post-exploitation","status":"publish","type":"post","link":"https:\/\/www.getastra.com\/blog\/security-audit\/meterpreter-commands-post-exploitation\/","title":{"rendered":"Meterpreter Commands &#8211; Post Exploitation"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This is a continuation of our <a href=\"https:\/\/www.getastra.com\/blog\/security-audit\/how-to-hack-windows-xp-using-metasploit-kali-linux-ms08067\/#Setup-Used-for-Practicing-Metasploit-Basics\">previous article<\/a> where we got meterpreter access of our victim Windows XP machine. In this article, we will look at some of the top meterpreter  <strong>command <\/strong>available in meterpreter which will help us in performing the Post Exploitation with the maximum ease.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"6o2oc\"><span class=\"ez-toc-section\" id=\"1_Meterpreter_Commands_Upload_Meterpreter_Command\"><\/span><strong>1. Meterpreter Commands: Upload <\/strong>Meterpreter Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Upload command allows us to upload files from attacker kali machine to victim Windows XP machine as shown below:<\/p>\n\n\n\n<div class=\"wp-block-image image large\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"\/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/images.storychief.com\/account_5336\/upload_f9716a0f33cdb7c714d5049b20981e8b_1000.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"70sor\"><span class=\"ez-toc-section\" id=\"2_Meterpreter_Commands_Getuid_Meterpreter_Command\"><\/span>2. <strong>Meterpreter Commands:<\/strong> <strong>Getuid<\/strong> Meterpreter Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Getuid command gives us information about the currently logged-in user. This information is useful in privilege escalation as it will help us in determining the privileges the Meterpreter session is running currently, based on the exploited process\/user.<\/p>\n\n\n\n<div class=\"wp-block-image image large\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"\/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/images.storychief.com\/account_5336\/getuid_53edfc785dece814376d6754015b9652_1000.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"2e1af\"><span class=\"ez-toc-section\" id=\"3_Meterpreter_Commands_PS_Meterpreter_Command\"><\/span>3. <strong>Meterpreter Commands:<\/strong> <strong>PS <\/strong>Meterpreter Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The PS command is used to view a list of running processes in victim Windows XP machine as shown below:<\/p>\n\n\n\n<div class=\"wp-block-image image large\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"\/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/images.storychief.com\/account_5336\/pscommand_1dfefe41d11ad100cd40ada7d1ba2919_1000.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"8984q\"><span class=\"ez-toc-section\" id=\"4_Meterpreter_Commands_Migrate_Meterpreter_Command\"><\/span>4. <strong>Meterpreter Commands:<\/strong> <strong>Migrate<\/strong> Meterpreter Command <span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Migrate command allows our meterpreter session to migrate between any of the currently running processes in victim machine, this command is useful when we feel that the process in which we originally have meterpreter session may not be open for a long time or it is unstable. we can know all possible options available for migrate command by entering <strong>run migrate -h <\/strong>as shown below:<\/p>\n\n\n\n<div class=\"wp-block-image image large\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"\/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/images.storychief.com\/account_5336\/migrate1_41d33c41daa8261fff540d6d334dd9bc_1000.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Now we will migrate to a more stable process, let us say, explorer.exe by using migrate command (<strong>run migrate -p 1512<\/strong>) as shown below:<\/p>\n\n\n\n<div class=\"wp-block-image image large\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"\/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/images.storychief.com\/account_5336\/migrate2_8a9518bbd4d02df546118f1a58705fbc_1000.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"5htui\"><span class=\"ez-toc-section\" id=\"5_Meterpreter_Commands_Getsystem_Meterpreter_Command\"><\/span>5. <strong>Meterpreter Commands:<\/strong> <strong>Getsystem <\/strong>Meterpreter Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Getsystem command will make meterpreter try a group of well known local privilege escalation exploits against the target and you will find that we have successfully elevated privileges to that of the local system as shown below:<\/p>\n\n\n\n<div class=\"wp-block-image image large\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"\/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/images.storychief.com\/account_5336\/getsystem_bde7cff99f583e3614f6d9ea0d1c18ec_1000.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"dm4ud\"><span class=\"ez-toc-section\" id=\"6_Meterpreter_Commands_Hashdump_Meterpreter_Command\"><\/span>6. <strong>Meterpreter Commands:<\/strong> <strong>Hashdump<\/strong> Meterpreter Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Hashdump command helps us to retrieve the password hashes from the victim Windows XP machine as shown below:<\/p>\n\n\n\n<div class=\"wp-block-image image large\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"\/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/images.storychief.com\/account_5336\/hashdump_2631ade38121c8617038eea368ea6a80_1000.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"bdll2\"><span class=\"ez-toc-section\" id=\"7_Meterpreter_Commands_Shell_Meterpreter_Command\"><\/span>7. <strong>Meterpreter Commands:<\/strong> <strong>Shell<\/strong> Meterpreter Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Shell command gives us a standard shell on the Windows XP Target as shown below:<\/p>\n\n\n\n<div class=\"wp-block-image image large\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"\/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/images.storychief.com\/account_5336\/shell_597366cdcc021474a25cd91f17d29ec5_1000.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"4s2hr\"><span class=\"ez-toc-section\" id=\"8_Meterpreter_Commands_The_search_Meterpreter_Command\"><\/span>8. <strong>Meterpreter Commands:<\/strong> The <strong>search<\/strong> Meterpreter Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The search command is used to search for specific files on the Windows XP victim machine. The command can search through the entire system or in specific folders as shown below:<\/p>\n\n\n\n<div class=\"wp-block-image image large\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"\/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/images.storychief.com\/account_5336\/search_152363078b196cbbc65c031027290d8d_1000.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"7hhgo\"><span class=\"ez-toc-section\" id=\"9_Meterpreter_Commands_The_clearev_Meterpreter_Command\"><\/span>9. <strong>Meterpreter Commands:<\/strong> The <strong>clearev <\/strong>Meterpreter Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The clearev command can be used to clear all the System, Application and Security logs from victim Windows XP machine as shown below:<\/p>\n\n\n\n<div class=\"wp-block-image image large\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"\/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/images.storychief.com\/account_5336\/clearev_6a409d7e753c7c79c80facc052a88520_1000.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"2u19o\"><span class=\"ez-toc-section\" id=\"10_Meterpreter_Commands_Sysinfo_Meterpreter_Command\"><\/span>10. <strong>Meterpreter Commands:<\/strong> <strong>Sysinfo<\/strong> Meterpreter Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Sysinfo Meterpreter command displays the information about the victim exploited Windows XP machine like Name, OS Type, Architecture,Domain and Language.<\/p>\n\n\n\n<div class=\"wp-block-image image large\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"\/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/images.storychief.com\/account_5336\/sysinfo_929153a8dea487828812baed17551b4b_1000.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The<strong> help<\/strong> command displays meterpreter help menu with a list of commands which can be executed in meterpreter against the Target Windows XP machine.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Reference:<\/strong> Penetration Testing: A Hands-On Introduction to Hacking by Georgia Weidman.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><!-- strchf script --><script>        if(window.strchfSettings === undefined) window.strchfSettings = {};    window.strchfSettings.stats = {url: \"https:\/\/astra-security.storychief.io\/meterpreter-commands-post-exploitation?id=1269434208&type=2\",title: \"Meterpreter Commands - Post Exploitation\",id: \"8584b87e-9542-4b5e-bebf-59f4ae0db88b\"};            (function(d, s, id) {      var js, sjs = d.getElementsByTagName(s)[0];      if (d.getElementById(id)) {window.strchf.update(); return;}      js = d.createElement(s); js.id = id;      js.src = \"https:\/\/d37oebn0w9ir6a.cloudfront.net\/scripts\/v0\/strchf.js\";      js.async = true;      sjs.parentNode.insertBefore(js, sjs);    }(document, 'script', 'storychief-jssdk'))    <\/script><!-- End strchf script --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a continuation of our previous article where we got meterpreter access of our victim Windows XP machine. In this article, we will look at some of the top meterpreter command available in meterpreter which will help us in performing the Post Exploitation with the maximum ease. 1. Meterpreter Commands: Upload Meterpreter Command The &#8230; <a title=\"Meterpreter Commands &#8211; Post Exploitation\" class=\"read-more\" href=\"https:\/\/www.getastra.com\/blog\/security-audit\/meterpreter-commands-post-exploitation\/\" aria-label=\"Read more about Meterpreter Commands &#8211; Post Exploitation\">Read more<\/a><\/p>\n","protected":false},"author":33,"featured_media":5169,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[340],"tags":[785],"class_list":["post-5168","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security-audit","tag-summarize"],"_links":{"self":[{"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/posts\/5168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/comments?post=5168"}],"version-history":[{"count":3,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/posts\/5168\/revisions"}],"predecessor-version":[{"id":41204,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/posts\/5168\/revisions\/41204"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/media\/5169"}],"wp:attachment":[{"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/media?parent=5168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/categories?post=5168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/tags?post=5168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}