Foros del Web » Programando para Internet » PHP »

PHP OO Ofuscar Iframe con json

Estas en el tema de Ofuscar Iframe con json en el foro de PHP en Foros del Web. Hola tengo estos iframes de videos online en una pagina como podria ofuscar el iframe para q no aparezca asi en el codigo fuente ya ...
  #1 (permalink)  
Antiguo 21/05/2015, 18:27
 
Fecha de Ingreso: agosto-2011
Mensajes: 75
Antigüedad: 12 años, 8 meses
Puntos: 0
Ofuscar Iframe con json

Hola

tengo estos iframes de videos online en una pagina
como podria ofuscar el iframe para q no aparezca asi en el codigo fuente
ya que he visto en muchos sitios de videos online que encriptan sus videos

Código:
<div id="tab1" class="tab_content"><iframe width="600" height="400" frameborder="0" src="https://www.youtube.com/watch?v=Svhjhgf8AyI" scrolling="no"></iframe></div>

<div id="tab2" class="tab_content"><iframe width="600" height="400" frameborder="0" src="http://videobam.com/widget/NhjBta&width=600&height=400" scrolling="no"></iframe></div>

<div id="tab3" class="tab_content"><iframe src="www.dailymotion.com/swf/video/x2hjo8n8" type="application/x-shockwave-flash" wmode="transparent" width="600" height="400" scrolling='no' frameborder='0'></iframe></div>
por ejemplo he visto esta ofuscacion con \
lei que es algo de JSON en php, me podrian ayudar con un ejemplo

Código:
<li class="subtab" data-tab-id="3"><div class="parte" data="{'v':'\u003Ciframe class=\u0022player_conte\u0022 frameborder=\u00220\u0022 width=\u0022760\u0022 height=\u0022430\u0022 scrolling=\u0022no\u0022 src=\u0022http:\/\/www.dailymotion.com\/embed\/video\/x2qunpe_ore7_shortfilms\u0022\u003E\u003C\/iframe\u003E'}">Parte 1</div></li><li class="subtab" data-tab-id="4"><div class="parte" data="{'v':'\u003Ciframe marginheight=\u00220\u0022 marginwidth=\u00220\u0022 scrolling=\u0022no\u0022 frameborder=\u00220\u0022 width=\u0022760\u0022 height=\u0022430\u0022 src=\u0022http:\/\/./\/gk\/netu.php?nt=AWR63UNNNMNY\u0022 target=\u0022_blank\u0022\u003E\u003C\/iframe\u003E'}">Parte 1</div></li><li class="subtab" data-tab-id="5"><div class="parte" data="{'v':'\u003Ciframe title=\u0022VideoBam video player\u0022 type=\u0022text\/html\u0022 frameborder=\u00220\u0022 scrolling=\u0022no\u0022 width=\u0022560\u0022 height=\u0022430\u0022 src=\u0022http:\/\/videobam.com\/widget\/kMrgU\/custom\/560\u0022 allowFullScreen\u003E\u003C\/iframe\u003E'}">Parte 1</div></li><li class="subtab" data-tab-id="6"><div class="parte" data="{'v':'\u003Ciframe src=\u0022http:\/\/embed.yourupload.com\/ul8n1EJ4qP33?client_file_id=148234\u0026width=760\u0026height=430\u0022 style=\u0022width:760px;height:430px;border:0;margin:0;padding:0;\u0022\u003E\u003C\/iframe\u003E'}">Parte 1</div></li>
  #2 (permalink)  
Antiguo 22/05/2015, 11:30
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: Ofuscar Iframe con json

Eso no es, ni de lejos, "ofuscación" así que no te confundas.

Es únicamente una cadena de texto codificada en formato JSON:
Código PHP:
Ver original
  1. $json = json_encode('<iframe width="600" height="400" frameborder="0" src="https://www.youtube.com/watch?v=Svhjhgf8AyI" scrolling="no"></iframe>');
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #3 (permalink)  
Antiguo 22/05/2015, 22:44
 
Fecha de Ingreso: agosto-2011
Mensajes: 75
Antigüedad: 12 años, 8 meses
Puntos: 0
Respuesta: Ofuscar Iframe con json

Cita:
Iniciado por pateketrueke Ver Mensaje
Eso no es, ni de lejos, "ofuscación" así que no te confundas.

Es únicamente una cadena de texto codificada en formato JSON:
Código PHP:
Ver original
  1. $json = json_encode('<iframe width="600" height="400" frameborder="0" src="https://www.youtube.com/watch?v=Svhjhgf8AyI" scrolling="no"></iframe>');
y como se imprime eso?
ya q con echo de php sale asi
ovbiamente sale caido el iframe

este es el codigo fuente
Código:
	<body>
	<h1>Sin json!</h1>
		<iframe width="560" height="315" src="https://www.youtube.com/embed/AE4b9jO1uB4" frameborder="0" allowfullscreen></iframe>
	<h1>Con json!</h1>
	"<iframe width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/AE4b9jO1uB4\" frameborder=\"0\" allowfullscreen><\/iframe>"	
		
	</body>
  #4 (permalink)  
Antiguo 23/05/2015, 13:59
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: Ofuscar Iframe con json

El asunto es que para que resulte así:
Cita:
<li class="subtab" data-tab-id="3"><div class="parte" data="{'v':'\u003Ciframe class=\u0022player_conte\u0022 frameborder=\u00220\u0022 width=\u0022760\u0022 height=\u0022430\u0022 scrolling=\u0022no\u0022 src=\u0022http:\/\/www.dailymotion.com\/embed\/video\/x2qunpe_ore7_shortfilms\u0022\u003E\u003C\/iframe\u003E'}">Parte 1</div></li><li class="subtab" data-tab-id="4"><div class="parte" data="{'v':'\u003Ciframe marginheight=\u00220\u0022 marginwidth=\u00220\u0022 scrolling=\u0022no\u0022 frameborder=\u00220\u0022 width=\u0022760\u0022 height=\u0022430\u0022 src=\u0022http:\/\/./\/gk\/netu.php?nt=AWR63UNNNMNY\u0022 target=\u0022_blank\u0022\u003E\u003C\/iframe\u003E'}">Parte 1</div></li><li class="subtab" data-tab-id="5"><div class="parte" data="{'v':'\u003Ciframe title=\u0022VideoBam video player\u0022 type=\u0022text\/html\u0022 frameborder=\u00220\u0022 scrolling=\u0022no\u0022 width=\u0022560\u0022 height=\u0022430\u0022 src=\u0022http:\/\/videobam.com\/widget\/kMrgU\/custom\/560\u0022 allowFullScreen\u003E\u003C\/iframe\u003E'}">Parte 1</div></li><li class="subtab" data-tab-id="6"><div class="parte" data="{'v':'\u003Ciframe src=\u0022http:\/\/embed.yourupload.com\/ul8n1EJ4qP33?client_file_id=148234\u0026width=760\ u0026height=430\u0022 style=\u0022width:760px;height:430px;border:0;marg in:0;padding:0;\u0022\u003E\u003C\/iframe\u003E'}">Parte 1</div></li>
Debes imprimirlo así:
Código PHP:
Ver original
  1. <div data-iframe="<?php echo json_encode($html); ?>"></div>

Y debes usar Javascript para que se inyecte en el HTML final, etc.
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #5 (permalink)  
Antiguo 23/05/2015, 15:00
 
Fecha de Ingreso: agosto-2011
Mensajes: 75
Antigüedad: 12 años, 8 meses
Puntos: 0
Respuesta: Ofuscar Iframe con json

Cita:
Iniciado por pateketrueke Ver Mensaje
El asunto es que para que resulte así:


Debes imprimirlo así:
Código PHP:
Ver original
  1. <div data-iframe="<?php echo json_encode($html); ?>"></div>

Y debes usar Javascript para que se inyecte en el HTML final, etc.
y como lo hago con js?
me podrias dar un ejemplo
ya q probe el ultimo codigo que pusiste y sale asi

Código:
<div data-iframe=""\"<iframe width=\\\"560\\\" height=\\\"315\\\" src=\\\"https:\\\/\\\/www.youtube.com\\\/embed\\\/AE4b9jO1uB4\\\" frameborder=\\\"0\\\" allowfullscreen><\\\/iframe>\"""></div>
  #6 (permalink)  
Antiguo 23/05/2015, 16:05
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: Ofuscar Iframe con json

La corrección es la siguiente:
Código PHP:
Ver original
  1. <div data-iframe="<?php echo htmlspecialchars(json_encode($html)); ?>"></div>

Cita:
y como lo hago con js?
Eso lo podrías discutir en un tema aparte, en el subforo de Javascript.
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #7 (permalink)  
Antiguo 24/05/2015, 19:39
 
Fecha de Ingreso: agosto-2011
Mensajes: 75
Antigüedad: 12 años, 8 meses
Puntos: 0
Respuesta: Ofuscar Iframe con json

Cita:
Iniciado por pateketrueke Ver Mensaje
La corrección es la siguiente:
Código PHP:
Ver original
  1. <div data-iframe="<?php echo htmlspecialchars(json_encode($html)); ?>"></div>

Eso lo podrías discutir en un tema aparte, en el subforo de Javascript.
me sale casi igual con esa linea de codigo
pero ya cree un tema en el subforo de javascript
espero que me sigas ayudando, muchas gracias, aqui lo dejo
http://www.forosdelweb.com/f13/imprimir-php-1128595

Etiquetas: html, iframe, json, ofuscar
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:32.