File tree 6 files changed +68
-2
lines changed
6 files changed +68
-2
lines changed Original file line number Diff line number Diff line change @@ -14,10 +14,15 @@ python -m venv venv
14
14
# Install the requirements
15
15
pip install -r requirements.txt
16
16
17
- # Run the check script (to execute against all of our domains)
18
- ./check.bash
17
+ # Run the bulk validator script
18
+ ./z_validate sites/example.txt
19
+ ./z_validate sites/acme.txt
19
20
20
21
# Run the POC against a single URL
21
22
./poc.py -u https://samdjames.uk
23
+
24
+ # For unpatched sites, run a very BASIC compromised check (dump script srcs)
25
+ # And run a diff against old detected scripts each execution
26
+ ./z_compromise_check sites/example.txt
22
27
```
23
28
Original file line number Diff line number Diff line change 1
1
fake_useragent
2
2
requests
3
3
rich_click
4
+ beautifulsoup4
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+ from bs4 import BeautifulSoup
3
+ import requests
4
+ import sys
5
+
6
+ domain = sys .argv [1 ]
7
+ print (f"Checking: { domain } " )
8
+
9
+ response = requests .get (domain )
10
+ doc = BeautifulSoup (response .text , features = "html.parser" )
11
+
12
+ links = doc .find_all ('script' , {"src" : True })
13
+ for link in links :
14
+ if link ['src' ].startswith (domain ) == False :
15
+ print (link ['src' ])
Original file line number Diff line number Diff line change
1
+ https://www.example.com
2
+ https://www.example2.com
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -o pipefail
4
+
5
+ mkdir -p var/scripts
6
+
7
+ echo " Url Input: $1 "
8
+ [[ -z " $1 " || ! -f " $1 " ]] && echo " [!] Err: Please provide a filepath to the urls" && exit 255
9
+
10
+ for site in $( cat $1 ) ; do
11
+ FN=" var/scripts/$( echo " $site " | md5) .txt"
12
+ TMP=$( mktemp)
13
+ ./scripts.py $site | tee -a $TMP
14
+
15
+ diff $FN $TMP
16
+
17
+ if [ " $? " != " 0" ]; then
18
+ echo -e " \033[41m\033[1;37m[!!!!] CHANGE DETECTED\033[0m"
19
+ # cat $TMP | mail -s "CosmicSting Monitor - Change Detected: $site" example@example.com
20
+ fi
21
+
22
+ rm -f $FN
23
+ mv $TMP $FN
24
+ echo " "
25
+ echo " "
26
+ done
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -o pipefail
4
+
5
+ echo " Url Input: $1 "
6
+ [[ -z " $1 " || ! -f " $1 " ]] && echo " [!] Err: Please provide a filepath to the urls" && exit 255
7
+
8
+ for site in $( cat $1 ) ; do
9
+ RC=" 999"
10
+ echo " Validating: $site "
11
+ while [ " $RC " != " 0" ]; do
12
+ ./poc.py -f /etc/passwd -u $site 2> /dev/null | tail -n1
13
+ RC=" $? "
14
+ sleep 2
15
+ done
16
+ echo " "
17
+ done
You can’t perform that action at this time.
0 commit comments