Advertisement
Mr_hEx

RTSP Fuzzing path !

Aug 11th, 2024 (edited)
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.33 KB | None | 0 0
  1. #https://github.com/nmap/nmap/blob/master/nselib/data/rtsp-urls.txt
  2. import socket
  3. import time
  4.  
  5. def fuzzer(ip, port, paths):
  6.     for path in paths:
  7.         try:
  8.             req = f"DESCRIBE rtsp://{ip}:{port}{path} RTSP/1.0\r\nCSeq: 2\r\n\r\n"
  9.             req = req.encode('ascii')  # Convert the string to bytes
  10.            
  11.             s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  12.             s.settimeout(5)  # Set a timeout of 5 seconds
  13.             s.connect((ip, port))
  14.             s.sendall(req)
  15.            
  16.             data = s.recv(1024)
  17.             response = data.decode('ascii', errors='ignore')  # Decode the received bytes to string
  18.            
  19.             print(f"Path: {path}")
  20.             print(response)
  21.             print("-" * 50)
  22.            
  23.         except socket.timeout:
  24.             print(f"Path: {path}")
  25.             print("Connection timed out")
  26.             print("-" * 50)
  27.         except Exception as e:
  28.             print(f"Path: {path}")
  29.             print(f"Error: {str(e)}")
  30.             print("-" * 50)
  31.         finally:
  32.             s.close()
  33.        
  34.         time.sleep(1)  # Add a 1-second delay between requests
  35.  
  36. # List of paths to fuzz
  37. paths = [
  38.     "/",
  39.     "/0",
  40.     "/0/video1",
  41.     "/1",
  42.     "/1.AMP",
  43.     "/1/1:1/main",
  44.     "/1/cif",
  45.     "/1/stream1",
  46.     "/11",
  47.     "/12",
  48.     "/4",
  49.     "/CAM_ID.password.mp2",
  50.     "/CH001.sdp",
  51.     "/GetData.cgi",
  52.     "/H264",
  53.     "/HighResolutionVideo",
  54.     "/HighResolutionvideo",
  55.     "/Image.jpg",
  56.     "/LowResolutionVideo",
  57.     "/MJPEG.cgi",
  58.     "/MediaInput/h264",
  59.     "/MediaInput/h264/stream_1",
  60.     "/MediaInput/mpeg4",
  61.     "/ONVIF/MediaInput",
  62.     "/ONVIF/channel1",
  63.     "/PSIA/Streaming/channels/0?videoCodecType=H.264",
  64.     "/PSIA/Streaming/channels/1",
  65.     "/PSIA/Streaming/channels/1?videoCodecType=MPEG4",
  66.     "/PSIA/Streaming/channels/h264",
  67.     "/Possible",
  68.     "/ROH/channel/11",
  69.     "/Streaming/Channels/1",
  70.     "/Streaming/Channels/101",
  71.     "/Streaming/Channels/102",
  72.     "/Streaming/Channels/103",
  73.     "/Streaming/Channels/2",
  74.     "/Streaming/Unicast/channels/101",
  75.     "/Streaming/channels/101",
  76.     "/Video?Codec=MPEG4&Width=720&Height=576&Fps=30",
  77.     "/VideoInput/1/h264/1",
  78.     "/access_code",
  79.     "/access_name_for_stream_1_to_5",
  80.     "/av0_0",
  81.     "/av0_1",
  82.     "/av2",
  83.     "/avn=2",
  84.     "/axis-media/media.amp",
  85.     "/axis-media/media.amp?videocodec=h264&resolution=640x480",
  86.     "/cam",
  87.     "/cam/realmonitor",
  88.     "/cam/realmonitor?channel=1&subtype=00",
  89.     "/cam/realmonitor?channel=1&subtype=01",
  90.     "/cam/realmonitor?channel=1&subtype=1",
  91.     "/cam0_0",
  92.     "/cam0_1",
  93.     "/cam1/h264",
  94.     "/cam1/h264/multicast",
  95.     "/cam1/mjpeg",
  96.     "/cam1/mpeg4",
  97.     "/cam1/onvif-h264",
  98.     "/cam4/mpeg4",
  99.     "/camera.stm",
  100.     "/cgi-bin/viewer/video.jpg?resolution=640x480",
  101.     "/ch0",
  102.     "/ch0.h264",
  103.     "/ch001.sdp",
  104.     "/ch01.264",
  105.     "/ch0_0.h264",
  106.     "/ch0_unicast_firststream",
  107.     "/ch0_unicast_secondstream",
  108.     "/channel1",
  109.     "/dms.jpg",
  110.     "/dms?nowprofileid=2",
  111.     "/h264",
  112.     "/h264.sdp",
  113.     "/h264/ch1/sub/",
  114.     "/h264/media.amp",
  115.     "/h264Preview_01_main",
  116.     "/h264Preview_01_sub",
  117.     "/h264_vga.sdp",
  118.     "/image.jpg",
  119.     "/image.mpg",
  120.     "/image/jpeg.cgi",
  121.     "/img/media.sav",
  122.     "/img/video.asf",
  123.     "/img/video.sav",
  124.     "/ioImage/1",
  125.     "/ipcam.sdp",
  126.     "/ipcam/stream.cgi?nowprofileid=2",
  127.     "/ipcam_h264.sdp",
  128.     "/jpg/image.jpg?size=3",
  129.     "/live",
  130.     "/live.sdp",
  131.     "/live/av0",
  132.     "/live/ch0",
  133.     "/live/ch00_0",
  134.     "/live/ch00_1",
  135.     "/live/ch1",
  136.     "/live/ch2",
  137.     "/live/h264",
  138.     "/live/mpeg4",
  139.     "/live0.264",
  140.     "/live1.264",
  141.     "/live1.sdp",
  142.     "/live2.sdp",
  143.     "/live3.sdp",
  144.     "/live_h264.sdp",
  145.     "/live_mpeg4.sdp",
  146.     "/livestream",
  147.     "/livestream/",
  148.     "/media",
  149.     "/media.amp",
  150.     "/media/media.amp",
  151.     "/media/video1",
  152.     "/media/video2",
  153.     "/media/video3",
  154.     "/medias1",
  155.     "/mjpeg.cgi",
  156.     "/mjpeg/media.smp",
  157.     "/mp4",
  158.     "/mpeg4",
  159.     "/mpeg4/1/media.amp",
  160.     "/mpeg4/media.amp",
  161.     "/mpeg4/media.amp?resolution=640x480",
  162.     "/mpeg4/media.smp",
  163.     "/mpeg4cif",
  164.     "/mpeg4unicast",
  165.     "/mpg4/rtsp.amp",
  166.     "/multicaststream",
  167.     "/now.mp4",
  168.     "/nph-h264.cgi",
  169.     "/nphMpeg4/g726-640x",
  170.     "/nphMpeg4/g726-640x480",
  171.     "/nphMpeg4/nil-320x240",
  172.     "/onvif-media/media.amp",
  173.     "/onvif/live/2",
  174.     "/onvif1",
  175.     "/onvif2",
  176.     "/play1.sdp",
  177.     "/play2.sdp",
  178.     "/profile",
  179.     "/recognizer",
  180.     "/rtpvideo1.sdp",
  181.     "/rtsp_tunnel",
  182.     "/rtsph264",
  183.     "/rtsph2641080p",
  184.     "/stream1",
  185.     "/stream2",
  186.     "/streaming/mjpeg",
  187.     "/synthesizer",
  188.     "/tcp/av0_0",
  189.     "/ucast/11",
  190.     "/unicast/c1/s1/live",
  191.     "/user.pin.mp2",
  192.     "/user_defined",
  193.     "/video",
  194.     "/video.3gp",
  195.     "/video.cgi",
  196.     "/video.cgi?resolution=VGA",
  197.     "/video.cgi?resolution=vga",
  198.     "/video.h264",
  199.     "/video.mjpg",
  200.     "/video.mp4",
  201.     "/video.pro1",
  202.     "/video.pro2",
  203.     "/video.pro3",
  204.     "/video/mjpg.cgi",
  205.     "/video1",
  206.     "/video1+audio1",
  207.     "/video2.mjpg",
  208.     "/videoMain",
  209.     "/videoinput_1:0/h264_1/onvif.stm",
  210.     "/videostream.cgi?rate=0",
  211.     "/vis",
  212.     "/wfov",
  213.     "/user=admin_password=tlJwpbo6_channel=1_stream=0.sdp?real_stream"
  214. ]
  215.  
  216.  
  217. # Usage
  218. ip = "10.0.52.5"
  219. port = 554
  220.  
  221. fuzzer(ip, port, paths)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement