When considering what types of projects to do for the **Rust Project** tutorial series after I finished the [Intro to Rust](https://www.youtube.com/watch?v=EYqceb2AnkU&list=PLJbE2Yu2zumDF6BX6_RdPisRVHgzV02NW) series, one of the first ideas that came to my mind was a CLI tool. After going through many different Linux tools, I settled on building a **port sniffer** because it is a *multi-threaded* project and it allowed me to build the entire tool without using a single *3rd party dependency* or *library*. Admittedly, had I used at least one third party library, the tool would have been much cleaner but that is simply because the library in question does a lot of the heavy lifting for us. From an educational standpoint, it made more sense to build this particular tool without relying on a DSL or a *non-standard library*. Our **CLI port sniffer** is a minimal viable product but it can easily be extended to include tons of other features should you feel the need to add them. We use a vector of strings to collect our arguments and then create a struct to hold the data of these arguments. We then use a method for the struct to check the arguments so that we are getting the correct patterns from the user. After instantiating our struct's data using the method, we then create a *scalable* amount of threads based on the user input to preform the task. Given that Rust uses **OS Threads** and not **Green threads**, your assigned threads will depend on the power of your computer and the operating system that you are using. *Each operating system has a maximum number of threads it assigns to a single process and a faster computer will be able to use more then a slower one.* The tool then iterates through all of the potential ports that could be open on the called IP and returns any ports that return a connection. This type of tool can be useful to gain information on what ports could potentially be open on your system or router without your knowledge and also could potentially be used for malicious means (though you would would need the know how and many more tools to do so.). This was a fun little project to make and it was deceptively difficult at times to write in a live coded session as a result of the multiple constrants that I put on myself. *I hope you guys enjoy this video and I hope it also helps you better understand the language of Rust. There are many more projects to come* **Full Github Source Code** is [here](https://github.com/tensor-programming/Rust_Port_Sniffer) <iframe width="560" height="315" src="https://www.youtube.com/embed/-Jp7sabBCp4" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe> *If you enjoy the video, feel free to follow me on Steemit or on YouTube to get updates on the channel as well as more content.* *If you like what I do, tips and upvotes are welcome:* *ETH: 0xE448a8DDA5886C49d35B191B2F20630c103024c8* *LTC: LXsKxF5JhmMtKgqfcUFdvcXVwiaSqxN9cP* *Also, feel free to check out my channel for videos on Go, Elixir and Elm*
author | tensor |
---|---|
permlink | rust-project-cli-port-sniffer-tool |
category | technology |
json_metadata | {"tags":["technology","steemstem","science","programming","utopian-io"],"image":["https://img.youtube.com/vi/-Jp7sabBCp4/0.jpg"],"links":["https://www.youtube.com/watch?v=EYqceb2AnkU&list=PLJbE2Yu2zumDF6BX6_RdPisRVHgzV02NW","https://github.com/tensor-programming/Rust_Port_Sniffer","https://www.youtube.com/embed/-Jp7sabBCp4"],"app":"steemit/0.1","format":"markdown"} |
created | 2017-12-20 05:02:39 |
last_update | 2017-12-25 09:14:09 |
depth | 0 |
children | 6 |
last_payout | 2017-12-27 05:02:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 33.850 HBD |
curator_payout_value | 10.149 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 3,051 |
author_reputation | 87,856,203,149,624 |
root_title | "Rust Project: CLI Port Sniffer Tool" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 24,295,364 |
net_rshares | 6,968,858,344,905 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
fminerten | 0 | 173,665,631,288 | 5% | ||
steempty | 0 | 135,875,382,591 | 5% | ||
pharesim | 0 | 106,395,906,337 | 0.15% | ||
lafona-miner | 0 | 404,161,259,845 | 20% | ||
kushed | 0 | 11,923,836,673 | 6% | ||
xeroc | 0 | 1,766,464,124 | 1.8% | ||
steem-id | 0 | 6,453,309,935 | 1.8% | ||
gregory-f | 0 | 806,113,154 | 2.31% | ||
blakemiles84 | 0 | 2,962,077,340 | 1.8% | ||
justtryme90 | 0 | 875,355,540,729 | 34% | ||
anwenbaumeister | 0 | 140,377,597,157 | 6% | ||
isteemit | 0 | 2,197,784,077 | 0.57% | ||
phenom | 0 | 1,602,843,066 | 1.8% | ||
bitcoiner | 0 | 9,948,092,695 | 1.8% | ||
liberosist | 0 | 364,622,524,156 | 6% | ||
toxichan | 0 | 1,355,033,500 | 6% | ||
timsaid | 0 | 23,790,033,994 | 8% | ||
lemouth | 0 | 48,052,804,203 | 20% | ||
rjbauer85 | 0 | 1,245,400,323 | 40% | ||
anarchyhasnogods | 0 | 93,114,921,365 | 40% | ||
lamouthe | 0 | 4,739,815,525 | 40% | ||
dan-bn | 0 | 9,056,014,061 | 1.8% | ||
anomaly | 0 | 371,969,796 | 1% | ||
steemedia | 0 | 639,957,011 | 6% | ||
meerkat | 0 | 63,671,421,931 | 6% | ||
curie | 0 | 257,571,463,109 | 6% | ||
cebymaster | 0 | 727,986,544 | 6% | ||
eliot01 | 0 | 569,602,181 | 100% | ||
techslut | 0 | 78,971,796,699 | 8% | ||
hendrikdegrote | 0 | 2,971,865,691,808 | 6% | ||
steemstem | 0 | 404,360,087,701 | 40% | ||
cotidiana | 0 | 712,463,247 | 6% | ||
foundation | 0 | 3,381,007,569 | 40% | ||
ethandsmith | 0 | 2,223,956,024 | 0.5% | ||
the-devil | 0 | 8,397,241,199 | 40% | ||
dna-replication | 0 | 8,304,297,417 | 30% | ||
oscarps | 0 | 614,537,787 | 2.31% | ||
pacokam8 | 0 | 141,702,419 | 1.2% | ||
jamhuery | 0 | 10,834,682,411 | 40% | ||
jhagi.bhai | 0 | 183,417,952 | 0.6% | ||
scrooger | 0 | 588,421,306 | 1.74% | ||
kingyus | 0 | 115,184,381 | 5% | ||
papadimos | 0 | 10,136,242,294 | 40% | ||
mobbs | 0 | 52,193,429,528 | 40% | ||
shahzadnisar | 0 | 754,557,571 | 6% | ||
bp423 | 0 | 1,491,569,725 | 6% | ||
oscarcc89 | 0 | 101,680,206 | 0.6% | ||
kenchung | 0 | 3,482,992,803 | 8% | ||
robertvogt | 0 | 270,830,482 | 0.6% | ||
diggerdugg | 0 | 561,595,214 | 6% | ||
dber | 0 | 31,716,056,248 | 40% | ||
derosnec | 0 | 145,439,707 | 1.15% | ||
kerriknox | 0 | 140,201,288,344 | 40% | ||
alexander.alexis | 0 | 1,679,184,227 | 8% | ||
suesa | 0 | 76,730,829,311 | 25% | ||
tensor | 0 | 8,727,259,675 | 100% | ||
erangvee | 0 | 4,036,085,051 | 6% | ||
nataliejohnson | 0 | 1,338,661,675 | 5% | ||
rockeynayak | 0 | 243,135,616 | 40% | ||
ted7 | 0 | 58,007,759 | 6% | ||
nitesh9 | 0 | 8,295,654,159 | 40% | ||
himal | 0 | 1,693,179,398 | 40% | ||
nelinoeva | 0 | 568,938,462 | 5.22% | ||
ewuoso | 0 | 612,116,404 | 3% | ||
woz.software | 0 | 4,156,051,293 | 100% | ||
ovij | 0 | 5,044,622,948 | 40% | ||
azirgraff | 0 | 21,131,122,677 | 20% | ||
somethingburger | 0 | 1,764,197,329 | 40% | ||
tanyaschutte | 0 | 1,909,400,716 | 40% | ||
steemitph | 0 | 111,109,357,966 | 100% | ||
theleapingkoala | 0 | 170,123,846 | 1.15% | ||
pearlumie | 0 | 9,039,129,024 | 40% | ||
originalworks | 0 | 2,727,524,438 | 1% | ||
webresultat | 0 | 444,701,662 | 6% | ||
plojslydia | 0 | 111,562,848 | 6% | ||
blogtrovert | 0 | 55,637,744 | 6% | ||
rayken04 | 0 | 60,142,208 | 10% | ||
playitforward | 0 | 267,962,183 | 1.2% | ||
mrblinddraw | 0 | 361,721,818 | 1.8% | ||
imamalkimas | 0 | 369,840,954 | 40% | ||
qurator | 0 | 86,846,037,558 | 5.8% | ||
rachelsmantra | 0 | 1,928,069,484 | 40% | ||
gra | 0 | 12,965,932,450 | 40% | ||
socialspace | 0 | 955,438,202 | 6% | ||
kedi | 0 | 9,596,610,590 | 40% | ||
sci-guy | 0 | 100,145,293 | 40% | ||
kerry234 | 0 | 60,708,674 | 6% | ||
jasimg | 0 | 8,311,382,332 | 6% | ||
mindhacks | 0 | 1,348,666,217 | 40% | ||
robertlyon | 0 | 5,077,818,510 | 100% | ||
raci | 0 | 216,213,090 | 6% | ||
ongoingwow | 0 | 1,560,866,509 | 32% | ||
xanderslee | 0 | 372,915,077 | 6% | ||
amavi | 0 | 5,243,398,539 | 8% | ||
geekpowered | 0 | 11,658,955,858 | 8% | ||
melanie00 | 0 | 991,638,331 | 6% | ||
gentleshaid | 0 | 8,359,755,366 | 40% | ||
rantar | 0 | 6,970,960,603 | 100% | ||
tinowhale | 0 | 635,048,966 | 6% | ||
luoq | 0 | 64,936,857,998 | 100% | ||
shawnvanderveer | 0 | 1,485,326,180 | 6% | ||
codeworkr | 0 | 1,137,620,225 | 100% | ||
superoo7 | 0 | 620,870,710 | 100% |
you're making steemit a great community with your content tensor! keep it up!
author | five34a4b |
---|---|
permlink | rust-project-cli-port-sniffer-tool-comment |
category | technology |
json_metadata | {} |
created | 2017-12-20 21:42:03 |
last_update | 2017-12-20 21:42:03 |
depth | 1 |
children | 1 |
last_payout | 2017-12-27 21:42:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 77 |
author_reputation | 1,119,681,610,239 |
root_title | "Rust Project: CLI Port Sniffer Tool" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 24,417,556 |
net_rshares | 0 |
Thank you that means a lot to me. I try to make the content as engaging as possible. I've got another video coming out tonight and then it the amount of content will probably start to slow down as I start to look at larger projects.
author | tensor |
---|---|
permlink | re-five34a4b-rust-project-cli-port-sniffer-tool-comment-20171220t222720339z |
category | technology |
json_metadata | {"tags":["technology"],"app":"steemit/0.1"} |
created | 2017-12-20 22:27:18 |
last_update | 2017-12-20 22:27:18 |
depth | 2 |
children | 0 |
last_payout | 2017-12-27 22:27:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 234 |
author_reputation | 87,856,203,149,624 |
root_title | "Rust Project: CLI Port Sniffer Tool" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 24,422,926 |
net_rshares | 0 |
<center>Qurator</center> | <center>Your Quality Content Curator</center> -|-|  | This post has been upvoted and given the stamp of authenticity by @qurator. To join the quality content creators and receive daily upvotes click [here](https://steemit.com/qurator/@qurator/qurator-update-3-some-guidelines-and-tier-related-changes) for more info. <center>*Qurator's exclusive support bot is now live. For more info click [HERE](https://steemit.com/qurator/@qurator/qurator-support-bot-alive-and-active-welcome-to-qustodian) or send some SBD and your link to @qustodian to get even more support.*</center>
author | qurator |
---|---|
permlink | re-tensor-rust-project-cli-port-sniffer-tool-20171220t052339228z |
category | technology |
json_metadata | "" |
created | 2017-12-20 05:23:57 |
last_update | 2017-12-20 05:23:57 |
depth | 1 |
children | 0 |
last_payout | 2017-12-27 05:23:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 692 |
author_reputation | 1,646,561,306,958,033 |
root_title | "Rust Project: CLI Port Sniffer Tool" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 24,297,416 |
net_rshares | 0 |
<center></center>
author | steemstem |
---|---|
permlink | re-tensor-rust-project-cli-port-sniffer-tool-20171220t072338833z |
category | technology |
json_metadata | {"tags":["technology"],"image":["https://s18.postimg.org/kazxz8qsp/steem_up.jpg"],"app":"steemit/0.1"} |
created | 2017-12-20 07:23:42 |
last_update | 2017-12-20 07:23:42 |
depth | 1 |
children | 0 |
last_payout | 2017-12-27 07:23:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 68 |
author_reputation | 262,017,435,115,313 |
root_title | "Rust Project: CLI Port Sniffer Tool" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 24,309,615 |
net_rshares | 0 |
@originalworks
author | tensor |
---|---|
permlink | re-tensor-rust-project-cli-port-sniffer-tool-20171220t050714878z |
category | technology |
json_metadata | {"tags":["technology"],"users":["originalworks"],"app":"steemit/0.1"} |
created | 2017-12-20 05:07:15 |
last_update | 2017-12-20 05:07:15 |
depth | 1 |
children | 1 |
last_payout | 2017-12-27 05:07:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 14 |
author_reputation | 87,856,203,149,624 |
root_title | "Rust Project: CLI Port Sniffer Tool" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 24,295,781 |
net_rshares | 0 |
The @OriginalWorks bot has determined this post by @tensor to be original material and upvoted it! <center></center> To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!
author | originalworks |
---|---|
permlink | re-re-tensor-rust-project-cli-port-sniffer-tool-20171220t050714878z-20171220t050832 |
category | technology |
json_metadata | "{"app": "pysteem/0.5.4"}" |
created | 2017-12-20 05:08:33 |
last_update | 2017-12-20 05:08:33 |
depth | 2 |
children | 0 |
last_payout | 2017-12-27 05:08:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 342 |
author_reputation | 79,292,026,602,057 |
root_title | "Rust Project: CLI Port Sniffer Tool" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 24,295,901 |
net_rshares | 0 |