Jump to content
PuRiCeL

GeoIP Bash - Script pentru nologine

Recommended Posts

Am vazut pe forum ca se tot vand nologine si m-am gandit sa fac un script care sa zica ce tara sunt.

Avem asa: cat go


#!/bin/bash
# wn nologin geoip scripts.
#

cat $1 |replace " " ":" |replace ":|:no:host" "" >a
for x in `cat a`
do
echo $x | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' >ip
LINE=`cat ip`
IP=`lynx -dump "http://www.geoiptool.com/en/?IP=$LINE" | sed -n '/Host Name/,/Postal code/p'`
COUNTRY=`echo "$IP" | awk 'BEGIN { FS = "\n" ; RS = "" } { print $4 }' | awk '{print $3}'`
CITY=`echo "$IP" | awk 'BEGIN { FS = "\n" ; RS = "" } { print $5 }' | sed -e 's/\(Region:\|Region:.\[15\]\)//g'`
echo "$x | $COUNTRY $CITY"
echo "$x | $COUNTRY $CITY" >>geoip.list
done

Pentru cei mai inceti:

- lista de nologine trebuie sa arate asa:

guest guest 157.253.220.11 | no host
games games 174.115.61.107 | no host
user user 174.115.61.107 | no host
games games 174.117.5.128 | no host
guest guest 174.115.61.107 | no host

- ./go nobash.txt

- nobash.txt este lista ta cu nologine.

Edited by PuRiCeL
Link to comment
Share on other sites

Foarte folositor si multumesc.. acum daca te rog si ai putin timp.. pe geoip afiseaza asa:

Host Name: adsl-68-19-183-202.jan.bellsouth.net

IP Address: 68.19.183.202

Country: United States

Country code: US (USA)

Region: Mississippi

City: Flowood

Postal code: 39232

----------------------------

Ai putea modifica putin sa salveze si orasul si ZIP-ul pentru cele de usa?

gen: user:user:68.19.183.202 | US, Mississippi, Flowood, 39232.

Aveam facut de cineva in php.. cu CURL dar l-am pierdut si m-ar ajuta foarte mult daca le-ar salva asa.

Link to comment
Share on other sites

fara sa fac offtopic, sau sa minimalizez munca OP, cel mai exact geoip de pe planeta asta este cel de la MaxMind - GeoIP | IP Address Locator Demo

este singura companie care lucreaza cu toate procesoarele de orice fel, sa si protejeze clientii de frauda din orice domeniu.

si este axata numai pe acest lucru.

Exista vreo solutie fara sa cumperi?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...