Skip to content

Commit e766d8f

Browse files
authored
Add files via upload
1 parent 0e6d8cb commit e766d8f

File tree

6 files changed

+663
-0
lines changed

6 files changed

+663
-0
lines changed

autoSCP.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/sh
2+
3+
#meant to be used in a cron job to upload all files in a specific folder when the system connects to a wireless network
4+
5+
# redirect all output into a logfile
6+
exec 1>> /home/pi/test.log 2>&1
7+
8+
#TODO:Add ability for user to specify folders & IP & port & username
9+
PORT=22
10+
IP='10.10.10.10'
11+
localFolder='./'
12+
remoteFolder='/'
13+
USER='kali'
14+
15+
case "$1" in
16+
wlan0)
17+
case "$2" in
18+
CONNECTED)
19+
# do stuff on connect with wlan0
20+
echo wlan0 connected
21+
# copy all files to remote system with SCP
22+
scp -rP $PORT $localFolder $USER@$IP:$remoteFolder
23+
#turn wireless off after successful transfer?
24+
;;
25+
DISCONNECTED)
26+
# do stuff on disconnect with wlan0
27+
echo wlan0 disconnected
28+
# sudo motion stop
29+
# sudo service motion stop
30+
;;
31+
*)
32+
>&2 echo empty or undefined event for wlan0: "$2"
33+
exit 1
34+
;;
35+
esac
36+
;;
37+
38+
wlan1)
39+
case "$2" in
40+
CONNECTED)
41+
# do stuff on connect with wlan1
42+
echo wlan1 connected
43+
;;
44+
DISCONNECTED)
45+
# do stuff on disconnect with wlan1
46+
echo wlan1 disconnected
47+
;;
48+
*)
49+
>&2 echo empty or undefined event for wlan1: "$2"
50+
exit 1

install-apps.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
#---------------------------------------------------------------------------------------------------
4+
# Add Kali repository to /etc/apt/sources.list /
5+
#---------------------------------------------------------------------------------------------------
6+
7+
echo deb http://http.kali.org/kali kali-rolling main non-free contrib >> /etc/apt/sources.list
8+
9+
#--------------------------------------------------------------------------------------------------
10+
# Update sources /
11+
#--------------------------------------------------------------------------------------------------
12+
13+
apt update -y
14+
apt upgrade -y
15+
16+
#-------------------------------------------------------------------------------------------------
17+
# Install apps /
18+
#-------------------------------------------------------------------------------------------------
19+
20+
apt install -y \
21+
terminator \
22+
ftp \
23+
exiftool \
24+
hurl \
25+
veil \
26+
kali-linux-sdr \
27+
gpsd gpsd-clients \

ipaddr.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
ifconfig | grep "inet " | cut -d" " -f2

list.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
3+
4+
echo "Hello, what is your name?"
5+
#take user input for thier name
6+
read name
7+
echo "Hello $name, nice to meet you!"
8+
echo ""
9+
10+
#This next part gets the directory to enumerate from either the -
11+
#command arument, or from user input. Defaults to command variable.
12+
13+
echo "This script gets a count of the files in a directory."
14+
if [ $1 ]
15+
then
16+
dir=$1
17+
else
18+
echo "What directory do you want to enumerate?"
19+
read dir
20+
fi
21+
count=$(ls $dir | wc -l)
22+
echo $count
23+
echo "Would you like to get a count of all subdirectories also?"
24+
echo "Type y or n"
25+
26+
read -p "y/n >" choice
27+
28+
if [ choice==y ]
29+
then
30+
echo "Results may be inaccurate without Admin rights"
31+
dirout=$(ls -R $dir 2>/dev/null | wc -l)
32+
echo $dirout
33+
else
34+
echo "Shutting down..."
35+
fi
36+
37+
echo "Would you like to add the listing of another directory?"
38+
read -p "y/n >" choice2
39+
40+
if [ choice2==y ]
41+
then
42+
echo "What directory would you like to add?"
43+
read dir2
44+
dirout2=$(ls $dir2 | wc -l)
45+
sum=$(( $dirout + $dirout2 ))
46+
echo "the sum is $sum"
47+
else
48+
echo "Good Bye!"
49+
fi

menu.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
3+
if_function() {
4+
5+
#list all of the interfaces and print the IPv4 for each one that is up
6+
iflist=$(ifconfig -l)
7+
8+
for iface in $iflist
9+
do
10+
ipcheck=$(ifconfig $iface | grep "inet " | cut -d" " -f2)
11+
if [ -n "$ipcheck" ]
12+
then
13+
echo "The interface is called: $iface and it's IP is:"
14+
echo $ipcheck
15+
fi
16+
done
17+
}
18+
19+
20+
while [ true ]
21+
do
22+
#Print out menu choices
23+
echo "What command would you like to run?"
24+
echo ""
25+
echo "1) ifconfig"
26+
echo "2) df -h"
27+
echo "3) exit"
28+
echo ""
29+
30+
#get users choice
31+
read -p '[1-3]: ' choice
32+
33+
#depending on user's choice, run the command
34+
case "$choice" in
35+
1)
36+
if_function
37+
;;
38+
2)
39+
df -h
40+
;;
41+
3)
42+
break
43+
;;
44+
esac
45+
46+
done
47+
echo "We are done! Good Bye!"
48+
exit 0

0 commit comments

Comments
 (0)