User Tools

Site Tools


informatica:linux:curl:post

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
informatica:linux:curl:post [2020/05/29 16:48] – created joseinformatica:linux:curl:post [2020/05/29 18:00] (current) jose
Line 1: Line 1:
 ====== Post con curl ====== ====== Post con curl ======
-Instalamos la extensión "HTTP header live"+Instalamos la extensión "HTTP header live" para ver los posts y headers que pasa.
  
-Vamos a la URL:+Vamos a probar simulación con la URL:
  
 http://localhost:8000/mw-config/index.php http://localhost:8000/mw-config/index.php
  
-Pulsamos continue y nos fijamos en los POST de http headers: +Para simularlo, primero vamos a la primera web y guardamos la cookie con el parámetro -c, los headers con -D y la página con -o y así haremos sucesivamente. Accedemos a la web con -L que sigue todas las redirecciones:
- +
-{{:informatica:linux:curl:post01.png|}} +
- +
-Si hacemos click lo abre en otra ventana: +
- +
- +
- +
-Para simularlo, primero vamos a la primera web y guardamos la cookie+
  
 <code> <code>
Line 23: Line 15:
      -L "http://localhost:8000/mw-config/index.php"      -L "http://localhost:8000/mw-config/index.php"
 </code> </code>
 +
 +
 +Si abrimos el fichero pageX.html podemos ver si vamos bien.
 +
 +Para simular el POST, pulsamos continue y nos fijamos en los POST de http headers:
 +
 +{{:informatica:linux:curl:post01.png|}}
 +
 +Si hacemos click sobre el texto del post, nos abre otra ventana con los datos solo de este post:
 +
 +{{:informatica:linux:curl:post02.png|}}
 +
 +
 +Nos quedamos con los campos:
 +  URL destino: rojo (-L)
 +  Referer: rosa (-e)
 +  Datos del POST: rojo (-d)
 +  
 +Ponemos el parámetro -b para leer la cookie anterior y volvemos a hacer lo mismo con -c,-D,-o subiendo un número para tener histórico:
 +
 +POST:
 +  LanguageRequestTime=1590767092&uselang=en&ContLang=en&submit-continue=Continue
 +Le he quitado la -> del post y funciona.
  
 <code> <code>
Line 30: Line 45:
      -D header2 \      -D header2 \
      -o page2.html \      -o page2.html \
-     -X POST \ 
      -d "LanguageRequestTime=1590767092&uselang=en&ContLang=en&submit-continue=Continue" \      -d "LanguageRequestTime=1590767092&uselang=en&ContLang=en&submit-continue=Continue" \
      -e "http://localhost:8000/mw-config/index.php" \      -e "http://localhost:8000/mw-config/index.php" \
      -L "http://localhost:8000/mw-config/index.php?page=Welcome"      -L "http://localhost:8000/mw-config/index.php?page=Welcome"
 </code> </code>
 +
 +Pulsamos otra vez continue:
 +POST:
 +  submit-continue=Continue
  
 <code> <code>
Line 42: Line 60:
      -D header3 \      -D header3 \
      -o page3.html \      -o page3.html \
-     -X POST \ 
      -d "submit-continue=Continue" \      -d "submit-continue=Continue" \
      -e "http://localhost:8000/mw-config/index.php?page=Welcome" \      -e "http://localhost:8000/mw-config/index.php?page=Welcome" \
-     -L "http://localhost:8000/mw-config/index.php?page=Language"+     -L "http://localhost:8000/mw-config/index.php?page=Welcome"
 </code> </code>
  
 +Rellenamos los datos de la BBDD:
  
 POST:  POST: 
Line 62: Line 80:
      -L "http://localhost:8000/mw-config/index.php?page=DBConnect"      -L "http://localhost:8000/mw-config/index.php?page=DBConnect"
 </code> </code>
 +
 +Si dejamos marcado lo de "Use the same account as for installation" y pulsamos continue:
  
 POST: POST:
informatica/linux/curl/post.1590770903.txt.gz · Last modified: 2020/05/29 16:48 by jose