Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create UI for IP Scanner #168

Open
wants to merge 3 commits into
base: feature/react
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Custom issue template
about: Describe this issue template's purpose here.
title: ''
labels: help wanted, up for grabs
labels: help wanted, up for grabs, gssoc21
assignees: vinitshahdeo

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE REQUEST]"
labels: enhancement, help wanted, up for grabs
labels: enhancement, help wanted, up for grabs, gssoc21
assignees: vinitshahdeo

---
Expand Down
18 changes: 9 additions & 9 deletions src/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
remoteServerIP = socket.gethostbyname(remoteServer)

# Print a nice banner with information on which host we are about to scan
print "-" * 60
print "Please wait, scanning remote host....", remoteServerIP
print "-" * 60
print ("-" * 60)
print ("Please wait, scanning remote host....", remoteServerIP)
print ("-" * 60)

# Resolves the relative path to absolute path
# [BUG]: https://github.com/vinitshahdeo/PortScanner/issues/19
Expand All @@ -38,7 +38,7 @@ def get_absolute_path(relative_path):
try:
with open(get_absolute_path('../config.json')) as config_file:
config = json.load(config_file)
print get_absolute_path('../config.json')
print (get_absolute_path('../config.json'))
range_high = int(config['range']['high'])
range_low = int(config['range']['low'])
# defining number of threads running concurrently
Expand All @@ -58,19 +58,19 @@ def scan(ports, range_low, range_high):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex((remoteServerIP, port))
if result == 0:
print "Port {}: Open".format(port)
print ("Port {}: Open".format(port))
sock.close()

except KeyboardInterrupt:
print "You pressed Ctrl+C"
print ("You pressed Ctrl+C")
sys.exit()

except socket.gaierror:
print 'Hostname could not be resolved. Exiting'
print ('Hostname could not be resolved. Exiting')
sys.exit()

except socket.error:
print "Couldn't connect to server"
print ("Couldn't connect to server")
sys.exit()


Expand All @@ -84,4 +84,4 @@ def scan(ports, range_low, range_high):
total = t2 - t1

# Printing the information to screen
print 'Scanning Completed in: ', total
print ('Scanning Completed in: ', total)
8 changes: 4 additions & 4 deletions src/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="static/css/materialize.min.css" media="screen,projection" />
<link type="text/css" rel="stylesheet" href="../static/css/materialize.min.css" media="screen,projection" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<link href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="static\css\index.css">
<link rel="stylesheet" href="../static\css\index.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>

<script src="static\js\index.js" type="text/javascript"></script>
<script src="../static\js\index.js" type="text/javascript"></script>

<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
Expand Down Expand Up @@ -44,7 +44,7 @@

</ul>

<script type="text/javascript" src="static/js/materialize.min.js"></script>
<script type="text/javascript" src="../static/js/materialize.min.js"></script>
</div>
<div id="showpage">
<span id="showtitle">Port Scanner</span>
Expand Down
23 changes: 23 additions & 0 deletions ui-port-scanner/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
70 changes: 70 additions & 0 deletions ui-port-scanner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `npm run build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
Loading