可以批量放入多个url:web.txt 放入你的目标
dirok.txt 是结果。
例如有一个路径或者多个目标需要提取所有目录路径:
http://www.baidu.com/abc/123/aaa/bbb/ccc/login.jsp
需要等到结果是:
http://www.baidu.com/abc/123/aaa/bbb/ccc\
http://www.baidu.com/abc/123/aaa/bbb\
http://www.baidu.com/abc/123/aaa\
http://www.baidu.com/abc/123\
http://www.baidu.com/abc\
http://www.baidu.com\
http:/\
http:\
用途:以前扫后门有用
现在:扫目录有用,资产少需要看的很深的时候批量rce跑有用,
文件如下:
用法:python38 批量提取目录.py
x.bat内容:
@echo off>tteemm
set f=web.txt
for /f "delims=" %%a in ('findstr "\/" "%f%"'
)do set n=1&set h=%%a&call :y
move tteemm "%f%"
echo Ok&ping -n 2 127.1>nul
exit
:y
call set m=%%h:~-%n%,1%%
if not "%m%"=="/" set/a n+=1&goto y
call echo.%%h:~,-%n%%%\>>tteemm&goto :eof
批量提取目录.py内容:
import subprocess
a1 = "x.bat"
a2 = "copy web.txt 2.txt"
a3 = "x.bat"
a4 = "copy web.txt 3.txt"
a5 = "x.bat"
a6 = "copy web.txt 4.txt"
a7 = "x.bat"
a8 = "copy web.txt 5.txt"
a9 = "x.bat"
a10 = "copy web.txt 6.txt"
a11 = "x.bat"
a12 = "copy web.txt 7.txt"
a13 = "x.bat"
a14 = "copy web.txt 8.txt"
a15 = "x.bat"
a16 = "copy web.txt 9.txt"
a17 = "x.bat"
a18 = "copy web.txt 10.txt"
a19 = "x.bat"
a20 = "copy web.txt 11.txt"
a21 = "copy *.txt dirok.txt"
a22 = "del /s 2.txt & del /s 3.txt& del /s 4.txt& del /s 5.txt& del /s 6.txt& del /s 7.txt& del /s 8.txt& del /s 9.txt& del /s 10.txt& del /s 11.txt"
def main():
p1 = subprocess.Popen(a1, shell=True)
print(p1.wait())
p2 = subprocess.Popen(a2, shell=True)
print(p2.wait())
p3 = subprocess.Popen(a3, shell=True)
print(p3.wait())
p4 = subprocess.Popen(a4, shell=True)
print(p4.wait())
p5 = subprocess.Popen(a5, shell=True)
print(p5.wait())
p6 = subprocess.Popen(a6, shell=True)
print(p6.wait())
p7 = subprocess.Popen(a7, shell=True)
print(p7.wait())
p8 = subprocess.Popen(a8, shell=True)
print(p8.wait())
p9 = subprocess.Popen(a9, shell=True)
print(p9.wait())
p10 = subprocess.Popen(a10, shell=True)
print(p10.wait())
p11 = subprocess.Popen(a11, shell=True)
print(p11.wait())
p12 = subprocess.Popen(a12, shell=True)
print(p12.wait())
p13 = subprocess.Popen(a13, shell=True)
print(p13.wait())
p14 = subprocess.Popen(a14, shell=True)
print(p14.wait())
p15 = subprocess.Popen(a15, shell=True)
print(p15.wait())
p16 = subprocess.Popen(a16, shell=True)
print(p16.wait())
p17 = subprocess.Popen(a17, shell=True)
print(p17.wait())
p18 = subprocess.Popen(a18, shell=True)
print(p18.wait())
p19 = subprocess.Popen(a19, shell=True)
print(p19.wait())
p20 = subprocess.Popen(a20, shell=True)
print(p20.wait())
p21 = subprocess.Popen(a21, shell=True)
print(p21.wait())
p22 = subprocess.Popen(a22, shell=True)
print(p22.wait())
if __name__ == '__main__':
main()