Skip to content

Commit 121b829

Browse files
authored
Create android-scriptdroid.bat
1 parent 3c93cad commit 121b829

File tree

1 file changed

+130
-0
lines changed

1 file changed

+130
-0
lines changed

android-scriptdroid.bat

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
@ECHO OFF
2+
SET /P Filelocation=Please Enter Location:
3+
4+
mkdir %Filelocation%OUTPUT
5+
6+
:: Code to check for presence of Comments
7+
grep -H -i -n -e "//" "%Filelocation%*.java" >> "%Filelocation%OUTPUTTemp_comment.txt"
8+
type -H -i "%Filelocation%*.java" |gawk "//*/,/*//" >>
9+
"%Filelocation%OUTPUTMultilineComments.txt"
10+
grep -H -i -n -v "TODO" "%Filelocation%OUTPUTTemp_comment.txt" >>
11+
"%Filelocation%OUTPUTSinglelineComments.txt"
12+
del %Filelocation%OUTPUTTemp_comment.txt
13+
14+
:: Code to check for insecure usage of SharedPreferences
15+
grep -H -i -n -C2 -e "putString" "%Filelocation%*.java" >>
16+
"%Filelocation%OUTPUTverify_sharedpreferences.txt"
17+
grep -H -i -n -C2 -e "MODE_PRIVATE" "%Filelocation%*.java" >> "%Filelocation%OUTPUTModeprivate.txt"
18+
grep -H -i -n -C2 -e "MODE_WORLD_READABLE" "%Filelocation%*.java" >>
19+
"%Filelocation%OUTPUTWorldreadable.txt"
20+
grep -H -i -n -C2 -e "MODE_WORLD_WRITEABLE" "%Filelocation%*.java" >>
21+
"%Filelocation%OUTPUTWorldwritable.txt"
22+
grep -H -i -n -C2 -e "addPreferencesFromResource" "%Filelocation%*.java" >>
23+
"%Filelocation%OUTPUTverify_sharedpreferences.txt"
24+
25+
:: Code to check for possible TapJacking attack
26+
grep -H -i -n -e filterTouchesWhenObscured="true" "%Filelocation%........reslayout*.xml" >>
27+
"%Filelocation%OUTPUTTemp_tapjacking.txt"
28+
grep -H -i -n -e "<Button" "%Filelocation%........reslayout*.xml" >>
29+
"%Filelocation%OUTPUTtapjackings.txt"
30+
grep -H -i -n -v filterTouchesWhenObscured="true" "%Filelocation%OUTPUTtapjackings.txt" >>
31+
"%Filelocation%OUTPUTTemp_tapjacking.txt"
32+
del %Filelocation%OUTPUTTemp_tapjacking.txt
33+
34+
:: Code to check usage of external storage card for storing information
35+
grep -H -i -n -e "WRITE_EXTERNAL_STORAGE" "%Filelocation%........AndroidManifest.xml" >>
36+
"%Filelocation%OUTPUTSdcardStorage.txt"
37+
grep -H -i -n -e "getExternalStorageDirectory()" "%Filelocation%*.java" >>
38+
"%Filelocation%OUTPUTSdcardStorage.txt"
39+
grep -H -i -n -e "sdcard" "%Filelocation%*.java" >> "%Filelocation%OUTPUTSdcardStorage.txt"
40+
41+
:: Code to check for possible scripting javscript injection
42+
grep -H -i -n -e "addJavascriptInterface()" "%Filelocation%*.java" >>
43+
"%Filelocation%OUTPUTTemp_probableXss.txt"
44+
grep -H -i -n -e "setJavaScriptEnabled(true)" "%Filelocation%*.java" >>
45+
"%Filelocation%OUTPUTTemp_probableXss.txt"
46+
grep -H -i -n -v "import" "%Filelocation%OUTPUTTemp_probableXss.txt" >>
47+
"%Filelocation%OUTPUTprobableXss.txt"
48+
del %Filelocation%OUTPUTTemp_probableXss.txt
49+
50+
:: Code to check for presence of possible weak algorithms
51+
grep -H -i -n -e "MD5" "%Filelocation%*.java" >> "%Filelocation%OUTPUTTemp_weakencryption.txt"
52+
grep -H -i -n -e "base64" "%Filelocation%*.java" >> "%Filelocation%OUTPUTTemp_weakencryption.txt"
53+
grep -H -i -n -e "des" "%Filelocation%*.java" >> "%Filelocation%OUTPUTTemp_weakencryption.txt"
54+
grep -H -i -n -v "import" "%Filelocation%OUTPUTTemp_weakencryption.txt" >>
55+
"%Filelocation%OUTPUTWeakencryption.txt"
56+
del %Filelocation%OUTPUTTemp_weakencryption.txt
57+
58+
:: Code to check for weak transportation medium
59+
grep -H -i -n -C3 "http://" "%Filelocation%*.java" >> "%Filelocation%OUTPUTTemp_overhttp.txt"
60+
grep -H -i -n -C3 -e "HttpURLConnection" "%Filelocation%*.java" >>
61+
"%Filelocation%OUTPUTTemp_overhttp.txt"
62+
grep -H -i -n -C3 -e "URLConnection" "%Filelocation%*.java" >>
63+
"%Filelocation%OUTPUTTemp_OtherUrlConnection.txt"
64+
grep -H -i -n -C3 -e "URL" "%Filelocation%*.java" >>
65+
"%Filelocation%OUTPUTTemp_OtherUrlConnection.txt"
66+
grep -H -i -n -e "TrustAllSSLSocket-Factory" "%Filelocation%*.java" >>
67+
"%Filelocation%OUTPUTBypassSSLvalidations.txt"
68+
grep -H -i -n -e "AllTrustSSLSocketFactory" "%Filelocation%*.java" >>
69+
"%Filelocation%OUTPUTBypassSSLvalidations.txt"
70+
grep -H -i -n -e "NonValidatingSSLSocketFactory" "%Filelocation%*.java" >>
71+
"%Filelocation%OUTPUTBypassSSLvalidations.txt"
72+
grep -H -i -n -v "import" "%Filelocation%OUTPUTTemp_OtherUrlConnection.txt" >>
73+
"%Filelocation%OUTPUTOtherUrlConnections.txt"
74+
del %Filelocation%OUTPUTTemp_OtherUrlConnection.txt
75+
grep -H -i -n -v "import" "%Filelocation%OUTPUTTemp_overhttp.txt" >>
76+
"%Filelocation%OUTPUTUnencryptedTransport.txt"
77+
del %Filelocation%OUTPUTTemp_overhttp.txt
78+
79+
80+
:: Code to check for Autocomplete ON
81+
grep -H -i -n -e "<Input" "%Filelocation%........reslayout*.xml" >>
82+
"%Filelocation%OUTPUTTemp_autocomp.txt"
83+
grep -H -i -n -v "textNoSuggestions" "%Filelocation%OUTPUTTemp_autocomp.txt" >>
84+
"%Filelocation%OUTPUTAutocompleteOn.txt"
85+
del %Filelocation%OUTPUTTemp_autocomp.txt
86+
87+
88+
:: Code to presence of possible SQL Content
89+
grep -H -i -n -e "rawQuery" "%Filelocation%*.java" >> "%Filelocation%OUTPUTTemp_sqlcontent.txt"
90+
grep -H -i -n -e "compileStatement" "%Filelocation%*.java" >>
91+
"%Filelocation%OUTPUTTemp_sqlcontent.txt"
92+
grep -H -i -n -e "db" "%Filelocation%*.java" >> "%Filelocation%OUTPUTTemp_sqlcontent.txt"
93+
grep -H -i -n -e "sqlite" "%Filelocation%*.java" >> "%Filelocation%OUTPUTTemp_sqlcontent.txt"
94+
grep -H -i -n -e "database" "%Filelocation%*.java" >> "%Filelocation%OUTPUTTemp_sqlcontent.txt"
95+
grep -H -i -n -e "insert" "%Filelocation%*.java" >> "%Filelocation%OUTPUTTemp_sqlcontent.txt"
96+
grep -H -i -n -e "delete" "%Filelocation%*.java" >> "%Filelocation%OUTPUTTemp_sqlcontent.txt"
97+
grep -H -i -n -e "select" "%Filelocation%*.java" >> "%Filelocation%OUTPUTTemp_sqlcontent.txt"
98+
grep -H -i -n -e "table" "%Filelocation%*.java" >> "%Filelocation%OUTPUTTemp_sqlcontent.txt"
99+
grep -H -i -n -e "cursor" "%Filelocation%*.java" >> "%Filelocation%OUTPUTTemp_sqlcontent.txt"
100+
grep -H -i -n -v "import" "%Filelocation%OUTPUTTemp_sqlcontent.txt" >>
101+
"%Filelocation%OUTPUTSqlcontents.txt"
102+
del %Filelocation%OUTPUTTemp_sqlcontent.txt
103+
104+
:: Code to check for Logging mechanism
105+
grep -H -i -n -F "Log." "%Filelocation%*.java" >> "%Filelocation%OUTPUTLogging.txt"
106+
107+
:: Code to check for Information in Toast messages
108+
grep -H -i -n -e "Toast.makeText" "%Filelocation%*.java" >> "%Filelocation%OUTPUTTemp_Toast.txt"
109+
grep -H -i -n -v "//" "%Filelocation%OUTPUTTemp_Toast.txt" >>
110+
"%Filelocation%OUTPUTToast_content.txt"
111+
del %Filelocation%OUTPUTTemp_Toast.txt
112+
113+
:: Code to check for Debugging status
114+
grep -H -i -n -e "android:debuggable" "%Filelocation%*.java" >>
115+
"%Filelocation%OUTPUTDebuggingAllowed.txt"
116+
117+
:: Code to check for presence of Device Identifiers
118+
grep -H -i -n -e "uid|user-id|imei|deviceId|deviceSerialNumber|devicePrint|X-DSN|phone
119+
|mdn|did|IMSI|uuid" "%Filelocation%*.java" >> "%Filelocation%OUTPUTTemp_Identifiers.txt"
120+
grep -H -i -n -v "//" "%Filelocation%OUTPUTTemp_Identifiers.txt" >>
121+
"%Filelocation%OUTPUTDevice_Identifier.txt"
122+
del %Filelocation%OUTPUTTemp_Identifiers.txt
123+
124+
:: Code to check for presence of Location Info
125+
grep -H -i -n -e "getLastKnownLocation()|requestLocationUpdates()|getLatitude()|getLongitude()
126+
|LOCATION" "%Filelocation%*.java" >> "%Filelocation%OUTPUTLocationInfo.txt"
127+
128+
:: Code to check for possible Intent Injection
129+
grep -H -i -n -C3 -e "Action.getIntent(" "%Filelocation%*.java" >>
130+
"%Filelocation%OUTPUTIntentValidation.txt"

0 commit comments

Comments
 (0)