miércoles, 18 de noviembre de 2026

Create a Unit service on Linux (systemd) logging Datetime

CreateAServicedlogDatetime.md

Creating a Unit service en Linux (systemd)

logging DateTime with start, stop options

references:
man systemd.service

Unit priority
1.- /etc/systemd/system
2.- /run/systemd/system
3.- /lib/systemd/system

/etc/systemd/system user create his service user
/etc/systemd/user user create his service user (here don’t find the service)
/lib/systemd/system installed packages, standard systemd unit files
/usr/lib/systemd/system from locally installed packages (eg. via apt-get)
/run/systemd/system runtime generated or transient

To see the Current Unit Services

sudo systemctl list-units
sudo systemctl list-units --type target --all
sudo systemctl list-units --type service --all
sudo systemctl list-unit-files

See the types of [service]s in ...
grep 'Type=' /etc/systemd/system/*.service

Create our service

Create the bash script

vi helloworldd

#!/bin/bash

function hellostart() {
  while [ 1 ]
    do
    echo Hello World $(date)
    sleep 10
    done
}

function hellostop() {
  killall $(basename $0)
}

case "$1" in
  start)
    hellostart
  ;;
  stop)
    hellostop
  ;;
esac

Copy the script in user scripts directory

cp helloworldd /usr/local/sbin/  

create de unit systemd service

vi helloworldd.service


[Unit]
Description=Hello World Service
After=multi-user.target

[Service]
Type=simple
ExecStart=/usr/local/sbin/helloworldd start
ExecStop=/usr/local/sbin/helloworldd stop
TimeoutStopSec=infinity

[Install]
WantedBy=multi-user.target

copy to the units services directory

cp helloworldd.service /etc/sytemd/system/           

Start and Stop the service

sudo systemctl start helloworldd.service 
orangepi@orangepi4pro:~$ sudo systemctl status helloworldd.service 
● helloworldd.service - Hello World Service
     Loaded: loaded (/etc/systemd/system/helloworldd.service; disabled; preset: enabled)
     Active: active (running) since Wed 2026-11-18 17:38:27 CST; 1s ago
 Invocation: 49287eb900f345b0b152437313844df1
   Main PID: 5818 (helloworldd)
      Tasks: 2 (limit: 4536)
     Memory: 536K (peak: 1.7M)
        CPU: 25ms
     CGroup: /system.slice/helloworldd.service
             ├─5818 /bin/bash /usr/local/sbin/helloworldd start
             └─5820 sleep 10

Nov 18 17:38:27 orangepi4pro systemd[1]: Started helloworldd.service - Hello World Service.
Nov 18 17:38:27 orangepi4pro helloworldd[5818]: Hello World Wed Nov 18 05:38:27 PM CST 2026
orangepi@orangepi4pro:~$ sudo systemctl stop helloworldd.service 
orangepi@orangepi4pro:~$ sudo systemctl status helloworldd.service 
× helloworldd.service - Hello World Service
     Loaded: loaded (/etc/systemd/system/helloworldd.service; disabled; preset: enabled)
     Active: failed (Result: signal) since Wed 2026-11-18 17:38:40 CST; 2s ago
   Duration: 12.836s
 Invocation: 49287eb900f345b0b152437313844df1
    Process: 5818 ExecStart=/usr/local/sbin/helloworldd start (code=killed, signal=TERM)
    Process: 5833 ExecStop=/usr/local/sbin/helloworldd stop (code=killed, signal=TERM)
   Main PID: 5818 (code=killed, signal=TERM)
   Mem peak: 2.2M
        CPU: 67ms

Nov 18 17:38:27 orangepi4pro systemd[1]: Started helloworldd.service - Hello World Service.
Nov 18 17:38:27 orangepi4pro helloworldd[5818]: Hello World Wed Nov 18 05:38:27 PM CST 2026
Nov 18 17:38:37 orangepi4pro helloworldd[5818]: Hello World Wed Nov 18 05:38:37 PM CST 2026
Nov 18 17:38:40 orangepi4pro systemd[1]: Stopping helloworldd.service - Hello World Service...
Nov 18 17:38:40 orangepi4pro systemd[1]: helloworldd.service: Control process exited, code=killed, status=15/TERM
Nov 18 17:38:40 orangepi4pro systemd[1]: helloworldd.service: Failed with result 'signal'.
Nov 18 17:38:40 orangepi4pro systemd[1]: Stopped helloworldd.service - Hello World Service.

journalctl

sudo journalctl -u helloworldd.service 

Nov 18 16:17:23 orangepi4pro systemd[1]: helloworldd.service: Failed with result 'exit-code'.
Nov 18 16:19:06 orangepi4pro systemd[1]: Started helloworldd.service - Hello World Service.
Nov 18 16:19:06 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:19:06 PM CST 2026
Nov 18 16:19:16 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:19:16 PM CST 2026
Nov 18 16:19:26 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:19:26 PM CST 2026
Nov 18 16:19:37 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:19:37 PM CST 2026
Nov 18 16:19:47 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:19:47 PM CST 2026
Nov 18 16:19:57 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:19:57 PM CST 2026
Nov 18 16:20:07 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:20:07 PM CST 2026
Nov 18 16:20:17 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:20:17 PM CST 2026
Nov 18 16:20:27 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:20:27 PM CST 2026
Nov 18 16:20:37 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:20:37 PM CST 2026
Nov 18 16:20:47 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:20:47 PM CST 2026
Nov 18 16:20:57 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:20:57 PM CST 2026
Nov 18 16:21:07 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:21:07 PM CST 2026
Nov 18 16:21:17 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:21:17 PM CST 2026
Nov 18 16:21:27 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:21:27 PM CST 2026
Nov 18 16:21:37 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:21:37 PM CST 2026
Nov 18 16:21:47 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:21:47 PM CST 2026
Nov 18 16:21:57 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:21:57 PM CST 2026
Nov 18 16:22:07 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:22:07 PM CST 2026
Nov 18 16:22:17 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:22:17 PM CST 2026
Nov 18 16:22:27 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:22:27 PM CST 2026
Nov 18 16:22:37 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:22:37 PM CST 2026
Nov 18 16:22:47 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:22:47 PM CST 2026
Nov 18 16:22:57 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:22:57 PM CST 2026
Nov 18 16:23:07 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:23:07 PM CST 2026
Nov 18 16:23:17 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:23:17 PM CST 2026
Nov 18 16:23:27 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:23:27 PM CST 2026
Nov 18 16:23:37 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:23:37 PM CST 2026
Nov 18 16:23:47 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:23:47 PM CST 2026
Nov 18 16:23:57 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:23:57 PM CST 2026
Nov 18 16:24:07 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:24:07 PM CST 2026
Nov 18 16:24:17 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:24:17 PM CST 2026
Nov 18 16:24:27 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:24:27 PM CST 2026
Nov 18 16:24:37 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:24:37 PM CST 2026
Nov 18 16:24:47 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:24:47 PM CST 2026
Nov 18 16:24:57 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:24:57 PM CST 2026
Nov 18 16:25:07 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:25:07 PM CST 2026
Nov 18 16:25:17 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:25:17 PM CST 2026
Nov 18 16:25:27 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:25:27 PM CST 2026
Nov 18 16:25:37 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:25:37 PM CST 2026
Nov 18 16:25:47 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:25:47 PM CST 2026
Nov 18 16:25:57 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:25:57 PM CST 2026
Nov 18 16:26:07 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:26:07 PM CST 2026
Nov 18 16:26:17 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:26:17 PM CST 2026
Nov 18 16:26:27 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:26:27 PM CST 2026
Nov 18 16:26:37 orangepi4pro helloworldd[3971]: Hello World Wed Nov 18 04:26:37 PM CST 2026
Nov 18 16:26:38 orangepi4pro systemd[1]: Stopping helloworldd.service - Hello World Service...
Nov 18 16:26:39 orangepi4pro systemd[1]: helloworldd.service: Control process exited, code=killed, status=15/TERM
Nov 18 16:26:39 orangepi4pro systemd[1]: helloworldd.service: Failed with result 'signal'.
Nov 18 16:26:39 orangepi4pro systemd[1]: Stopped helloworldd.service - Hello World Service.
Nov 18 16:42:28 orangepi4pro systemd[1]: Started helloworldd.service - Hello World Service.
Nov 18 16:42:28 orangepi4pro helloworldd[4493]: Hello World Wed Nov 18 04:42:28 PM CST 2026
Nov 18 16:42:38 orangepi4pro helloworldd[4493]: Hello World Wed Nov 18 04:42:38 PM CST 2026
Nov 18 16:42:48 orangepi4pro helloworldd[4493]: Hello World Wed Nov 18 04:42:48 PM CST 2026
Nov 18 16:42:58 orangepi4pro helloworldd[4493]: Hello World Wed Nov 18 04:42:58 PM CST 2026
Nov 18 16:43:08 orangepi4pro helloworldd[4493]: Hello World Wed Nov 18 04:43:08 PM CST 2026
Nov 18 16:43:09 orangepi4pro systemd[1]: Stopping helloworldd.service - Hello World Service...
Nov 18 16:43:09 orangepi4pro systemd[1]: helloworldd.service: Control process exited, code=killed, status=15/TERM
Nov 18 16:43:09 orangepi4pro systemd[1]: helloworldd.service: Failed with result 'signal'.
Nov 18 16:43:09 orangepi4pro systemd[1]: Stopped helloworldd.service - Hello World Service.
Nov 18 16:58:52 orangepi4pro systemd[1]: Started helloworldd.service - Hello World Service.
Nov 18 16:58:52 orangepi4pro helloworldd[4980]: Hello World Wed Nov 18 04:58:52 PM CST 2026
Nov 18 16:59:02 orangepi4pro helloworldd[4980]: Hello World Wed Nov 18 04:59:02 PM CST 2026
Nov 18 16:59:12 orangepi4pro helloworldd[4980]: Hello World Wed Nov 18 04:59:12 PM CST 2026
Nov 18 16:59:22 orangepi4pro helloworldd[4980]: Hello World Wed Nov 18 04:59:22 PM CST 2026
Nov 18 16:59:32 orangepi4pro helloworldd[4980]: Hello World Wed Nov 18 04:59:32 PM CST 2026
Nov 18 16:59:42 orangepi4pro helloworldd[4980]: Hello World Wed Nov 18 04:59:42 PM CST 2026
Nov 18 16:59:52 orangepi4pro helloworldd[4980]: Hello World Wed Nov 18 04:59:52 PM CST 2026
Nov 18 17:00:02 orangepi4pro helloworldd[4980]: Hello World Wed Nov 18 05:00:02 PM CST 2026
Nov 18 17:00:12 orangepi4pro helloworldd[4980]: Hello World Wed Nov 18 05:00:12 PM CST 2026
Nov 18 17:00:22 orangepi4pro helloworldd[4980]: Hello World Wed Nov 18 05:00:22 PM CST 2026
Nov 18 17:00:32 orangepi4pro helloworldd[4980]: Hello World Wed Nov 18 05:00:32 PM CST 2026
Nov 18 17:00:42 orangepi4pro helloworldd[4980]: Hello World Wed Nov 18 05:00:42 PM CST 2026
Nov 18 17:00:52 orangepi4pro helloworldd[4980]: Hello World Wed Nov 18 05:00:52 PM CST 2026
Nov 18 17:01:02 orangepi4pro helloworldd[4980]: Hello World Wed Nov 18 05:01:02 PM CST 2026
Nov 18 17:01:08 orangepi4pro systemd[1]: Stopping helloworldd.service...
Nov 18 17:01:08 orangepi4pro systemd[1]: helloworldd.service: Deactivated successfully.
Nov 18 17:01:08 orangepi4pro systemd[1]: Stopped helloworldd.service.
Nov 18 17:24:11 orangepi4pro systemd[1]: /etc/systemd/system/helloworldd.service:9: Failed to parse TimeoutStopSec=infiniy, ignoring: Invalid argument
Nov 18 17:37:19 orangepi4pro systemd[1]: Started helloworldd.service - Hello World Service.
Nov 18 17:37:19 orangepi4pro helloworldd[5764]: Hello World Wed Nov 18 05:37:19 PM CST 2026
Nov 18 17:37:29 orangepi4pro helloworldd[5764]: Hello World Wed Nov 18 05:37:29 PM CST 2026
Nov 18 17:37:39 orangepi4pro helloworldd[5764]: Hello World Wed Nov 18 05:37:39 PM CST 2026
Nov 18 17:37:49 orangepi4pro helloworldd[5764]: Hello World Wed Nov 18 05:37:49 PM CST 2026
Nov 18 17:37:59 orangepi4pro helloworldd[5764]: Hello World Wed Nov 18 05:37:59 PM CST 2026
Nov 18 17:38:00 orangepi4pro systemd[1]: Stopping helloworldd.service - Hello World Service...
Nov 18 17:38:01 orangepi4pro systemd[1]: helloworldd.service: Control process exited, code=killed, status=15/TERM
Nov 18 17:38:01 orangepi4pro systemd[1]: helloworldd.service: Failed with result 'signal'.
Nov 18 17:38:01 orangepi4pro systemd[1]: Stopped helloworldd.service - Hello World Service.
Nov 18 17:38:27 orangepi4pro systemd[1]: Started helloworldd.service - Hello World Service.
Nov 18 17:38:27 orangepi4pro helloworldd[5818]: Hello World Wed Nov 18 05:38:27 PM CST 2026
Nov 18 17:38:37 orangepi4pro helloworldd[5818]: Hello World Wed Nov 18 05:38:37 PM CST 2026
Nov 18 17:38:40 orangepi4pro systemd[1]: Stopping helloworldd.service - Hello World Service...
Nov 18 17:38:40 orangepi4pro systemd[1]: helloworldd.service: Control process exited, code=killed, status=15/TERM
Nov 18 17:38:40 orangepi4pro systemd[1]: helloworldd.service: Failed with result 'signal'.
Nov 18 17:38:40 orangepi4pro systemd[1]: Stopped helloworldd.service - Hello World Service.
Nov 18 17:51:31 orangepi4pro systemd[1]: Started helloworldd.service - Hello World Service.
Nov 18 17:51:32 orangepi4pro helloworldd[6072]: Hello World Wed Nov 18 05:51:32 PM CST 2026
Nov 18 17:51:42 orangepi4pro helloworldd[6072]: Hello World Wed Nov 18 05:51:42 PM CST 2026
Nov 18 17:51:52 orangepi4pro helloworldd[6072]: Hello World Wed Nov 18 05:51:52 PM CST 2026
Nov 18 17:52:02 orangepi4pro helloworldd[6072]: Hello World Wed Nov 18 05:52:02 PM CST 2026
Nov 18 17:52:12 orangepi4pro helloworldd[6072]: Hello World Wed Nov 18 05:52:12 PM CST 2026
Nov 18 17:52:22 orangepi4pro helloworldd[6072]: Hello World Wed Nov 18 05:52:22 PM CST 2026
Nov 18 17:52:32 orangepi4pro helloworldd[6072]: Hello World Wed Nov 18 05:52:32 PM CST 2026
Nov 18 17:52:42 orangepi4pro helloworldd[6072]: Hello World Wed Nov 18 05:52:42 PM CST 2026
Nov 18 17:52:52 orangepi4pro helloworldd[6072]: Hello World Wed Nov 18 05:52:52 PM CST 2026
Nov 18 17:53:02 orangepi4pro helloworldd[6072]: Hello World Wed Nov 18 05:53:02 PM CST 2026
Nov 18 17:53:12 orangepi4pro helloworldd[6072]: Hello World Wed Nov 18 05:53:12 PM CST 2026
Nov 18 17:53:22 orangepi4pro helloworldd[6072]: Hello World Wed Nov 18 05:53:22 PM CST 2026
Nov 18 17:53:24 orangepi4pro systemd[1]: Stopping helloworldd.service - Hello World Service...
Nov 18 17:53:24 orangepi4pro systemd[1]: helloworldd.service: Control process exited, code=killed, status=15/TERM
Nov 18 17:53:24 orangepi4pro systemd[1]: helloworldd.service: Failed with result 'signal'.
Nov 18 17:53:24 orangepi4pro systemd[1]: Stopped helloworldd.service - Hello World Service.

To see just the last 10 lines

journalctl -u helloworldd -n 10

miércoles, 8 de julio de 2026

A Vision of Web Application Security 2

  A Vision of Web Application Security  2


Configuration for a Local Web Server


  An schema where the Web Server is installed in the Local Machine require an a browser like Firefox that premit configure his proxy to point the BurpSuite proxy, use the FoxyProxy Extension in order to enable the flow to the local proxy address, in this case 127.0.0.1



The extension is added and then configured to 127.0.0.1:8080


Now we can run a web server in a Docker Container on Local Machine no test the proxy to de local server.


Test a Request to the local server, in this case http://127.0.0.1:5000



The page will wait for the response, so click on Forward till all the requests are sended. And check the history. It will come with other automatic request the firefox browser do.


To clean the output, just put a Filter on the address of interest and repeat the interception

The Result with filter



EOT

martes, 7 de julio de 2026

A Vision of Web Application Security 1

 A Vision of Web Application Security  1

To undersand the vulnerabilities of a Web Application, we need to think like an attacker do. In order to reach this, we will use a suite that works on webs applications that generates variants of the requests to simulate a normal traffic, and this suite is the burpsuite that works like a man in the middle in order to alter of modify the normal behaviour. it use a proxy configuration. The proxy configuration could be for a external server or a local server. for the local server configuration requires an extra configuration.

Normal Configuration before configure proxy




Step 1: Download and install Burpsuite

 

Once installed burpsuite, we use the proxy tab.

click on intercept on will show request that the system do to servers, some of them are automatic for telemetry and so on, and also request of our actions.


Step 2: configure the proxy setting to 127.0.0.1:8080


   Schema of Client, BurpSuite as Proxy and external Web Server

Step 3: Configure the proxy of the Firefox browser (App Proxy) and the CA Certificate

When open any website the browser responds with error



when Open any website respond with error...


Now go to http://burp to download cd CA Certificate


Go to the Administartion of certificates of the Firefox settings and add it.



 

From Now any web page can be opened in Firefox browser.

Step 4: On Tab Proxy click on intercept On , Do a Request to an external Site https://portswigger.net Click Open Browser, it will open the chrome browser,

...


...
Step 5: Now the intercept is active, the server is waiting for the request that is in brupsite proxy, to send to the server, press Forward or Forward All till all the frames finish to arrive to the server.



...
Step 6: Once finish the transaction, the history of traces are on Tab Proxy --> Tab Http History