shell script does not scan proper URLPredict filename before downloading from a URL, in shell scriptshell...
Question about tidal forces and the Roche limit
Extending Kan fibrations, without using minimal fibrations
Is it nonsense to say B -> [A -> B]?
Two researchers want to work on the same extension to my paper. Who to help?
Names of the Six Tastes
Is a vertical stabiliser needed for straight line flight in a glider?
Cropping a message using array splits
Was the Highlands Ranch shooting the 115th mass shooting in the US in 2019
Renting a house to a graduate student in my department
Examples where existence is harder than evaluation
What does formal training in a field mean?
Why do unstable nuclei form?
Is there an application which does HTTP PUT?
Detect the first rising edge of 3 input signals
Is there a need for better software for writers?
Succinct and gender-neutral Russian word for "writer"
Why is PerfectForwardSecrecy considered OK, when it has same defects as salt-less password hashing?
What do "KAL." and "A.S." stand for in this inscription?
Noob at soldering, can anyone explain why my circuit wont work?
How to select certain lines (n, n+4, n+8, n+12...) from the file?
How did Thanos not realise this had happened at the end of Endgame?
Are there variations of the regular runtimes of the Big-O-Notation?
Is it bad writing or bad story telling if first person narrative contains more information than the narrator knows?
Create less file for custom Theme
shell script does not scan proper URL
Predict filename before downloading from a URL, in shell scriptshell script - echo command not printing in proper sequenceUrl Decoding shell scriptShell Script does not send email from Cron jobcd command does not work in my shell scriptusing cp in shell script function () does not workWhat does >filename.txt do in shell scriptShell script not found“Proper” way to run shell script as a daemonURL match in a file using shell script
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
This shell script code to read the URL for scanning API based These three lines are read, scanning URL, IP, domain It's reading the URL and IP well
ScriptDir=$HomeDir/python
ResultDir=/home/kia/HTTPOutput/aut
ToDay=`date "+%Y%m%d"`
CheckDATE=`date "+%Y-%m-%d" --date '45 day ago'`
NOWDATE=`date "+%Y-%m-%d"`
AddCheckDate=$1
content=
while read buffer;
do
Check=$content$buffer;
if echo "${Check}" | grep -E "/" >/dev/null; then
URLName=`echo ${Check} | sed 's///-/g'`
echo ${Check}
python $ScriptDir/bin/panafapi.py -K --samples -j -r "{"query":{"operator":"all","children":[{"field":"sample.malware","operator":"is","value":1},{"field":"alias.url","operator":"contains","value":"$ResultFile"},{"field":"sample.create_date","operator":"is in the range","value":["${CheckDATE}T00:00:00","${NOWDATE}T23:59:59"]}]},"scope":"global","size":1,"from":0,"sort":{"create_date":{"order":"desc"}}}" > $ResultDir/HTTP-$URLName-$ToDay.json
ResultData=`cat $ResultDir/HTTP-$URLName-$ToDay.json | jq -r '.hits[]._source | .create_date + "," + .sha256'`
echo "$Check" $ResultData >> $ResultDir/HTTP-Result-${AddCheckDate}.csv
sleep 4
elif echo "${Check}" | grep -E "[0-9]+.[0-9]+.[0-9]+.[0-9]+" >/dev/null; then
echo ${Check}
python $ScriptDir/bin/panafapi.py -K --samples -j -r "{"query":{"operator":"all","children":[{"field":"sample.malware","operator":"is","value":1},{"field":"alias.ip_address","operator":"contains","value":"$ResultFile"},{"field":"sample.create_date","operator":"is in the range","value":["${CheckDATE}T00:00:00","${NOWDATE}T23:59:59"]}]},"scope":"global","size":1,"from":0,"sort":{"create_date":{"order":"desc"}}}" > $ResultDir/HTTP-$ResultFile-$ToDay.json
ResultData=`cat $ResultDir/HTTP-$ResultFile-$ToDay.json | jq -r '.hits[]._source | .create_date + "," + .sha256'`
echo "$Check" $ResultData >> $ResultDir/HTTP-Result-${AddCheckDate}.csv
sleep 4
else
echo ${Check}
python $ScriptDir/bin/panafapi.py -K --samples -j -r "{"query":{"operator":"all","children":[{"field":"sample.malware","operator":"is","value":1},{"field":"alias.domain","operator":"contains","value":"$ResultFile"},{"field":"sample.create_date","operator":"is in the range","value":["${CheckDATE}T00:00:00","${NOWDATE}T23:59:59"]}]},"scope":"global","size":1,"from":0,"sort":{"create_date":{"order":"desc"}}}" > $ResultDir/HTTP-$ResultFile-$ToDay.json
ResultData=`cat $ResultDir/HTTP-$ResultFile-$ToDay.json | jq -r '.hits[]._source | .create_date + "," + .sha256'`
echo "$Check" $ResultData >> $ResultDir/HTTP-Result-${AddCheckDate}.csv
sleep 4
fi
done
The problem is that this line and its not read this type of domain google.com:443 how to use the condition too read the url and remove the :443
else
echo ${Check}
python $ScriptDir/bin/panafapi.py -K --samples -j -r "{"query":{"operator":"all","children":[{"field":"sample.malware","operator":"is","value":1},{"field":"alias.domain","operator":"contains","value":"$ResultFile"},{"field":"sample.create_date","operator":"is in the range","value":["${CheckDATE}T00:00:00","${NOWDATE}T23:59:59"]}]},"scope":"global","size":1,"from":0,"sort":{"create_date":{"order":"desc"}}}" > $ResultDir/HTTP-$ResultFile-$ToDay.json
ResultData=`cat $ResultDir/HTTP-$ResultFile-$ToDay.json | jq -r '.hits[]._source | .create_date + "," + .sha256'`
echo "$Check" $ResultData >> $ResultDir/HTTP-Result-${AddCheckDate}.csv
sleep 4
How can this URL be read and deleted :443
error:
http://google.com/
samples_search: 200 OK 339 0%
samples_results: 200 OK 798 100% hits=0 total=0 time=0:00:00.668 "complete"
google.com:443
samples_search_results: "HTTP Error 409: Conflict Invalid license"
shell-script
New contributor
add a comment |
This shell script code to read the URL for scanning API based These three lines are read, scanning URL, IP, domain It's reading the URL and IP well
ScriptDir=$HomeDir/python
ResultDir=/home/kia/HTTPOutput/aut
ToDay=`date "+%Y%m%d"`
CheckDATE=`date "+%Y-%m-%d" --date '45 day ago'`
NOWDATE=`date "+%Y-%m-%d"`
AddCheckDate=$1
content=
while read buffer;
do
Check=$content$buffer;
if echo "${Check}" | grep -E "/" >/dev/null; then
URLName=`echo ${Check} | sed 's///-/g'`
echo ${Check}
python $ScriptDir/bin/panafapi.py -K --samples -j -r "{"query":{"operator":"all","children":[{"field":"sample.malware","operator":"is","value":1},{"field":"alias.url","operator":"contains","value":"$ResultFile"},{"field":"sample.create_date","operator":"is in the range","value":["${CheckDATE}T00:00:00","${NOWDATE}T23:59:59"]}]},"scope":"global","size":1,"from":0,"sort":{"create_date":{"order":"desc"}}}" > $ResultDir/HTTP-$URLName-$ToDay.json
ResultData=`cat $ResultDir/HTTP-$URLName-$ToDay.json | jq -r '.hits[]._source | .create_date + "," + .sha256'`
echo "$Check" $ResultData >> $ResultDir/HTTP-Result-${AddCheckDate}.csv
sleep 4
elif echo "${Check}" | grep -E "[0-9]+.[0-9]+.[0-9]+.[0-9]+" >/dev/null; then
echo ${Check}
python $ScriptDir/bin/panafapi.py -K --samples -j -r "{"query":{"operator":"all","children":[{"field":"sample.malware","operator":"is","value":1},{"field":"alias.ip_address","operator":"contains","value":"$ResultFile"},{"field":"sample.create_date","operator":"is in the range","value":["${CheckDATE}T00:00:00","${NOWDATE}T23:59:59"]}]},"scope":"global","size":1,"from":0,"sort":{"create_date":{"order":"desc"}}}" > $ResultDir/HTTP-$ResultFile-$ToDay.json
ResultData=`cat $ResultDir/HTTP-$ResultFile-$ToDay.json | jq -r '.hits[]._source | .create_date + "," + .sha256'`
echo "$Check" $ResultData >> $ResultDir/HTTP-Result-${AddCheckDate}.csv
sleep 4
else
echo ${Check}
python $ScriptDir/bin/panafapi.py -K --samples -j -r "{"query":{"operator":"all","children":[{"field":"sample.malware","operator":"is","value":1},{"field":"alias.domain","operator":"contains","value":"$ResultFile"},{"field":"sample.create_date","operator":"is in the range","value":["${CheckDATE}T00:00:00","${NOWDATE}T23:59:59"]}]},"scope":"global","size":1,"from":0,"sort":{"create_date":{"order":"desc"}}}" > $ResultDir/HTTP-$ResultFile-$ToDay.json
ResultData=`cat $ResultDir/HTTP-$ResultFile-$ToDay.json | jq -r '.hits[]._source | .create_date + "," + .sha256'`
echo "$Check" $ResultData >> $ResultDir/HTTP-Result-${AddCheckDate}.csv
sleep 4
fi
done
The problem is that this line and its not read this type of domain google.com:443 how to use the condition too read the url and remove the :443
else
echo ${Check}
python $ScriptDir/bin/panafapi.py -K --samples -j -r "{"query":{"operator":"all","children":[{"field":"sample.malware","operator":"is","value":1},{"field":"alias.domain","operator":"contains","value":"$ResultFile"},{"field":"sample.create_date","operator":"is in the range","value":["${CheckDATE}T00:00:00","${NOWDATE}T23:59:59"]}]},"scope":"global","size":1,"from":0,"sort":{"create_date":{"order":"desc"}}}" > $ResultDir/HTTP-$ResultFile-$ToDay.json
ResultData=`cat $ResultDir/HTTP-$ResultFile-$ToDay.json | jq -r '.hits[]._source | .create_date + "," + .sha256'`
echo "$Check" $ResultData >> $ResultDir/HTTP-Result-${AddCheckDate}.csv
sleep 4
How can this URL be read and deleted :443
error:
http://google.com/
samples_search: 200 OK 339 0%
samples_results: 200 OK 798 100% hits=0 total=0 time=0:00:00.668 "complete"
google.com:443
samples_search_results: "HTTP Error 409: Conflict Invalid license"
shell-script
New contributor
clearly define your inputs and the output you getting and the output you expected. Only include relevant portions from what you tried.
– amisax
3 mins ago
add a comment |
This shell script code to read the URL for scanning API based These three lines are read, scanning URL, IP, domain It's reading the URL and IP well
ScriptDir=$HomeDir/python
ResultDir=/home/kia/HTTPOutput/aut
ToDay=`date "+%Y%m%d"`
CheckDATE=`date "+%Y-%m-%d" --date '45 day ago'`
NOWDATE=`date "+%Y-%m-%d"`
AddCheckDate=$1
content=
while read buffer;
do
Check=$content$buffer;
if echo "${Check}" | grep -E "/" >/dev/null; then
URLName=`echo ${Check} | sed 's///-/g'`
echo ${Check}
python $ScriptDir/bin/panafapi.py -K --samples -j -r "{"query":{"operator":"all","children":[{"field":"sample.malware","operator":"is","value":1},{"field":"alias.url","operator":"contains","value":"$ResultFile"},{"field":"sample.create_date","operator":"is in the range","value":["${CheckDATE}T00:00:00","${NOWDATE}T23:59:59"]}]},"scope":"global","size":1,"from":0,"sort":{"create_date":{"order":"desc"}}}" > $ResultDir/HTTP-$URLName-$ToDay.json
ResultData=`cat $ResultDir/HTTP-$URLName-$ToDay.json | jq -r '.hits[]._source | .create_date + "," + .sha256'`
echo "$Check" $ResultData >> $ResultDir/HTTP-Result-${AddCheckDate}.csv
sleep 4
elif echo "${Check}" | grep -E "[0-9]+.[0-9]+.[0-9]+.[0-9]+" >/dev/null; then
echo ${Check}
python $ScriptDir/bin/panafapi.py -K --samples -j -r "{"query":{"operator":"all","children":[{"field":"sample.malware","operator":"is","value":1},{"field":"alias.ip_address","operator":"contains","value":"$ResultFile"},{"field":"sample.create_date","operator":"is in the range","value":["${CheckDATE}T00:00:00","${NOWDATE}T23:59:59"]}]},"scope":"global","size":1,"from":0,"sort":{"create_date":{"order":"desc"}}}" > $ResultDir/HTTP-$ResultFile-$ToDay.json
ResultData=`cat $ResultDir/HTTP-$ResultFile-$ToDay.json | jq -r '.hits[]._source | .create_date + "," + .sha256'`
echo "$Check" $ResultData >> $ResultDir/HTTP-Result-${AddCheckDate}.csv
sleep 4
else
echo ${Check}
python $ScriptDir/bin/panafapi.py -K --samples -j -r "{"query":{"operator":"all","children":[{"field":"sample.malware","operator":"is","value":1},{"field":"alias.domain","operator":"contains","value":"$ResultFile"},{"field":"sample.create_date","operator":"is in the range","value":["${CheckDATE}T00:00:00","${NOWDATE}T23:59:59"]}]},"scope":"global","size":1,"from":0,"sort":{"create_date":{"order":"desc"}}}" > $ResultDir/HTTP-$ResultFile-$ToDay.json
ResultData=`cat $ResultDir/HTTP-$ResultFile-$ToDay.json | jq -r '.hits[]._source | .create_date + "," + .sha256'`
echo "$Check" $ResultData >> $ResultDir/HTTP-Result-${AddCheckDate}.csv
sleep 4
fi
done
The problem is that this line and its not read this type of domain google.com:443 how to use the condition too read the url and remove the :443
else
echo ${Check}
python $ScriptDir/bin/panafapi.py -K --samples -j -r "{"query":{"operator":"all","children":[{"field":"sample.malware","operator":"is","value":1},{"field":"alias.domain","operator":"contains","value":"$ResultFile"},{"field":"sample.create_date","operator":"is in the range","value":["${CheckDATE}T00:00:00","${NOWDATE}T23:59:59"]}]},"scope":"global","size":1,"from":0,"sort":{"create_date":{"order":"desc"}}}" > $ResultDir/HTTP-$ResultFile-$ToDay.json
ResultData=`cat $ResultDir/HTTP-$ResultFile-$ToDay.json | jq -r '.hits[]._source | .create_date + "," + .sha256'`
echo "$Check" $ResultData >> $ResultDir/HTTP-Result-${AddCheckDate}.csv
sleep 4
How can this URL be read and deleted :443
error:
http://google.com/
samples_search: 200 OK 339 0%
samples_results: 200 OK 798 100% hits=0 total=0 time=0:00:00.668 "complete"
google.com:443
samples_search_results: "HTTP Error 409: Conflict Invalid license"
shell-script
New contributor
This shell script code to read the URL for scanning API based These three lines are read, scanning URL, IP, domain It's reading the URL and IP well
ScriptDir=$HomeDir/python
ResultDir=/home/kia/HTTPOutput/aut
ToDay=`date "+%Y%m%d"`
CheckDATE=`date "+%Y-%m-%d" --date '45 day ago'`
NOWDATE=`date "+%Y-%m-%d"`
AddCheckDate=$1
content=
while read buffer;
do
Check=$content$buffer;
if echo "${Check}" | grep -E "/" >/dev/null; then
URLName=`echo ${Check} | sed 's///-/g'`
echo ${Check}
python $ScriptDir/bin/panafapi.py -K --samples -j -r "{"query":{"operator":"all","children":[{"field":"sample.malware","operator":"is","value":1},{"field":"alias.url","operator":"contains","value":"$ResultFile"},{"field":"sample.create_date","operator":"is in the range","value":["${CheckDATE}T00:00:00","${NOWDATE}T23:59:59"]}]},"scope":"global","size":1,"from":0,"sort":{"create_date":{"order":"desc"}}}" > $ResultDir/HTTP-$URLName-$ToDay.json
ResultData=`cat $ResultDir/HTTP-$URLName-$ToDay.json | jq -r '.hits[]._source | .create_date + "," + .sha256'`
echo "$Check" $ResultData >> $ResultDir/HTTP-Result-${AddCheckDate}.csv
sleep 4
elif echo "${Check}" | grep -E "[0-9]+.[0-9]+.[0-9]+.[0-9]+" >/dev/null; then
echo ${Check}
python $ScriptDir/bin/panafapi.py -K --samples -j -r "{"query":{"operator":"all","children":[{"field":"sample.malware","operator":"is","value":1},{"field":"alias.ip_address","operator":"contains","value":"$ResultFile"},{"field":"sample.create_date","operator":"is in the range","value":["${CheckDATE}T00:00:00","${NOWDATE}T23:59:59"]}]},"scope":"global","size":1,"from":0,"sort":{"create_date":{"order":"desc"}}}" > $ResultDir/HTTP-$ResultFile-$ToDay.json
ResultData=`cat $ResultDir/HTTP-$ResultFile-$ToDay.json | jq -r '.hits[]._source | .create_date + "," + .sha256'`
echo "$Check" $ResultData >> $ResultDir/HTTP-Result-${AddCheckDate}.csv
sleep 4
else
echo ${Check}
python $ScriptDir/bin/panafapi.py -K --samples -j -r "{"query":{"operator":"all","children":[{"field":"sample.malware","operator":"is","value":1},{"field":"alias.domain","operator":"contains","value":"$ResultFile"},{"field":"sample.create_date","operator":"is in the range","value":["${CheckDATE}T00:00:00","${NOWDATE}T23:59:59"]}]},"scope":"global","size":1,"from":0,"sort":{"create_date":{"order":"desc"}}}" > $ResultDir/HTTP-$ResultFile-$ToDay.json
ResultData=`cat $ResultDir/HTTP-$ResultFile-$ToDay.json | jq -r '.hits[]._source | .create_date + "," + .sha256'`
echo "$Check" $ResultData >> $ResultDir/HTTP-Result-${AddCheckDate}.csv
sleep 4
fi
done
The problem is that this line and its not read this type of domain google.com:443 how to use the condition too read the url and remove the :443
else
echo ${Check}
python $ScriptDir/bin/panafapi.py -K --samples -j -r "{"query":{"operator":"all","children":[{"field":"sample.malware","operator":"is","value":1},{"field":"alias.domain","operator":"contains","value":"$ResultFile"},{"field":"sample.create_date","operator":"is in the range","value":["${CheckDATE}T00:00:00","${NOWDATE}T23:59:59"]}]},"scope":"global","size":1,"from":0,"sort":{"create_date":{"order":"desc"}}}" > $ResultDir/HTTP-$ResultFile-$ToDay.json
ResultData=`cat $ResultDir/HTTP-$ResultFile-$ToDay.json | jq -r '.hits[]._source | .create_date + "," + .sha256'`
echo "$Check" $ResultData >> $ResultDir/HTTP-Result-${AddCheckDate}.csv
sleep 4
How can this URL be read and deleted :443
error:
http://google.com/
samples_search: 200 OK 339 0%
samples_results: 200 OK 798 100% hits=0 total=0 time=0:00:00.668 "complete"
google.com:443
samples_search_results: "HTTP Error 409: Conflict Invalid license"
shell-script
shell-script
New contributor
New contributor
New contributor
asked 1 hour ago
AngelineAngeline
1
1
New contributor
New contributor
clearly define your inputs and the output you getting and the output you expected. Only include relevant portions from what you tried.
– amisax
3 mins ago
add a comment |
clearly define your inputs and the output you getting and the output you expected. Only include relevant portions from what you tried.
– amisax
3 mins ago
clearly define your inputs and the output you getting and the output you expected. Only include relevant portions from what you tried.
– amisax
3 mins ago
clearly define your inputs and the output you getting and the output you expected. Only include relevant portions from what you tried.
– amisax
3 mins ago
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Angeline is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f518128%2fshell-script-does-not-scan-proper-url%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Angeline is a new contributor. Be nice, and check out our Code of Conduct.
Angeline is a new contributor. Be nice, and check out our Code of Conduct.
Angeline is a new contributor. Be nice, and check out our Code of Conduct.
Angeline is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f518128%2fshell-script-does-not-scan-proper-url%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
clearly define your inputs and the output you getting and the output you expected. Only include relevant portions from what you tried.
– amisax
3 mins ago