Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix protocol=tcp as default value for sip_packet, since that's not supported at all, and mention in the README that mr.sip uses UDP #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ apt-get install python-scapy
```
```
python3 mr.sip.py --help
python3 mr.sip.py usage
python3 mr.sip.py --usage
```

## Mr.SIP Usages:
Expand All @@ -99,7 +99,7 @@ python3 mr.sip.py --nes --tn <target_network_address> --mt=subscribe --from=<fro
NOTE-1: _<target_network_range>_ should be like `192.168.1.10-192.168.1.20` \
NOTE-2: _<target_network>_ should be like `192.168.1.0` \
NOTE-3: You can specify the output by `-i <output_file_name>`. By default the output will be written to _ip_list.txt_ file which is already exists in the repo. _SIP-ENUM_ uses that file as an input. \
NOTE-4: Default destination (--dp) is _port 5060_, if not given. \
NOTE-4: Default destination (--dp) is _port 5060_ (UDP), if not given. \
NOTE-5: Default message type (--mt=) is _options_, if not given. \
NOTE-6: Supported message types: _options_, _invite_, _subscribe_, _register_ \
NOTE-7: _from_ and _to_ values can be arbitrary extension number.
Expand All @@ -116,7 +116,8 @@ python3 mr.sip.py --enum --tn=<target_IP> --from=from.txt

NOTE-1: If target network (--tn) is not given, SIP-ENUM uses _ip_list.txt_ file as an input which is output of SIP-NES. \
NOTE-2: Default from user (--from=) is _fromUser.txt_ \
NOTE-3: Default message type (--mt) is _subscribe_, if not given.
NOTE-3: Default message type (--mt) is _subscribe_, if not given. \
NOTE-4: Only UDP is supported.

**Output of SIP-ENUM:**

Expand Down
4 changes: 3 additions & 1 deletion sip_packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class sip_packet:
"""
def __init__(self, method, server_ip, server_port,
client_ip, from_user = "", to_user = "",
user_agent = "", sp_user = "", protocol = "tcp", expire_duration=3600, wait=False):
user_agent = "", sp_user = "", protocol = "scapy", expire_duration=3600, wait=False):
self.method = method
self.protocol = protocol
self.server_ip = server_ip
Expand Down Expand Up @@ -119,6 +119,8 @@ def generate_packet(self):
pkt = IP(src=self.client_ip, dst=self.server_ip) / UDP(sport=int(self.client_port), dport=int(self.server_port)) / packet_data
send(pkt, iface=conf.iface)
return {"status": True}
else:
raise Exception('Illegal sip_packet arguments: unsupported protocol given')
except Exception as e:
# print(e)
return {"status": False}
Expand Down