dig @ip.socha.it tell-me-my-ip +shortOther use cases
dig @ip.socha.it ip +short dig @ip.nauka.ga ip +short dig @ip.automatus.cf ip +short dig @ip.socha.it ip TXT +short dig @ip.socha.it ip TXT +short +tcp
dig @ip.socha.it tell-me-my-ip +shortOther use cases
dig @ip.socha.it ip +short dig @ip.nauka.ga ip +short dig @ip.automatus.cf ip +short dig @ip.socha.it ip TXT +short dig @ip.socha.it ip TXT +short +tcp
curl -sf ip.socha.itor
curl -sf ip.socha.it/eol
server {
listen 80;
server_name ip.socha.it;
default_type "text/plain";
location /eol {
return 200 "$remote_addr\n";
}
location / {
return 200 $remote_addr;
}
}
curl -sf automatus.cf/private-registry | bash
mkdir registry
cd registry
mkdir {auth,default}
version: '3'
services:
gateway:
image: traefik:2.1
restart: always
command:
- "--providers.docker"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.http.address=:80"
- "--entrypoints.https.address=:443"
- "--certificatesResolvers.le.acme.httpchallenge=true"
- "--certificatesResolvers.le.acme.httpchallenge.entryPoint=http"
- "--certificatesResolvers.le.acme.storage=/acme/acme.json"
#- "--api.insecure=true"
#- "--certificatesResolvers.le.acme.caServer=https://acme-staging-v02.api.letsencrypt.org/directory"
ports:
- 80:80
- 443:443
# API
#- 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- acme:/acme
- ./auth:/auth
registry:
restart: always
image: registry:2
environment:
REGISTRY_HTTP_SECRET: change-me
labels:
- "traefik.enable=true"
- "traefik.http.routers.http.rule=Host(`hostname-change-me`)"
- "traefik.http.routers.http.entrypoints=http"
- "traefik.http.routers.https.rule=Host(`hostname-change-me`)"
- "traefik.http.routers.https.entrypoints=https"
- "traefik.http.routers.https.tls=true"
- "traefik.http.routers.https.tls.certresolver=le"
- "traefik.http.middlewares.server-header.headers.customresponseheaders.server=docker-registry"
- "traefik.http.middlewares.redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.auth.basicauth.usersFile=/auth/passwd"
- "traefik.http.middlewares.auth.basicauth.realm=REGISTRY"
- "traefik.http.routers.http.middlewares=redirect,server-header"
- "traefik.http.routers.https.middlewares=server-header,auth"
volumes:
- registry:/var/lib/registry
# Catch-all default vhost
default:
image: nginx:stable
restart: always
labels:
- "traefik.enable=true"
- "traefik.http.routers.default.rule=HostRegexp(`{default:.*}`)"
- "traefik.http.routers.default.entrypoints=http"
- "traefik.http.routers.default.priority=1"
- "traefik.http.routers.default.middlewares=server-header"
volumes:
- ./default/default.conf:/etc/nginx/conf.d/default.conf
volumes:
acme:
registry:
# vim: set tabstop=2 shiftwidth=2 expandtab autoindent indentexpr= nosmartindent :
server {
listen 80 default_server;
return 204;
}
htpasswd -c auth/passwd username >auth/passwd #or docker run --rm -it httpd:alpine htpasswd >auth/passwd
docker-compose up -d
# Genracja CA
# {hex}30030101FF => ASN.1 BasicConstraints: CA:TRUE
# $asn1=([System.Security.Cryptography.X509Certificates.X509BasicConstraintsExtension]::new($true, $flase, 0,$true)).RawData
# $asn1 | Format-Hex -Encoding Ascii
$ca_params =@{
"Type" = "Custom";
"Subject" = "CN=Local CA";
"FriendlyName" = "Local CA";
"KeyAlgorithm" = "RSA";
"KeyLength" = 2048;
"KeyUsage" = "CertSign";
"TextExtension" = @("2.5.29.19={critical}{hex}30030101FF");
"NotAfter" = ((Get-Date).AddYears(10));
"CertStoreLocation" = "Cert:\CurrentUser\My";
}
$root=New-SelfSignedCertificate @ca_params
$root.ToString()
$cert_params =@{
"Signer" = $root;
"Type" = "CodeSigningCert";
"Subject" = "CN=Robert Socha";
"FriendlyName" = "Robert Socha CS";
"KeyAlgorithm" = "RSA";
"KeyLength" = 2048;
"KeyUsage" = "DigitalSignature";
"NotAfter" = ((Get-Date).AddYears(10));
"CertStoreLocation" = "Cert:\CurrentUser\My";
}
# Generacja certyfikatu do podpisywania kodu
$code=New-SelfSignedCertificate @cert_params
$code.ToString()
# Export certifkatu CA do zaufanych
$ca_file = [System.IO.Path]::GetTempFileName()
Export-Certificate -Type CERT -Cert $root -FilePath $ca_file -Force
Import-Certificate -CertStoreLocation Cert:\CurrentUser\Root -FilePath $ca_file
# Export certyfikatu podpisującego do zaufanych dostawców kodu
Export-Certificate -Type CERT -Cert $code -FilePath $ca_file -Force
Import-Certificate -CertStoreLocation Cert:\CurrentUser\TrustedPublisher -FilePath $ca_file
Remove-Item $ca_file
# $code=(Get-ChildItem cert:\CurrentUser\my -CodeSigningCert)[0]
# Skrypt do podpisania
'Write-Host "Hello, World!"' >.\sign_me.ps1
# https:/go.microsoft.com/fwlink/?LinkID=135170
Set-ExecutionPolicy -ExecutionPolicy AllSigned -Scope CurrentUser -Force
# Wartość domyślna dla wersji kliencikich Windows
# Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope CurrentUser -Force
Set-AuthenticodeSignature .\sign_me.ps1 $code
.\sign_me.ps1
GIST
# Plik z danymi: echo "Hello, World!" >data.txt # Tworzenie zapytania openssl ts -query -data data.txt -no_nonce -sha512 -out data.tsq openssl ts -query -in data.tsq -text
Version: 1
Hash Algorithm: sha512
Message data:
0000 - 92 16 18 bc 6d 9f 80 59-43 7c 5e 03 97 b1 3f 97 ....m..YC|^...?.
0010 - 3a b7 c7 a7 b8 1f 0c a3-1b 70 bf 44 8f d8 00 a4 :........p.D....
0020 - 60 b6 7e fd a0 02 00 88-bc 97 bf 7d 9d a9 7a 9e `.~........}..z.
0030 - 2c e7 b2 0d 46 e0 66 46-2e c4 4c f6 02 84 f9 a7 ,...F.fF..L.....
Policy OID: unspecified
Nonce: unspecified
Certificate required: no
Extensions:
# Zapytanie z żądaniem certyfikatu podpisującego openssl ts -query -data data.txt -no_nonce -sha512 -cert -out data-cert.tsq openssl ts -query -in data-cert.tsq -text
Version: 1
Hash Algorithm: sha512
Message data:
0000 - 92 16 18 bc 6d 9f 80 59-43 7c 5e 03 97 b1 3f 97 ....m..YC|^...?.
0010 - 3a b7 c7 a7 b8 1f 0c a3-1b 70 bf 44 8f d8 00 a4 :........p.D....
0020 - 60 b6 7e fd a0 02 00 88-bc 97 bf 7d 9d a9 7a 9e `.~........}..z.
0030 - 2c e7 b2 0d 46 e0 66 46-2e c4 4c f6 02 84 f9 a7 ,...F.fF..L.....
Policy OID: unspecified
Nonce: unspecified
Certificate required: yes
Extensions:
# Wysyłanie zapytania do serwera
curl -s -H "Content-Type: application/timestamp-query" \
--data-binary @data.tsq \
http://time.certum.pl -o data.tsr
curl -s -H "Content-Type: application/timestamp-query" \
--data-binary @data-cert.tsq \
http://time.certum.pl -o data-cert.tsr
# Lub wykorzystując tsget
# Może być konieczna instalacja bindingów curla dla perla: apt-get install libwww-curl-perl
/usr/lib/ssl/misc/tsget -h http://time.certum.pl/ -e .tsr -v data.tsr data-cert.tsq
#> data.tsr: sending request, reply received, ./data.tsr written.
#> data-cert.tsq: sending request, reply received, ./data-cert.tsr written.
# Informację na temat odpowiedzi
openssl ts -reply -in data.tsr -text
Plik odpowiedzi. Dla pliku data-cert.tsr wygląda tak samo (różni się tylko rozmiar pliku)
Status info:
Status: Granted.
Status description: unspecified
Failure info: unspecified
TST info:
Version: 1
Policy OID: 1.2.616.1.113527.2.5.1.11
Hash Algorithm: sha512
Message data:
0000 - 92 16 18 bc 6d 9f 80 59-43 7c 5e 03 97 b1 3f 97 ....m..YC|^...?.
0010 - 3a b7 c7 a7 b8 1f 0c a3-1b 70 bf 44 8f d8 00 a4 :........p.D....
0020 - 60 b6 7e fd a0 02 00 88-bc 97 bf 7d 9d a9 7a 9e `.~........}..z.
0030 - 2c e7 b2 0d 46 e0 66 46-2e c4 4c f6 02 84 f9 a7 ,...F.fF..L.....
Serial number: 0x038D7EAE927662
Time stamp: Jan 25 00:17:48 2019 GMT
Accuracy: 0x01 seconds, unspecified millis, unspecified micros
Ordering: no
Nonce: unspecified
TSA: DirName:/C=PL/O=Unizeto Technologies S.A./OU=Certum Certification Authority/CN=Certum EV TSA SHA2
Extensions:
Pobieramy certyfikaty CA i pośredni (wymagany dla pliku data.tsr) z tej strony: https://www.certum.pl/pl/wsparcie/cert_wiedza_zaswiadczenia_klucze_certum/
wget https://www.certum.pl/CTNCA.pem wget https://www.certum.pl/pl/upload_module/wysiwyg/zaswiadczenia/Certum_EV_TSA_SHA2/TSA-SHA2.pem # Weryfikacja # Odpowiedź z certyfikatem klucza podpisującego openssl ts -verify -data data.txt -in data-cert.tsr -CAfile CTNCA.pem # Odpowiedź bez certyfikatów openssl ts -verify -data data.txt -in data.tsr -CAfile CTNCA.pem -untrusted TSA-SHA2.pem
bonding/etc/modprobe.d/bonding.conf:
options bonding max_bonds=0/etc/sysconfig/network-scripts/ifcfg-host0:
NAME="host0" DEVICE="host0" NM_CONTROLLED=no ONBOOT=yes USERCTL=no TYPE=Ethernet BOOTPROTO=none BONDING_OPTS="mode=802.3ad lacp_rate=slow miimon=250 xmit_hash_policy=layer2+3" DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=no IPADDR=192.168.1.1 PREFIX=31 GATEWAY=192.168.1.0/etc/sysconfig/network-scripts/ifcfg-eno1:
NAME=eno1 DEVICE=eno1 TYPE=Ethernet USERCTL=no SLAVE=yes MASTER=host0 BOOTPROTO=none ONBOOT=yes NM_CONTROLLED=no/etc/sysconfig/network-scripts/ifcfg-eno2:
NAME=eno2 DEVICE=eno2 TYPE=Ethernet USERCTL=no SLAVE=yes MASTER=host0 BOOTPROTO=none ONBOOT=yes NM_CONTROLLED=no
apt-get install vlan ifensalve/etc/modules:
bonding/etc/modprobe.d/bonding.conf:
options bonding max_bonds=0/etc/network/interfaces:
auto host0
iface host0 inet static
address 192.168.1.2
netmask 255.255.255.248
gateway 192.168.1.1
bond-slaves eno1 eno2
bond-mode 802.3ad
bond-miimon 250
bond-xmit-hash-policy layer2+3