__________     __ __     __  _______    ________
  / ____/ __ \   / // /    / / / /  _/ |  / / ____/
 / / __/ / / /  / // /_   / /_/ // / | | / / __/
/ /_/ / /_/ /  /__  __/  / __  // /  | |/ / /___
\____/\____/     /_/    /_/ /_/___/  |___/_____/

 --- A GOPHER-LIKE INTERFACE FOR HIVE BLOCKCHAIN ---

Bash script challenge [part 2]. Authentication test (session) using the curl program.

BY: @grzesiekb | CREATED: Feb. 25, 2020, 7 p.m. | VOTES: 19 | PAYOUT: $0.06 | [ VOTE ]

[IMAGE: https://cdn.steemitimages.com/DQmdgWnzYsFnHPgPBMEF78BrE5Mh4CxNXyzkdKR2a2HsUts/BgxWBRxjvNhnbM9DiyHtCptYaDNF3xx85r8if8spuMjfmaUcx7ApmPrGXu8A7WmqTe4YQcPadtu1GRJg4K5DhHL1KmiBkEB82MtoptfMhQRcKcxwQQ3QYrUHKrsaVMUbMQ73xmBqwaaHGk3HiHuoMFYdqSLMkANxYoecq5dqW6Wzum8.jpeg]

Bash script challenge [part 2]. Authentication test (session) using the curl program.

Medium level.

Requires:

In this section, I will try to log in to the Scada-LTS application using the curl program.

Let's run the docker with the ScadaLTS program.

docker run -d scadalts/scadalts:siv_dev /root/start.sh

Let's retrieve information about the port on which the program started.

export IpDocker=`docker inspect -f "{{ .NetworkSettings.IPAddress }}" $(docker ps -aq)`
echo $IpDocker

Let's try to authenticate in SCADA using the curl program.

curl -d "username=admin&password=admin&submit=Login" --dump-header headers http://$IpDocker:8080/ScadaLTS/login.htm

Let's print file headers.

cat headers

If we have the following information in the file, it means that we managed to authenticate in SCADA:
HTTP/1.1 302 Found
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=2B7D9B1CC45E66EFE8F082492157E12C; Path=/ScadaLTS; HttpOnly
Location: watch_list.shtm;jsessionid=2B7D9B1CC45E66EFE8F082492157E12C
Content-Language: en
Content-Length: 0
Date: Thu, 12 Sep 2019 14:02:59 GMT

We can check the result using the grep program.

cat headers | grep “302 Found” && echo ok || echo ‘not work’

The next topic will be Authentication with the use of a token.

Table of contents:

[Start] Writing API tests using the curl program

TAGS: [ #bash ] [ #test ] [ #curl ] [ #scadalts ]

Replies

NO REPLIES FOUND.

[ BACK TO TRENDING ] [ BACK TO MENU ]
CMD>