Changed the purpose of the repo

Changed from k4li -> currency project
This commit is contained in:
Yamozha 2021-02-03 17:28:43 +02:00
parent c0b4a23c06
commit 1f543cae6f
11 changed files with 91 additions and 262 deletions

21
LICENSE
View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2021 Yamozha
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,13 +0,0 @@
K4l1.p1
#######
So the idea for now is to write software scripts that execute on run and then write it in a .img file so that we can directly flash any given raspi with our software.
For now we only need to write software like the following(you can add if you want):
* Wifi hotspot initiation(for SSH control)
* Airgeddon shenanigans(like MiTM, Handshake Capture, Packet Sniffing)
* Maybe a discord bot for status(or ssh forwarding)
* VERY IMPORTANT: self-destruction trigger
* Maybe bluetooth sniffing
* Keylogger(using the atmega chip on the raspi)
* KeyInjection/RubberDucking (using the same chip)

1
Server/currency.txt Normal file
View File

@ -0,0 +1 @@
6969

25
Server/websocketServer.py Normal file
View File

@ -0,0 +1,25 @@
import asyncio
import websockets
import logging
logger = logging.getLogger('websockets')
logger.setLevel(logging.INFO)
logger.addHandler(logging.StreamHandler())
async def serveStuff(websocket, path):
requestText = await websocket.recv()
print(requestText)
if requestText == "STATUSONCOIN":
file = open("currency.txt","r")
currencyStatus = file.readline()
file.close()
await websocket.send(currencyStatus)
else:
await websocket.send("We don't accept DoS")
start_server = websockets.serve(serveStuff, "localhost", 8765)
asyncio.get_event_loop().run_until_complete(start_server)
asyncio.get_event_loop().run_forever()

35
Website/css/home.css Normal file
View File

@ -0,0 +1,35 @@
@import url(https://fonts.googleapis.com/css?family=Roboto:300);
:root {
--base-grid: 8px;
--colour-white: #fff;
--colour-black: #1a1a1a;
}
@viewport {
width: device-width ;
zoom: 1.0 ;
}
*,
:after,
:before {
box-sizing: border-box;
}
html {
margin: 0;
padding: 0;
background-position: 100%;
}
body {
position: absolute;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%);
top: 50%;
font-size: 1.2em;
font-family: 'Roboto', sans-serif;
line-height: 1.4;
}

14
Website/index.html Normal file
View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<link rel="stylesheet" href="css/home.css">
<link rel="stylesheet" href="http://github.hubspot.com/odometer/themes/odometer-theme-default.css">
<meta charset="utf-8">
<title>Currency site</title>
</head>
<body>
<script src="http://github.hubspot.com/odometer/odometer.js"></script>
<h1 id="odometer" class="odometer">This is where you'll see the thing</h1>
<script type="text/javascript" src="scripts/getCurrentCoins.js"></script>
</body>
</html>

View File

@ -0,0 +1,16 @@
function currencyTicker(){
var ws = new WebSocket("ws://localhost:8765/");
ws.onopen = function(){
console.log("Connection is Established");
ws.send("STATUSONCOIN");
};
ws.onmessage = function(evt) {
var received_msg = evt.data;
w = document.getElementById("odometer").innerHTML = received_msg;
};
}
currencyTicker()
var t=setInterval(currencyTicker,5000);

View File

@ -1,194 +0,0 @@
#!/bin/bash
#version 0.961-N/HS
#You may share this script on the condition a reference to RaspberryConnect.com
#must be included in copies or derivatives of this script.
#A script to switch between a wifi network and a non internet routed Hotspot
#Works at startup or with a seperate timer or manually without a reboot
#Other setup required find out more at
#http://www.raspberryconnect.com
wifidev="wlan0" #device name to use. Default is wlan0.
#use the command: iw dev ,to see wifi interface name
IFSdef=$IFS
cnt=0
#These four lines capture the wifi networks the RPi is setup to use
wpassid=$(awk '/ssid="/{ print $0 }' /etc/wpa_supplicant/wpa_supplicant.conf | awk -F'ssid=' '{ print $2 }' | sed 's/\r//g'| awk 'BEGIN{ORS=","} {print}' | sed 's/\"/''/g' | sed 's/,$//')
IFS=","
ssids=($wpassid)
IFS=$IFSdef #reset back to defaults
#Note:If you only want to check for certain SSIDs
#Remove the # in in front of ssids=('mySSID1'.... below and put a # infront of all four lines above
# separated by a space, eg ('mySSID1' 'mySSID2')
#ssids=('mySSID1' 'mySSID2' 'mySSID3')
#Enter the Routers Mac Addresses for hidden SSIDs, seperated by spaces ie
#( '11:22:33:44:55:66' 'aa:bb:cc:dd:ee:ff' )
mac=()
ssidsmac=("${ssids[@]}" "${mac[@]}") #combines ssid and MAC for checking
createAdHocNetwork()
{
echo "Creating Hotspot"
ip link set dev "$wifidev" down
ip a add 10.0.0.5/24 brd + dev "$wifidev"
ip link set dev "$wifidev" up
dhcpcd -k "$wifidev" >/dev/null 2>&1
systemctl start dnsmasq
systemctl start hostapd
}
KillHotspot()
{
echo "Shutting Down Hotspot"
ip link set dev "$wifidev" down
systemctl stop hostapd
systemctl stop dnsmasq
ip addr flush dev "$wifidev"
ip link set dev "$wifidev" up
dhcpcd -n "$wifidev" >/dev/null 2>&1
}
ChkWifiUp()
{
echo "Checking WiFi connection ok"
sleep 20 #give time for connection to be completed to router
if ! wpa_cli -i "$wifidev" status | grep 'ip_address' >/dev/null 2>&1
then #Failed to connect to wifi (check your wifi settings, password etc)
echo 'Wifi failed to connect, falling back to Hotspot.'
wpa_cli terminate "$wifidev" >/dev/null 2>&1
createAdHocNetwork
fi
}
chksys()
{
#After some system updates hostapd gets masked using Raspbian Buster, and above. This checks and fixes
#the issue and also checks dnsmasq is ok so the hotspot can be generated.
#Check Hostapd is unmasked and disabled
if systemctl -all list-unit-files hostapd.service | grep "hostapd.service masked" >/dev/null 2>&1 ;then
systemctl unmask hostapd.service >/dev/null 2>&1
fi
if systemctl -all list-unit-files hostapd.service | grep "hostapd.service enabled" >/dev/null 2>&1 ;then
systemctl disable hostapd.service >/dev/null 2>&1
systemctl stop hostapd >/dev/null 2>&1
fi
#Check dnsmasq is disabled
if systemctl -all list-unit-files dnsmasq.service | grep "dnsmasq.service masked" >/dev/null 2>&1 ;then
systemctl unmask dnsmasq >/dev/null 2>&1
fi
if systemctl -all list-unit-files dnsmasq.service | grep "dnsmasq.service enabled" >/dev/null 2>&1 ;then
systemctl disable dnsmasq >/dev/null 2>&1
systemctl stop dnsmasq >/dev/null 2>&1
fi
}
FindSSID()
{
#Check to see what SSID's and MAC addresses are in range
ssidChk=('NoSSid')
i=0; j=0
until [ $i -eq 1 ] #wait for wifi if busy, usb wifi is slower.
do
ssidreply=$((iw dev "$wifidev" scan ap-force | egrep "^BSS|SSID:") 2>&1) >/dev/null 2>&1
#echo "SSid's in range: " $ssidreply
printf '%s\n' "${ssidreply[@]}"
echo "Device Available Check try " $j
if (($j >= 10)); then #if busy 10 times goto hotspot
echo "Device busy or unavailable 10 times, going to Hotspot"
ssidreply=""
i=1
elif echo "$ssidreply" | grep "No such device (-19)" >/dev/null 2>&1; then
echo "No Device Reported, try " $j
NoDevice
elif echo "$ssidreply" | grep "Network is down (-100)" >/dev/null 2>&1 ; then
echo "Network Not available, trying again" $j
j=$((j + 1))
sleep 2
elif echo "$ssidreply" | grep "Read-only file system (-30)" >/dev/null 2>&1 ; then
echo "Temporary Read only file system, trying again"
j=$((j + 1))
sleep 2
elif echo "$ssidreply" | grep "Invalid exchange (-52)" >/dev/null 2>&1 ; then
echo "Temporary unavailable, trying again"
j=$((j + 1))
sleep 2
elif echo "$ssidreply" | grep -v "resource busy (-16)" >/dev/null 2>&1 ; then
echo "Device Available, checking SSid Results"
i=1
else #see if device not busy in 2 seconds
echo "Device unavailable checking again, try " $j
j=$((j + 1))
sleep 2
fi
done
for ssid in "${ssidsmac[@]}"
do
if (echo "$ssidreply" | grep -F -- "$ssid") >/dev/null 2>&1
then
#Valid SSid found, passing to script
echo "Valid SSID Detected, assesing Wifi status"
ssidChk=$ssid
return 0
else
#No Network found, NoSSid issued"
echo "No SSid found, assessing WiFi status"
ssidChk='NoSSid'
fi
done
}
NoDevice()
{
#if no wifi device,ie usb wifi removed, activate wifi so when it is
#reconnected wifi to a router will be available
echo "No wifi device connected"
wpa_supplicant -B -i "$wifidev" -c /etc/wpa_supplicant/wpa_supplicant.conf >/dev/null 2>&1
exit 1
}
chksys
FindSSID
#Create Hotspot or connect to valid wifi networks
if [ "$ssidChk" != "NoSSid" ]
then
if systemctl status hostapd | grep "(running)" >/dev/null 2>&1
then #hotspot running and ssid in range
KillHotspot
echo "Hotspot Deactivated, Bringing Wifi Up"
wpa_supplicant -B -i "$wifidev" -c /etc/wpa_supplicant/wpa_supplicant.conf >/dev/null 2>&1
ChkWifiUp
elif { wpa_cli -i "$wifidev" status | grep 'ip_address'; } >/dev/null 2>&1
then #Already connected
echo "Wifi already connected to a network"
else #ssid exists and no hotspot running connect to wifi network
echo "Connecting to the WiFi Network"
wpa_supplicant -B -i "$wifidev" -c /etc/wpa_supplicant/wpa_supplicant.conf >/dev/null 2>&1
ChkWifiUp
fi
else #ssid or MAC address not in range
if systemctl status hostapd | grep "(running)" >/dev/null 2>&1
then
echo "Hostspot already active"
elif { wpa_cli status | grep "$wifidev"; } >/dev/null 2>&1
then
echo "Cleaning wifi files and Activating Hotspot"
wpa_cli terminate >/dev/null 2>&1
ip addr flush "$wifidev"
ip link set dev "$wifidev" down
rm -r /var/run/wpa_supplicant >/dev/null 2>&1
createAdHocNetwork
else #"No SSID, activating Hotspot"
createAdHocNetwork
fi
fi

View File

@ -1,19 +0,0 @@
#2.4GHz setup wifi 80211 b,g,n
interface=wlan0
driver=nl80211
ssid=Pesho's IPhone
hw_mode=g
channel=8
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=youfinnagetpwned
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP TKIP
rsn_pairwise=CCMP
country_code=BG
ieee80211n=1
ieee80211d=1

View File

@ -1,12 +0,0 @@
# run this script with sudo
# https://www.raspberryconnect.com/projects/65-raspberrypi-hotspot-accesspoints/158-raspberry-pi-auto-wifi-hotspot-switch-direct-connection
apt-get -Y install hostapd
apt-get -Y install dnsmasq
systemctl unmask hostapd
systemctl disable hostapd
systemctl disable dnsmasq
mv hotspot.conf /etc/hostapd/hostapd.conf
chmod +x autohotspot
mv autohotspot /usr/bin/autohotspot
(crontab -l 2>/dev/null; echo "*/5 * * * * sudo /usr/bin/autohotspot >/dev/null 2>&1") | crontab -e

View File

@ -1,3 +0,0 @@
import subprocess
print("This is an init script")