Skip to content

Commit ac58bbd

Browse files
committed
rename SRTP decryption tool; added single password check to SIPBrute
1 parent 628cc07 commit ac58bbd

File tree

8 files changed

+44
-25
lines changed

8 files changed

+44
-25
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Read the Installation Guide in the [wiki](https://github.com/SySS-Research/WireB
1717

1818
- SaCLaC: This includes two python programs. One for spoofing fake LLDP-MED packets to getting into VoIP VLAN or trigger a DoS by instruct the client to set a VLAN-Tag and one to analyze CDP Information of a PCAP File.
1919

20-
- DecodeSRTP: This script makes it easy to use the [Cisco Systems' SRTP library](https://github.com/cisco/libsrtp) for decrypting a SRTP-SDES Stream if the AES-Key was extracted from the signalling part.
20+
- DecryptSRTP: This script makes it easy to use the [Cisco Systems' SRTP library](https://github.com/cisco/libsrtp) for decrypting a SRTP-SDES Stream if the AES-Key was extracted from the signalling part.
2121

2222
- CrackTheSIP: A simple brute force tool for cracking SIP digest authentication by using a word list.
2323

@@ -76,10 +76,10 @@ wizard > help
7676
7777
Documented commands (type help <topic>):
7878
========================================
79-
bridge evilstun lldpspoof sipcrack timeshift
80-
cdpanalyze exit rtpaudioinject sipdiscover vlanenum
81-
clear help rtpfuzz sipenum zrtpdowngrade
82-
decodesrtp lldpdos sipbrute sipfuzz
79+
bridge evilstun lldpspoof sipcrack timeshift
80+
cdpanalyze exit rtpaudioinject sipdiscover vlanenum
81+
clear help rtpfuzz sipenum zrtpdowngrade
82+
decryptsrtp lldpdos sipbrute sipfuzz
8383
```
8484

8585
## Sample Usage Video

classes.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,16 @@ def do_lldpdos(self, inp):
105105
print("Please set a valid mode")
106106

107107

108-
def do_decodesrtp(self, inp):
108+
def do_decryptsrtp(self, inp):
109109
'''If you have the AES key from the SDP crypto attribute of the signaling part, you can decrypt the SRTP-SDES stream with this tool'''
110-
tool_folder = "DecodeSRTP"
110+
tool_folder = "DecryptSRTP"
111111
print("If you have the AES key from the SDP crypto attribute of the signaling part, you can decrypt the SRTP-SDES stream with this tool")
112112
print("Sniff the RTP Stream and extract only the RTP part in a separate PCAP file")
113-
decodesrtp_keysize = input("Enter the keysize <128> or <256> [128]: ") or "128"
114-
decodesrtp_key = input("Enter the AES key base64 encoded: ")
115-
decodesrtp_infile = input("Enter the infile containing the extracted RTP stream: ")
116-
decodesrtp_outfile = input("Enter the outfile (if nothing is set the file is stored under ./tools/DecodeSRTP/): ")
117-
run_tool(tool_folder, f"decodesrtp.sh {decodesrtp_keysize} {decodesrtp_key} {decodesrtp_infile} {decodesrtp_outfile}")
113+
decryptsrtp_keysize = input("Enter the keysize <128> or <256> [128]: ") or "128"
114+
decryptsrtp_key = input("Enter the AES key base64 encoded: ")
115+
decryptsrtp_infile = input("Enter the infile containing the extracted RTP stream: ")
116+
decryptsrtp_outfile = input("Enter the outfile (if nothing is set the file is stored under ./tools/DeccryptSRTP/): ")
117+
run_tool(tool_folder, f"decryptsrtp.sh {decryptsrtp_keysize} {decryptsrtp_key} {decryptsrtp_infile} {decryptsrtp_outfile}")
118118

119119

120120
def do_cdpanalyze(self, inp):

configure.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

33
getlib(){
4-
wget -P ./tools/DecodeSRTP/ https://github.com/cisco/libsrtp/archive/master.zip
5-
unzip -d ./tools/DecodeSRTP/ ./tools/DecodeSRTP/master.zip
6-
rm ./tools/DecodeSRTP/master.zip
7-
cd ./tools/DecodeSRTP/libsrtp-master && ./configure
4+
wget -P ./tools/DecryptSRTP/ https://github.com/cisco/libsrtp/archive/master.zip
5+
unzip -d ./tools/DecryptSRTP/ ./tools/DecryptSRTP/master.zip
6+
rm ./tools/DecryptSRTP/master.zip
7+
cd ./tools/DecryptSRTP/libsrtp-master && ./configure
88
make
99
exit 1
1010
}

tools/DecodeSRTP/decodesrtp.sh renamed to tools/DecryptSRTP/decryptsrtp.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ outfile=$4
99

1010
if [ -z "$keysize" ]||[ -z "$key" ]||[ -z "$infile" ];then
1111

12-
echo "Usage: ./decodesrtp.sh <key size> <key base64 encoded> <infile pcap> <(optional) outfile>"
12+
echo "Usage: ./decryptsrtp.sh <key size> <key base64 encoded> <infile pcap> <(optional) outfile>"
1313
echo ""
1414
echo ""
1515
echo "key size = use encryption (use 128 or 256 for key size)"

tools/RTPAudioInjection/rtpaudioinject.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ def send_packet(i, payload, time):
106106
filelen = len(byte)
107107
x = 0
108108
while x < filelen:
109-
y = x+700
109+
y = x+160
110110
payload = bytearray(byte[x:y])
111111
send_packet(i, payload, time)
112112
i+=1
113-
time+=700
114-
x+=700
113+
time+=160
114+
x+=160
115115

116116

117117

tools/SIPBrute/sipbrute.py

+18-3
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@
8888
help="The username for password brute force"
8989
)
9090

91+
parser.add_argument(
92+
'--pw',
93+
dest="PASSWORD",
94+
type=str,
95+
default=None,
96+
help="The password to test. If a password is given, the wordlist parameter will be ignored."
97+
)
98+
99+
91100
parser.add_argument(
92101
'-v',
93102
action='store_true',
@@ -180,7 +189,7 @@ def calc_auth(response, password, callid, branch):
180189

181190

182191
def get_results(response):
183-
192+
184193
if bytes('401 Unauthorized', 'utf-8') in response:
185194
return("401")
186195

@@ -197,13 +206,17 @@ def get_results(response):
197206
return("403")
198207

199208
else:
200-
print("\033[1;34m[*]\033[0m Unexpected response")
209+
print("\033[1;31m[!]\033[0m Unexpected response. Exiting ...")
201210
sys.exit(0)
202211

203212

204213
def main():
205214

206-
lines = [line.rstrip('\n') for line in open(args.WORDLIST)]
215+
if args.PASSWORD is None:
216+
lines = [line.rstrip('\n') for line in open(args.WORDLIST)]
217+
else:
218+
lines = []
219+
lines.append(args.PASSWORD)
207220

208221
i = 0
209222

@@ -259,6 +272,8 @@ def main():
259272

260273
else:
261274
sock.close()
275+
print("\033[1;31m[!]\033[0m Unexpected response. Exiting ...")
276+
sys.exit(0)
262277

263278
except (KeyboardInterrupt):
264279
print("\033[1;34m[*]\033[0m User interruption. Exiting ...")

tools/SIPDiscover/sipdiscover.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def main():
133133
elif args.PROTOCOL == "tls":
134134
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
135135
sock = ssl.wrap_socket(sock, ssl_version=ssl.PROTOCOL_TLSv1_2, keyfile=args.KEY, certfile=args.CRT)
136-
136+
137137
else:
138138
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
139139

@@ -204,8 +204,12 @@ def main():
204204

205205
except (KeyboardInterrupt):
206206
print("\033[1;34m[*]\033[0m User interruption. Exiting ...")
207+
sock.close()
207208
sys.exit(0)
208209

210+
except:
211+
sock.close()
212+
209213

210214
if __name__ == "__main__":
211215
main()

tools/VlanEnum/dhclient.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ timeout 3;
1010
initial-interval 1;
1111

1212
lease {
13-
interface "eth0.1";
13+
interface "eth0.120";
1414
fixed-address 169.254.0.1;
1515
option subnet-mask 255.255.255.254;
1616
renew 0 2000/01/01 00:00:01; # but force immediate renewal to return to DHCP server when coming back online

0 commit comments

Comments
 (0)