Bash script challenge [part 2]. Authentication test (session) using the curl program.
Bash script challenge [part 2]. Authentication test (session) using the curl program.
Medium level.
Requires:
- A docker installed.
- The curl program to be installed.
- Basic knowledge of Linux commands.
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:
Leave Bash script challenge [part 2]. Authentication test (session) using the curl program. to:
Read more #bash posts
Best Posts From grzesiek
We have not curated any of grzesiekb's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From grzesiek
- Bash script - challenge [part 3]. Authentication test (token) using the curl program.
- Bash script challenge [part 2]. Authentication test (session) using the curl program.
- Bash script - challenge. Writing API tests using the curl program
- Adding description for datasource state [develop Scada-LTS]
- New option in HttpRetriver datasource [Scada-LTS]
- New Export/Import pointHierarchy. [ScadaLTS]
- [Scada-LTS] The possibility to add image sets without requiring a reboot
- [Scada-LTS] The possibility to add image sets without a restart
- New Project “shop-at-everything”.
- A successful attempt on adding switch language option in the angular app and integrating it with crowdin.com
- Add login component [EN/PL]
- Generating data (multistate) for simulations in Scada-LTS. [EN/PL]
- Correct the api rest authentication [EN/PL]
- How the data of virtual multisate points in the Scada-LTS program change
- We add a virtual point with the ** multistate ** type (increment) in Scada-LTS
- Generating data (binary) for simulations in Scada-LTS / Generowanie danych (binarnych) do symulacji w Scadzie-LTS [EN/PL]
- Preview how data from "virtual-data source" (type binary - Alternate, No Change, Random) changes every second
- Add "virtual point" in "virual data-source" - with Binary type in Scada-LTS
- Add a "virtual data-source" in Scada-LTS
- Add permission mask decoding