I work at a r2 company and we have very strict procedures for gathering data and wipeing data
I created some scripts to help me along but it feel like i just got my feet wet.
I want to get involved in a community that can help me learn or show me better ways to do things
below im going to attach my files ive worte so far let me know what yall think and ways to improve
or brainstorm ideas or how i could have don something better
First script
Code: Select all
@echo off
WMIC CSPRODUCT GET NAME > MODEL.TXT
for /f "DELIMS=" %%i in ('MORE MODEL.txt') do set model="%%i"
DEL MODEL.TXT
md %Model%
cd %model%
wmic diskdrive get size > HARDRIVESIZE.TXT
systeminfo | findstr /C:"Total Physical Memory" > MEMSIZE.TXT
WMIC CSPRODUCT GET NAME > MODEL.TXT
wmic cpu get NAME > CPU.TXT
WMIC BIOS GET SERIALNUMBER > SERIAL.TXT
for /f "delims=" %%i in ('more HARDRIVESIZE.txt') do set hdsize=%%i
for /f "DELIMS=" %%i in ('MORE MEMSIZE.txt') do set MEM=%%i
for /f "DELIMS=" %%i in ('MORE MODEL.txt') do set MODeL=%%i
for /F "DELIMS=" %%i in ('MORE CPU.txt') do set CPU=%%i
for /F "DELIMS=" %%i in ('MORE SERIAL.txt') do set SERIAL=%%i
setlocal enabledelayedexpansion
set obj[0].desc=model
set obj[0].size=%model%
set obj[1].desc=serial
set obj[1].size=%SERIAL%
set obj[2].desc=cpu
set obj[2].size=%CPU%
set obj[3].desc=memory
set obj[3].size=%MEM%
set obj[4].desc=hardrive
set obj[4].size=%HDSIZE%
for /l %%i in (0 1 4) do (
call echo %%obj[%%i].desc%%
call echo %%obj[%%i].size%%
) >> info.txt
ECHO " <!DOCTYPE html>" >> info.HTML
ECHO " <html>" >> info.HTML
ECHO " <body>" >> info.HTML
ECHO " <h2>%model% info</h2>" >> info.HTML
ECHO " <table style="width:100%">" >> info.HTML
ECHO " <td></td>" >> info.HTML
ECHO " <tr>" >> info.HTML
ECHO " </tr>" >> info.HTML
ECHO " <td></td>" >> info.HTML
ECHO " <tr>" >> info.HTML
ECHO " <th></th>" >> info.HTML
ECHO " <th></th>" >> info.HTML
ECHO " </tr>" >> info.HTML
ECHO " <td></td>" >> info.HTML
ECHO " <tr>" >> info.HTML
ECHO " </tr>" >> info.HTML
ECHO " <td></td>" >> info.HTML
ECHO "<tr>" >> info.HTML
ECHO "<td>Serial:</td>" >> info.HTML
ECHO "<td>%serial%</td>" >> info.HTML
ECHO "<td></td>" >> info.HTML
ECHO "</tr>" >> info.HTML
ECHO " <td></td>" >> info.HTML
ECHO " <tr>" >> info.HTML
ECHO " </tr>" >> info.HTML
ECHO " <td></td>" >> info.HTML
ECHO "<tr>" >> info.HTML
ECHO "<td>HardDriveSize:</td>" >> info.HTML
ECHO "<td>%HDSIZE%</td>" >> info.HTML
ECHO "<td></td>" >> info.HTML
ECHO "</tr>" >> info.HTML
ECHO " <td></td>" >> info.HTML
ECHO " <tr>" >> info.HTML
ECHO " </tr>" >> info.HTML
ECHO " <td></td>" >> info.HTML
ECHO "<tr>" >> info.HTML
ECHO "<td>Cpu:</td>" >> info.HTML
ECHO "<td>%cpu%</td>" >> info.HTML
ECHO "<td></td>" >> info.HTML
ECHO "</tr>" >> info.HTML
ECHO " <td></td>" >> info.HTML
ECHO " <tr>" >> info.HTML
ECHO " </tr>" >> info.HTML
ECHO " <td></td>" >> info.HTML
ECHO "<tr>" >> info.HTML
ECHO "<td>Model:</td>" >> info.HTML
ECHO "<td>%model%</td>" >> info.HTML
ECHO "<td></td>" >> info.HTML
ECHO "</tr>" >> info.HTML
ECHO " <td></td>" >> info.HTML
ECHO " <tr>" >> info.HTML
ECHO " </tr>" >> info.HTML
ECHO " <td></td>" >> info.HTML
ECHO "<tr>" >> info.HTML
ECHO "<td>Memory:</td>" >> info.HTML
ECHO "<td>%mem%</td>" >> info.HTML
ECHO "<td></td>" >> info.HTML
ECHO "</tr>" >> info.HTML
ECHO " <td></td>" >> info.HTML
ECHO " <tr>" >> info.HTML
ECHO " </tr>" >> info.HTML
ECHO " <td></td>" >> info.HTML
ECHO " <td></td>" >> info.HTML
ECHO " <tr>" >> info.HTML
ECHO " </tr>" >> info.HTML
ECHO " <td></td>" >> info.HTML
ECHO " </table>" >> info.HTML
ECHO " </body>" >> info.HTML
ECHO " </html>" >> info.HTML
DEL MEMSIZE*
DEL MODEL*
DEL CPU*
DEL SERIAL*
del HARDR*
cd ..
Code: Select all
@echo off
cd phonesinfo
adb shell getprop ro.serialno > serial.txt
adb shell getprop ro.boot.serialno >> serial.txt
adb shell getprop ro.product.model > model.txt
adb shell getprop ro.product.vendor.manufacturer > manuf.txt
adb shell getprop ro.carrier > carrier.txt
adb shell getprop ro.logd.size.stats > memsize.txt
adb shell getprop ril.serialnumber > othermodel.txt
adb shell df /data > hdsize.txt
for /f "DELIMS=" %%i in ('MORE othermodel.txt') do set otmodel="%%i"
for /f "tokens=2" %%i in ('MORE hdsize.txt') do set hdsize="%%i"
for /f "DELIMS=" %%i in ('MORE manuf.txt') do set manuf="%%i"
for /f "DELIMS=" %%i in ('MORE serial.txt') do set seri="%%i"
for /f "DELIMS=" %%i in ('MORE MODEL.txt') do set model="%%i"
for /f "DELIMS=" %%i in ('MORE carrier.txt') do set carr="%%i"
for /f "DELIMS=" %%i in ('MORE memsize.txt ') do set mem="%%i"
del *.txt
md %model%.%seri%
cd %model%.%seri%
echo "" > %model%.%seri%.txt
echo hdsize= %hdsize% >> %model%.%seri%.txt
echo manufacturer= %manuf% >> %model%.%seri%.txt
echo model= %model% >> %model%.%seri%.txt
echo memory= %mem% >> %model%.%seri%.txt
echo carrier= %carr% >> %model%.%seri%.txt
echo serial= %seri% >> %model%.%seri%.txt
echo othermodel= %otmodel% >> %model%.%seri%.txt
adb shell getprop > %model%.%seri%.getprop.txt
echo "this program is ment to wipe a phone"
echo "if at any time anything dose not look right just hit ctrl + c it will ask if you wanna terminate select yes"
set /p as="in order to reboot into bootloader and wipe phone press enter to continue (you may have to still wipe manually"
adb reboot recovery