User Tools

Site Tools


informatica:linux:curl

This is an old revision of the document!


Post con curl

Instalamos la extensión “HTTP header live”

http://localhost:8000/mw-config/index.php

Pulsamos continue y nos fijamos en los POST de http headers:

Si hacemos click lo abre en otra ventana:

Para simularlo, primero vamos a la primera web y guardamos la cookie

curl -A "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0" \
     -c cookie1 \
     -D header1 \
     -o page1.html \
     -L "http://localhost:8000/mw-config/index.php"
curl -A "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0" \
     -b cookie1 \
     -c cookie2 \
     -D header2 \
     -o page2.html \
     -X POST \
     -d "LanguageRequestTime=1590767092&uselang=en&ContLang=en&submit-continue=Continue" \
     -e "http://localhost:8000/mw-config/index.php" \
     -L "http://localhost:8000/mw-config/index.php?page=Welcome"
curl -A "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0" \
     -b cookie2 \
     -c cookie3 \
     -D header3 \
     -o page3.html \
     -X POST \
     -d "submit-continue=Continue" \
     -e "http://localhost:8000/mw-config/index.php?page=Welcome" \
     -L "http://localhost:8000/mw-config/index.php?page=Language"

POST:

DBType=mysql&mysql_wgDBserver=app-db&mysql_wgDBname=my_wiki&mysql_wgDBprefix=prueba&mysql__InstallUser=root&mysql__InstallPassword=wiki&sqlite_wgSQLiteDataDir=/var/www/data&sqlite_wgDBname=my_wiki&submit-continue=Continue →
curl -A "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0" \
     -b cookie3 \
     -c cookie4 \
     -D header4 \
     -o page4.html \
     -d "DBType=mysql&mysql_wgDBserver=app-db&mysql_wgDBname=my_wiki&mysql_wgDBprefix=prueba&mysql__InstallUser=root&mysql__InstallPassword=wiki&sqlite_wgSQLiteDataDir=/var/www/data&sqlite_wgDBname=my_wiki&submit-continue=Continue" \
     -e "http://localhost:8000/mw-config/index.php?page=DBConnect" \
     -L "http://localhost:8000/mw-config/index.php?page=DBConnect"

POST:

mysql__SameAccount=1&mysql_wgDBuser=wikiuser&mysql_wgDBpassword=&submit-continue=Continue
curl -A "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0" \
     -b cookie4 \
     -c cookie5 \
     -D header5 \
     -o page5.html \
     -d "mysql__SameAccount=1&mysql_wgDBuser=wikiuser&mysql_wgDBpassword=&submit-continue=Continue" \
     -e "http://localhost:8000/mw-config/index.php?page=DBSettings" \
     -L "http://localhost:8000/mw-config/index.php?page=DBSettings"
informatica/linux/curl.1590770652.txt.gz · Last modified: 2020/05/29 16:44 by jose