Last active
March 14, 2023 23:50
-
-
Save jfeilbach/0781b1777c48a1e41bbf31a186e04fb2 to your computer and use it in GitHub Desktop.
Bash script to dump UPnP NAT entries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
url=$1 | |
soap_head=’<?xml version=”1.0” encoding=”utf-8”?><s:Envelope s:encodingStyle=”http://schemas.xmlsoap.org/soap/encoding/” xmlns:s=”http://schemas. xmlsoap.org/soap/envelope/”><s:Body><u:GetGenericPortMappingEntry xmlns:u=”urn:upnp- org:serviceId:WANIPConnection.1#GetGenericPortMappingEntry”><NewPortMappingIndex>’ soap_tail=’</NewPortMappingIndex></u:GetGenericPortMappingEntry></s:Body></ s:Envelope>’ | |
for i in `seq 1 1000`; do | |
payload=$soap_head$i$soap_tail | |
curl -H ‘Content-Type: “text/xml;charset=UTF-8”’ -H ‘SOAPACTION: “urn:schemas- | |
upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry”’ --data “$payload” “$url” | |
echo “” done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ ./brute_upnproxy.sh http://192.168.1.1:2048/etc/linuxigd/gatedesc.xml