get_flask_pin.py
We should be able to do this with this script, but first we need the contents of three files:
/etc/machine-id
/proc/self/cgroup
/sys/class/net/INTERFACE_NAME/address.
We discover the machine id in
/etc/machine-id 00566233196142e9961b4ea12a2bdb29
/proc/self/cgroup
12:perf_event:/ 11:freezer:/ 10:hugetlb:/ 9:rdma:/ 8:pids:/system.slice/blog.service 7:memory:/system.slice/blog.service 6:cpuset:/ 5:net_cls,net_prio:/ 4:devices:/system.slice/blog.service 3:blkio:/system.slice/blog.service 2:cpu,cpuacct:/system.slice/blog.service 1:name=systemd:/system.slice/blog.service 0::/system.slice/blog.service
The value to note here is blog.service.
Finally, we need the MAC address of the network interface. Unfortunately, we do not know the name of the interface the target is using, but we can attempt a few more frequently-used names. Eventually, we detect ens160, resolving the file of interest to be /sys/class/net/ens160/address Navigating to that address, we find the MAC address to be 00:50:56:8a:fc:e8 or 345049332968 in decimal.
Remote Code Execution Now that we have all the information needed to recreate the Flask debug PIN, we can attempt to gain remote code execution. We can recreate the PIN with a script:
Sometimes it can not work. We can try above command without /proc/self/cgroup value.
Last updated