mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-01 20:42:11 +00:00
nsa gen is no more, offline alternative
This commit is contained in:
parent
51e8dc1aca
commit
6549f8f582
4 changed files with 5873 additions and 9 deletions
|
@ -15,11 +15,11 @@ myPFXPATH="/root/tpot/keys/8021x.pfx"
|
||||||
myPFXPWPATH="/root/tpot/keys/8021x.pw"
|
myPFXPWPATH="/root/tpot/keys/8021x.pw"
|
||||||
myPFXHOSTIDPATH="/root/tpot/keys/8021x.id"
|
myPFXHOSTIDPATH="/root/tpot/keys/8021x.id"
|
||||||
myBACKTITLE="T-Pot-Installer"
|
myBACKTITLE="T-Pot-Installer"
|
||||||
mySITES="https://index.docker.io https://github.com http://nsanamegenerator.com https://pypi.python.org https://ubuntu.com"
|
mySITES="https://index.docker.io https://github.com https://pypi.python.org https://ubuntu.com"
|
||||||
myPROGRESSBOXCONF=" --backtitle "$myBACKTITLE" --progressbox 24 80"
|
myPROGRESSBOXCONF=" --backtitle "$myBACKTITLE" --progressbox 24 80"
|
||||||
|
|
||||||
fuRANDOMWORD () {
|
fuRANDOMWORD () {
|
||||||
local myWORDFILE=/usr/share/dict/names
|
local myWORDFILE="$1"
|
||||||
local myLINES=$(cat $myWORDFILE | wc -l)
|
local myLINES=$(cat $myWORDFILE | wc -l)
|
||||||
local myRANDOM=$((RANDOM % $myLINES))
|
local myRANDOM=$((RANDOM % $myLINES))
|
||||||
local myNUM=$((myRANDOM * myRANDOM % $myLINES + 1))
|
local myNUM=$((myRANDOM * myRANDOM % $myLINES + 1))
|
||||||
|
@ -341,12 +341,9 @@ addgroup --gid 2000 tpot 2>&1 | dialog --title "[ Adding new user ]" $myPROGRESS
|
||||||
adduser --system --no-create-home --uid 2000 --disabled-password --disabled-login --gid 2000 tpot 2>&1 | dialog --title "[ Adding new user ]" $myPROGRESSBOXCONF
|
adduser --system --no-create-home --uid 2000 --disabled-password --disabled-login --gid 2000 tpot 2>&1 | dialog --title "[ Adding new user ]" $myPROGRESSBOXCONF
|
||||||
|
|
||||||
# Let's set the hostname
|
# Let's set the hostname
|
||||||
myHOST=$(curl -s -f www.nsanamegenerator.com | html2text | tr A-Z a-z | awk '{print $1}')
|
a=$(fuRANDOMWORD /usr/share/dict/a.txt)
|
||||||
if [ "$myHOST" = "" ];
|
n=$(fuRANDOMWORD /usr/share/dict/n.txt)
|
||||||
then
|
myHOST=$a$n
|
||||||
dialog --no-ok --no-cancel --backtitle "$myBACKTITLE" --title "[ Failed to fetch name from remote, using local cache ]" --pause "" 6 80 2
|
|
||||||
myHOST=$(fuRANDOMWORD)
|
|
||||||
fi
|
|
||||||
hostnamectl set-hostname $myHOST 2>&1 | dialog --title "[ Setting new hostname ]" $myPROGRESSBOXCONF
|
hostnamectl set-hostname $myHOST 2>&1 | dialog --title "[ Setting new hostname ]" $myPROGRESSBOXCONF
|
||||||
sed -i 's#127.0.1.1.*#127.0.1.1\t'"$myHOST"'#g' /etc/hosts 2>&1 | dialog --title "[ Setting new hostname ]" $myPROGRESSBOXCONF
|
sed -i 's#127.0.1.1.*#127.0.1.1\t'"$myHOST"'#g' /etc/hosts 2>&1 | dialog --title "[ Setting new hostname ]" $myPROGRESSBOXCONF
|
||||||
|
|
||||||
|
|
1466
installer/usr/share/dict/a.txt
Normal file
1466
installer/usr/share/dict/a.txt
Normal file
File diff suppressed because it is too large
Load diff
4401
installer/usr/share/dict/n.txt
Normal file
4401
installer/usr/share/dict/n.txt
Normal file
File diff suppressed because it is too large
Load diff
|
@ -116,7 +116,7 @@ in-target grub-install --force $(debconf-get partman-auto/disk); \
|
||||||
in-target update-grub; \
|
in-target update-grub; \
|
||||||
cp /opt/tpot/rc.local.install /target/etc/rc.local; \
|
cp /opt/tpot/rc.local.install /target/etc/rc.local; \
|
||||||
cp -r /opt/tpot/ /target/root/; \
|
cp -r /opt/tpot/ /target/root/; \
|
||||||
cp /opt/tpot/usr/share/dict/names /target/usr/share/dict/names
|
cp /opt/tpot/usr/share/dict/* /target/usr/share/dict/
|
||||||
|
|
||||||
##########
|
##########
|
||||||
### Reboot
|
### Reboot
|
||||||
|
|
Loading…
Reference in a new issue