├── assets ├── icons │ └── logo.png └── sounds │ └── hint.mp3 ├── LICENSE ├── README.md ├── install.sh └── exploit-db-notify.sh /assets/icons/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noobsec/exploit-db-notify/HEAD/assets/icons/logo.png -------------------------------------------------------------------------------- /assets/sounds/hint.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noobsec/exploit-db-notify/HEAD/assets/sounds/hint.mp3 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 noobSecurity 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Exploit-DB Notify 2 | 3 | ![exploit-db-notify](https://user-images.githubusercontent.com/25837540/73323843-5f917400-427b-11ea-9f1c-e880bbac2d56.png) 4 | 5 | Get latest Exploit Databases notification on your Desktop 6 | 7 | ### Installation 8 | 9 | #### Setup 10 | 11 | **Run as root** 12 | 13 | ```bash 14 | ~# ./install.sh 15 | ``` 16 | 17 | ### Usage 18 | 19 | Cron every 3rd hours _(recommended)_. 20 | 21 | `0 */3 * * * /opt/exploit-db-notify/exploit-db-notify` 22 | 23 | ### Legal 24 | 25 | This tool can be freely copied, modified, altered, distributed without any attribution whatsoever. However, if you feel like this tool deserves an attribution, mention it. It won't hurt anybody :) 26 | 27 | Please, read the [license terms](https://github.com/noobsec/exploit-db-notify/blob/master/LICENSE). Don't worry, it can be read in less than 30 seconds, unless you have some sort of reading disability - in that case, I'm wondering why you're still reading this text. Really. Stop. Please. I mean, seriously. Why are you still reading? 28 | 29 | ### Contributions 30 | 31 | Since this tool includes some contributions, and I'm not an asshole, I'll publically thank the following users for their help: 32 | 33 | * [@vlevit](https://github.com/vlevit) for his drop-in replacement for notify-send with more features. -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $EUID -ne 0 ]]; then 4 | echo "This script must be run as root(!)" 5 | exit 1 6 | fi 7 | 8 | MAIN_PATH="/opt/exploit-db-notify" 9 | LOCAL_BIN="/usr/local/bin" 10 | 11 | function _dlResources() { 12 | echo "Create main directory..." 13 | mkdir -p $MAIN_PATH 14 | echo "Downloading notify-send.sh..." 15 | wget -q "https://github.com/vlevit/notify-send.sh/raw/master/notify-send.sh" -O $LOCAL_BIN/notify-send 16 | wget -q "https://github.com/vlevit/notify-send.sh/raw/master/notify-action.sh" -O $LOCAL_BIN/notify-action.sh 17 | chmod 777 $LOCAL_BIN/notify-* 18 | cp -a assets/ $MAIN_PATH 19 | cp exploit-db-notify.sh $MAIN_PATH/exploit-db-notify 20 | chmod -R +x $MAIN_PATH/ 21 | } 22 | 23 | function _dependencies() { 24 | if ! [ -x "$(which jq)" ]; then 25 | JQ_OUT="/usr/local/bin/jq" 26 | echo "Downloading jq..." 27 | wget -q "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux$(getconf LONG_BIT)" -O $JQ_OUT 28 | chmod 777 $JQ_OUT 29 | else 30 | echo "jq OK!" 31 | fi 32 | 33 | if ! [ -x "$(which curl)" ]; then 34 | echo "Downloading cURL..." 35 | wget -q "https://curl.haxx.se/download/curl-7.68.0.tar.gz" -O /tmp/ 36 | tar -xf /tmp/curl-7* && cd /tmp/curl-7* 37 | echo "Installing cURL..." 38 | /./$PWD/configure && make && make install 39 | else 40 | echo "curl OK!" 41 | fi 42 | } 43 | 44 | function _setCrontab() { 45 | CRON_CURRENT="/tmp/cron.current" 46 | crontab -l > $CRON_CURRENT 47 | echo "0 */3 * * * $MAIN_PATH/exploit-db-notify" >> $CRON_CURRENT 48 | echo "Installing new crontab" 49 | crontab $CRON_CURRENT 50 | } 51 | 52 | echo "##### Installing resources #####" 53 | _dlResources 54 | echo "##### Installing dependencies #####" 55 | _dependencies 56 | # echo "##### Setting up crontab #####" 57 | # #_setCrontab # run this as user -------------------------------------------------------------------------------- /exploit-db-notify.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | MAIN_PATH=$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd) 4 | DATA_PATH="$HOME/.exploit-db-notify" 5 | 6 | function _Logger() { 7 | LOG_FILE="$DATA_PATH/notifications.log" 8 | [[ ! -f $LOG_FILE ]] && touch $LOG_FILE 9 | 10 | if [[ -z $2 ]]; then 11 | grep -q "$1" $LOG_FILE && echo "0" || echo "1" 12 | else 13 | echo "$1" >> $LOG_FILE 14 | fi 15 | } 16 | 17 | function _notify() { 18 | notify-send \ 19 | "$2" "$3 [$4] on $6 by $5" \ 20 | -i "$MAIN_PATH/assets/icons/logo.png" \ 21 | -o "View details:xdg-open https://www.exploit-db.com/exploits/$1" \ 22 | -o "Download:xdg-open https://www.exploit-db.com/download/$1" \ 23 | -o "Close:false" 24 | 25 | aplay "$MAIN_PATH/assets/sounds/hint.mp3" 26 | } 27 | 28 | function _getExploits() { 29 | [[ ! -d $DATA_PATH ]] && mkdir -p $DATA_PATH/data/ 30 | curl -s "https://www.exploit-db.com/?type=webapps&draw=3&columns%5B0%5D%5Bdata%5D=date_published&columns%5B0%5D%5Bname%5D=date_published&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=true&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=download&columns%5B1%5D%5Bname%5D=download&columns%5B1%5D%5Bsearchable%5D=false&columns%5B1%5D%5Borderable%5D=false&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=application_md5&columns%5B2%5D%5Bname%5D=application_md5&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=false&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=verified&columns%5B3%5D%5Bname%5D=verified&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=false&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=description&columns%5B4%5D%5Bname%5D=description&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=false&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=type_id&columns%5B5%5D%5Bname%5D=type_id&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=false&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=platform_id&columns%5B6%5D%5Bname%5D=platform_id&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=false&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=author_id&columns%5B7%5D%5Bname%5D=author_id&columns%5B7%5D%5Bsearchable%5D=false&columns%5B7%5D%5Borderable%5D=false&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=code&columns%5B8%5D%5Bname%5D=code.code&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=id&columns%5B9%5D%5Bname%5D=id&columns%5B9%5D%5Bsearchable%5D=false&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=9&order%5B0%5D%5Bdir%5D=desc&start=0&length=15&search%5Bvalue%5D=&search%5Bregex%5D=false&author=&port=&type=webapps&tag=&platform=" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (X11; Linux i686; rv:30.0) Gecko/20100101 Firefox/30.0" -H "Referer: https://www.exploit-db.com/?type=webapps" -o $DATA_PATH/data/exploit-db.json 31 | cat $DATA_PATH/data/exploit-db.json | jq -r '.data[] | [.id, .description[1], .type_id, .platform_id, .author_id[1], .date_published] | @tsv' | 32 | while IFS=$'\t' read -r id description type platform author date; do 33 | LOGGER="_Logger" 34 | if [[ $($LOGGER $id) -eq "1" ]]; then 35 | _notify "$id" "$description" "$type" "$platform" "$author" "$date" 36 | echo "$id $description $type $platform $author $date" 37 | $LOGGER $id 1 38 | fi 39 | done 40 | } 41 | 42 | _getExploits --------------------------------------------------------------------------------