Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
humanlike
Advanced tools
Readme
Produces a sequence of numbers [0 - 86399] (nth second within the day) that represent the timings of all the google searches comimg from a regular google user.
> var human = require('humanlike');
> var today = (new Date((new Date()).getFullYear(), (new Date()).getMonth(), (new Date()).getDate()))
> human(10).forEach(function(t) { console.log(new Date(today.now()+ t*1000).toString().split(" ")[4]) });
08:55:35
10:56:37
12:14:12
12:14:42
12:15:11
12:15:37
12:16:08
12:16:38
12:17:08
12:26:00
12:26:26
12:26:55
12:27:28
12:28:10
12:28:41
12:29:08
> human(100).forEach(function(t) {
var millisecs = today.now()+t*1000 - Date.now()
if (millisecs > 0 ) setTimeout(do_something,milisecs)
})
The sequence of seconds genarated by the function is randomized so as it is different every time. The first parameter controls (approximately) the length of the resulting array.
The function could be used by someone that wants to emulate a user that accesses any site - not just searching. It uses a simple model to approximate the human activity :
Given the model above the function's primary parameter (# of searches per day) can be used together with the poisson derived # of session to determine the # of sessions in the day. Due to time potential overlap a session is not guaranteed to finish - the user may "jump" to sth else.
The function allows for timezone offset, as well as a parameter that can be used to determine the day of the week (e.g. weekday vs weekend behavior variation)
Model defaults
var defaults = {
weekday_start_hour : [9,0.3], // normal 9am mean sigma 0.3
weekday_end_hour : [18,0.3], // normal 6pm mean sigma 0.3
weekend_start_hour : [10,0.4], // normal 10am mean sigma 0.4
weekend_end_hour : [21,0.4], // normal 9pm mean sigma 0.4
weekend_sessions : 8, // poisson lambda 8
searches_in_session : 4, // bernoulli p=0.25 => mean tosses 1/p => 4
search_interval : [30,5] // normal 30secs mean sigma 5 secs
}
Parameters:
/*
* @total approximate rate of searches per day
* @when timestamp for which date should be used - leave null for now
* @tz_offset if human at east coast GMT-5 and server at west coast GMT-8 then tzoffset=3
* @opts overrides defaults hash above
*/
module.exports = function(total,when,tz_offset,opts) {
Installing the module
npm install humanlike
FAQs
Emulates human to generates random timeseries of web session activity
The npm package humanlike receives a total of 2 weekly downloads. As such, humanlike popularity was classified as not popular.
We found that humanlike demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.