new commit - change strings

new commit - change strings
This commit is contained in:
microsvuln
2021-04-03 15:47:22 +04:00
parent 6c88b6b362
commit 70e9757044
7 changed files with 15 additions and 13 deletions

View File

@ -57,6 +57,7 @@ def copy_tokens(cur, tokenpath) :
subprocess.call(["cp " + cur + "/" + "memcmp-strs/*" + " " + cur + "/" + tokenpath + "/."] ,shell=True)
subprocess.call(["cp " + cur + "/" + "lits/*" + " " + cur + "/" + tokenpath + "/."] ,shell=True)
subprocess.call(["cp " + cur + "/" + "strtool-strs/*" + " " + cur + "/" + tokenpath + "/."] ,shell=True)
subprocess.call(["find "+tokenpath+" -size 0 -delete"],shell=True)

View File

@ -3,7 +3,6 @@ if [ -d "codeql-home" ]; then
echo "Exist !"
exit 1
fi
sudo apt install build-essential libtool-bin python3-dev automake git vim wget -y
mkdir codeql-home
cd codeql-home
git clone https://github.com/github/codeql.git codeql-repo
@ -12,6 +11,7 @@ wget https://github.com/github/codeql-cli-binaries/releases/download/v2.4.6/code
unzip codeql-linux64.zip
mv codeql codeql-cli
export "PATH=~/codeql-home/codeql-cli/:$PATH"
echo "export PATH=~/codeql-home/codeql-cli/:$PATH" >> ~/.bashrc
codeql resolve languages
codeql resolve qlpacks
echo "export PATH=~/codeql-home/codeql-cli/:$PATH" >> ~/.bashrc
codeql

View File

@ -46,9 +46,8 @@ def do_string_analysis(corpdir, infile1):
str11 = str11.replace("\n","")
str11 = str11.lstrip()
str11 = str11.rstrip()
print("all strings : %s" % str11)
str11 = str(str11)
if ((" " in str11 ) or (")" in str11) or ("(" in str11)):
if ((" " in str11 ) or (")" in str11) or ("(" in str11) or ("<" in str11) or (">" in str11)) :
print("Space / Paranthesis String : %s" % str11)
else :
with open(corpdir+'/memcmp-str{0}'.format(n), 'w') as file:

View File

@ -31,13 +31,18 @@ You can write other CodeQL scripts to extract possible effective tokens if you t
## Usage
Before proceed to installation make sure that you have the following packages by installing them :
```shell
sudo apt install build-essential libtool-bin python3-dev python3 automake git vim wget -y
```
The usage of Autodict-QL is pretty easy. But let's describe it as :
1. First of all, you need to have CodeQL installed on the system. we make this possible with `build-codeql.sh` bash script. This script will install CodeQL completety and will set the required environment variables for your system, so :
1. First of all, you need to have CodeQL installed on the system. we make this possible with `build-codeql.sh` bash script. This script will install CodeQL completety and will set the required environment variables for your system.
Do the following :
```shell
# chmod +x codeql-build.sh
# sudo ./codeql-build.sh
# ./codeql-build.sh
# source ~/.bashrc
# codeql
```
Then you should get :

View File

@ -46,9 +46,8 @@ def do_string_analysis(corpdir, infile1):
str11 = str11.replace("\n","")
str11 = str11.lstrip()
str11 = str11.rstrip()
print("all strings : %s" % str11)
str11 = str(str11)
if ((" " in str11 ) or (")" in str11) or ("(" in str11)) or ("<" in str11) or (">" in str11) :
if ((" " in str11 ) or (")" in str11) or ("(" in str11) or ("<" in str11) or (">" in str11)) :
print("Space / Paranthesis String : %s" % str11)
else :
with open(corpdir+'/seed-str{0}'.format(n), 'w') as file:

View File

@ -46,9 +46,8 @@ def do_string_analysis(corpdir, infile1):
str11 = str11.replace("\n","")
str11 = str11.lstrip()
str11 = str11.rstrip()
print("all strings : %s" % str11)
str11 = str(str11)
if ((" " in str11 ) or (")" in str11) or ("(" in str11)):
if ((" " in str11 ) or (")" in str11) or ("(" in str11) or ("<" in str11) or (">" in str11)) :
print("Space / Paranthesis String : %s" % str11)
else :
with open(corpdir+'/strcmp-str{0}'.format(n), 'w') as file:

View File

@ -46,9 +46,8 @@ def do_string_analysis(corpdir, infile1):
str11 = str11.replace("\n","")
str11 = str11.lstrip()
str11 = str11.rstrip()
print("all strings : %s" % str11)
str11 = str(str11)
if ((" " in str11 ) or (")" in str11) or ("(" in str11)):
if ((" " in str11 ) or (")" in str11) or ("(" in str11) or ("<" in str11) or (">" in str11)) :
print("Space / Paranthesis String : %s" % str11)
else :
with open(corpdir+'/strncmp-str{0}'.format(n), 'w') as file: